ThemeGenerator
extends AbstractThemeUtility
in package
implements
GeneratorInterface
Uses
ConsoleOutputTrait
Class to generate a new theme from a template and reconfigure VuFind to use it.
Tags
Interfaces, Classes, Traits and Enums
- GeneratorInterface
- Interface shared by theme and mixin generator classes.
Table of Contents
- $info : ThemeInfo
- Theme info object
- $lastError : string
- Last error message
- $outputInterface : OutputInterface
- Output interface.
- $pathResolver : PathResolver
- Config file path resolver
- __construct() : mixed
- Constructor
- configure() : bool
- Configure the specified theme as VuFind's new default theme (and one of the alternatives).
- generate() : bool
- Generate a new theme from a template.
- getLastError() : string
- Get last error message.
- setOutputInterface() : mixed
- Set the output interface. Implements a fluent interface.
- writeln() : mixed
- Write a line to the output (if available). Implements a fluent interface.
- copyDir() : bool
- Copy the contents of $src into $dest if no matching files already exist.
- deleteDir() : bool
- Recursively delete a directory and its contents.
- setLastError() : bool
- Set last error message and return a boolean false.
Properties
$info
Theme info object
protected
ThemeInfo
$info
$lastError
Last error message
protected
string
$lastError
= null
$outputInterface
Output interface.
protected
OutputInterface
$outputInterface
= null
$pathResolver
Config file path resolver
protected
PathResolver
$pathResolver
Methods
__construct()
Constructor
public
__construct(ThemeInfo $info[, PathResolver $pathResolver = null ]) : mixed
Parameters
- $info : ThemeInfo
-
Theme info object
- $pathResolver : PathResolver = null
-
Config file path resolver
Return values
mixed —configure()
Configure the specified theme as VuFind's new default theme (and one of the alternatives).
public
configure(Config $config, string $name) : bool
Parameters
- $config : Config
-
Existing VuFind configuration
- $name : string
-
Theme name to add to configuration.
Return values
bool —generate()
Generate a new theme from a template.
public
generate(string $name[, string $themeTemplate = 'local_theme_example' ]) : bool
Parameters
- $name : string
-
Name of theme to generate.
- $themeTemplate : string = 'local_theme_example'
-
Name of template theme
Return values
bool —getLastError()
Get last error message.
public
getLastError() : string
Return values
string —setOutputInterface()
Set the output interface. Implements a fluent interface.
public
setOutputInterface(OutputInterface $output) : mixed
Parameters
- $output : OutputInterface
-
Output interface
Return values
mixed —writeln()
Write a line to the output (if available). Implements a fluent interface.
public
writeln(string $output) : mixed
Parameters
- $output : string
-
Line to output.
Return values
mixed —copyDir()
Copy the contents of $src into $dest if no matching files already exist.
protected
copyDir(string $src, string $dest) : bool
Parameters
- $src : string
-
Source directory
- $dest : string
-
Target directory
Return values
bool —deleteDir()
Recursively delete a directory and its contents.
protected
deleteDir(string $path) : bool
Parameters
- $path : string
-
Directory to delete.
Return values
bool —setLastError()
Set last error message and return a boolean false.
protected
setLastError(string $error) : bool
Parameters
- $error : string
-
Error message.