eZ Publish  [4.0]
eZAutoloadGenerator Class Reference

List of all members.

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

Detailed Description

Definition at line 18 of file ezautoloadgenerator.php.


Constructor & Destructor Documentation

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.

Parameters:
string$basePath
bool$searchKernelFiles
bool$searchExtensionFiles
bool$verboseOutput
bool$writeFiles
string$outputDir
array$excludeDirs

Definition at line 117 of file ezautoloadgenerator.php.


Member Function Documentation

eZAutoloadGenerator::buildAutoloadArrays ( )

Searches specified directories for classes, and build autoload arrays.

Exceptions:
Exceptionif desired output directory is not a directory, or if the autoload arrays are not writeable by the script.
Returns:
void

Definition at line 144 of file ezautoloadgenerator.php.

eZAutoloadGenerator::buildFileList ( path,
extraFilter = null 
) [private]

Builds a filelist of all PHP files in $path.

Parameters:
string$path
array$extraFilter
Returns:
array

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.

Parameters:
array$depData
Returns:
mixed

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.

Parameters:
int$maskBitmask to check for run mode.
Returns:
int

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.

Parameters:
array$sortedArray
int$length
Returns:
string

Definition at line 358 of file ezautoloadgenerator.php.

Referenced by buildAutoloadArrays().

eZAutoloadGenerator::dumpArrayEnd ( ) [private]

Prints generated code for end of the autoload files.

Returns:
void

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.

Parameters:
string$pathThe base path to start the search from.
string$maskA binary mask which instructs the function whether to fetch kernel-related or extension-related files.
Returns:
array

Definition at line 202 of file ezautoloadgenerator.php.

Referenced by buildAutoloadArrays().

eZAutoloadGenerator::getClassFileList ( fileList) [private]

Extracts class information from PHP sourcecode.

Returns:
array (className=>filename)

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.

Parameters:
string$lookupMode to look up, can be extension, or kernel.
Returns:
string

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.

Parameters:
bool$useKernelFilesWhether kernel files should be checked
bool$useExtensionFilesWhether extension files should be checked
Returns:
int

Definition at line 401 of file ezautoloadgenerator.php.

Referenced by buildAutoloadArrays().


Member Data Documentation

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().

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().

Bitmask for searhing in kernel files.

Definition at line 78 of file ezautoloadgenerator.php.

Referenced by runMode().

Bitmask for searching in no files.

Definition at line 73 of file ezautoloadgenerator.php.

Referenced by runMode().


The documentation for this class was generated from the following file: