ThemeCompiler
extends AbstractThemeUtility
in package
Class to compile a theme hierarchy into a single flat theme.
Tags
Table of Contents
- $info : ThemeInfo
- Theme info object
- $lastError : string
- Last error message
- __construct() : mixed
- Constructor
- compile() : bool
- Compile from $source theme into $target theme.
- getLastError() : string
- Get last error message.
- removeTheme() : bool
- Remove a theme directory (used for cleanup in testing).
- copyDir() : bool
- Copy the contents of $src into $dest if no matching files already exist.
- deleteDir() : bool
- Recursively delete a directory and its contents.
- mergeConfig() : array<string|int, mixed>
- Merge configurations from $src into $dest; return the result.
- 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
Methods
__construct()
Constructor
public
__construct(ThemeInfo $info) : mixed
Parameters
- $info : ThemeInfo
-
Theme info object
Return values
mixed —compile()
Compile from $source theme into $target theme.
public
compile(string $source, string $target[, bool $forceOverwrite = false ]) : bool
Parameters
- $source : string
-
Name of source theme
- $target : string
-
Name of target theme
- $forceOverwrite : bool = false
-
Should we overwrite the target if it exists?
Return values
bool —getLastError()
Get last error message.
public
getLastError() : string
Return values
string —removeTheme()
Remove a theme directory (used for cleanup in testing).
public
removeTheme(string $theme) : bool
Parameters
- $theme : string
-
Name of theme to remove.
Return values
bool —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 —mergeConfig()
Merge configurations from $src into $dest; return the result.
protected
mergeConfig(array<string|int, mixed> $src, array<string|int, mixed> $dest) : array<string|int, mixed>
Parameters
- $src : array<string|int, mixed>
-
Source configuration
- $dest : array<string|int, mixed>
-
Destination configuration
Return values
array<string|int, mixed> —setLastError()
Set last error message and return a boolean false.
protected
setLastError(string $error) : bool
Parameters
- $error : string
-
Error message.