|
eZ Publish
[4.0]
|
Public Member Functions | |
| __construct ($basePath, $searchKernelFiles, $searchExtensionFiles, $verboseOutput=false, $writeFiles=true, $outputDir=false, $excludeDirs=false) | |
| Constructs class to generate autoload arrays. | |
| buildAutoloadArrays () | |
| Searches specified directories for classes, and build autoload arrays. | |
Public Attributes | |
| const | GENAUTOLOADS_BOTH = 3 |
| Bitmask for searching in both kernel and extension files. | |
| const | GENAUTOLOADS_EXTENSION = 2 |
| Bitmask for search in extension files. | |
| const | GENAUTOLOADS_KERNEL = 1 |
| Bitmask for searhing in kernel files. | |
| const | GENAUTOLOADS_NONE = 0 |
| Bitmask for searching in no files. | |
Private Member Functions | |
| buildFileList ($path, $extraFilter=null) | |
| Builds a filelist of all PHP files in $path. | |
| checkMaxClassLength ($depData) | |
| Calculates the length of the longest class name present in $depdata. | |
| checkMode ($mask) | |
| Checks which runmode the script should operate in: kernel-mode, extension-mode or both. | |
| dumpArray ($sortedArray, $length) | |
| Build string version of the autoload array with correct indenting. | |
| dumpArrayEnd () | |
| Prints generated code for end of the autoload files. | |
| fetchFiles ($path, $mask, $excludeDirs=false) | |
| Returns an array indexed by location for classes and their filenames. | |
| getClassFileList ($fileList) | |
| Extracts class information from PHP sourcecode. | |
| nameTable ($lookup) | |
| Table to look up file names to use for different run modes. | |
| runMode ($useKernelFiles, $useExtensionFiles) | |
| Generates the active bitmask for this instance of the autoload generation script depending on the parameters it sets the corresponding flags. | |
Private Attributes | |
| $basePath | |
| $excludeDirs | |
| $outputDir | |
| $searchExtensionFiles | |
| $searchKernelFiles | |
| $verboseOutput | |
| $writeFiles | |
Definition at line 18 of file ezautoloadgenerator.php.
| eZAutoloadGenerator::__construct | ( | $ | basePath, |
| $ | searchKernelFiles, | ||
| $ | searchExtensionFiles, | ||
| $ | verboseOutput = false, |
||
| $ | writeFiles = true, |
||
| $ | outputDir = false, |
||
| $ | excludeDirs = false |
||
| ) |
Constructs class to generate autoload arrays.
File search is rooted in $basePath, and the parameters $searchKernelFiles and $searchExtensionFiles control which part of the installation is searched for classes.
$verboseOutput controls whether autoload arrays will be printed on STDOUT.
$writeFiles controls whether the the resulting autoload arrays are written to disc.
$outputDir is the directory into which the autoload arrays should be written, defaults to 'autoload'
$excludeDirs are the arrays which should not be included in the search for PHP classes.
| string | $basePath | |
| bool | $searchKernelFiles | |
| bool | $searchExtensionFiles | |
| bool | $verboseOutput | |
| bool | $writeFiles | |
| string | $outputDir | |
| array | $excludeDirs |
Definition at line 117 of file ezautoloadgenerator.php.
| eZAutoloadGenerator::buildAutoloadArrays | ( | ) |
Searches specified directories for classes, and build autoload arrays.
| Exception | if desired output directory is not a directory, or if the autoload arrays are not writeable by the script. |
Definition at line 144 of file ezautoloadgenerator.php.
| eZAutoloadGenerator::buildFileList | ( | $ | path, |
| $ | extraFilter = null |
||
| ) | [private] |
Builds a filelist of all PHP files in $path.
| string | $path | |
| array | $extraFilter |
Definition at line 270 of file ezautoloadgenerator.php.
Referenced by fetchFiles().
| eZAutoloadGenerator::checkMaxClassLength | ( | $ | depData | ) | [private] |
Calculates the length of the longest class name present in $depdata.
| array | $depData |
Definition at line 330 of file ezautoloadgenerator.php.
Referenced by buildAutoloadArrays().
| eZAutoloadGenerator::checkMode | ( | $ | mask | ) | [private] |
Checks which runmode the script should operate in: kernel-mode, extension-mode or both.
| int | $mask | Bitmask to check for run mode. |
Definition at line 380 of file ezautoloadgenerator.php.
Referenced by fetchFiles().
| eZAutoloadGenerator::dumpArray | ( | $ | sortedArray, |
| $ | length | ||
| ) | [private] |
Build string version of the autoload array with correct indenting.
| array | $sortedArray | |
| int | $length |
Definition at line 358 of file ezautoloadgenerator.php.
Referenced by buildAutoloadArrays().
| eZAutoloadGenerator::dumpArrayEnd | ( | ) | [private] |
Prints generated code for end of the autoload files.
Definition at line 470 of file ezautoloadgenerator.php.
Referenced by buildAutoloadArrays().
| eZAutoloadGenerator::fetchFiles | ( | $ | path, |
| $ | mask, | ||
| $ | excludeDirs = false |
||
| ) | [private] |
Returns an array indexed by location for classes and their filenames.
| string | $path | The base path to start the search from. |
| string | $mask | A binary mask which instructs the function whether to fetch kernel-related or extension-related files. |
Definition at line 202 of file ezautoloadgenerator.php.
Referenced by buildAutoloadArrays().
| eZAutoloadGenerator::getClassFileList | ( | $ | fileList | ) | [private] |
Extracts class information from PHP sourcecode.
Definition at line 292 of file ezautoloadgenerator.php.
Referenced by buildAutoloadArrays().
| eZAutoloadGenerator::nameTable | ( | $ | lookup | ) | [private] |
Table to look up file names to use for different run modes.
| string | $lookup | Mode to look up, can be extension, or kernel. |
Definition at line 428 of file ezautoloadgenerator.php.
Referenced by buildAutoloadArrays().
| eZAutoloadGenerator::runMode | ( | $ | useKernelFiles, |
| $ | useExtensionFiles | ||
| ) | [private] |
Generates the active bitmask for this instance of the autoload generation script depending on the parameters it sets the corresponding flags.
| bool | $useKernelFiles | Whether kernel files should be checked |
| bool | $useExtensionFiles | Whether extension files should be checked |
Definition at line 401 of file ezautoloadgenerator.php.
Referenced by buildAutoloadArrays().
eZAutoloadGenerator::$basePath [private] |
Definition at line 26 of file ezautoloadgenerator.php.
Referenced by __construct().
eZAutoloadGenerator::$excludeDirs [private] |
Definition at line 68 of file ezautoloadgenerator.php.
Referenced by __construct(), and fetchFiles().
eZAutoloadGenerator::$outputDir [private] |
Definition at line 61 of file ezautoloadgenerator.php.
Referenced by __construct().
eZAutoloadGenerator::$searchExtensionFiles [private] |
Definition at line 40 of file ezautoloadgenerator.php.
Referenced by __construct().
eZAutoloadGenerator::$searchKernelFiles [private] |
Definition at line 33 of file ezautoloadgenerator.php.
Referenced by __construct().
eZAutoloadGenerator::$verboseOutput [private] |
Definition at line 47 of file ezautoloadgenerator.php.
Referenced by __construct().
eZAutoloadGenerator::$writeFiles [private] |
Definition at line 54 of file ezautoloadgenerator.php.
Referenced by __construct().
| const eZAutoloadGenerator::GENAUTOLOADS_BOTH = 3 |
Bitmask for searching in both kernel and extension files.
Definition at line 88 of file ezautoloadgenerator.php.
Bitmask for search in extension files.
Definition at line 83 of file ezautoloadgenerator.php.
Referenced by runMode().
| const eZAutoloadGenerator::GENAUTOLOADS_KERNEL = 1 |
Bitmask for searhing in kernel files.
Definition at line 78 of file ezautoloadgenerator.php.
Referenced by runMode().
| const eZAutoloadGenerator::GENAUTOLOADS_NONE = 0 |
Bitmask for searching in no files.
Definition at line 73 of file ezautoloadgenerator.php.
Referenced by runMode().