PHP Class sfAutoload

This class is a singleton as PHP seems to be unable to register 2 autoloaders that are instances of the same class (why?).
Author: Fabien Potencier ([email protected])
Show file Open project: lexpress/symfony1 Class Usage Examples

Protected Properties

Property Type Description
$classes
$freshCache
$instance
$overriden

Public Methods

Method Description
autoload ( string $class ) : boolean Handles autoloading of classes that have been specified in autoload.yml.
getClassPath ( string $class ) : string | null Returns the path where a particular class can be found.
getInstance ( ) : sfCoreAutoload Retrieves the singleton instance of this class.
loadClass ( string $class ) : boolean Tries to load a class that has been specified in autoload.yml.
register ( ) : void Register sfAutoload in spl autoloader.
reloadClasses ( boolean $force = false ) : boolean Reloads the autoloader.
setClassPath ( string $class, string $path ) Sets the path for a particular class.
unregister ( ) : void Unregister sfAutoload from spl autoloader.

Protected Methods

Method Description
__construct ( )

Method Details

__construct() protected method

protected __construct ( )

autoload() public method

Handles autoloading of classes that have been specified in autoload.yml.
public autoload ( string $class ) : boolean
$class string A class name.
return boolean Returns true if the class has been loaded

getClassPath() public method

Returns the path where a particular class can be found.
public getClassPath ( string $class ) : string | null
$class string A PHP class name
return string | null An absolute path

getInstance() public static method

Retrieves the singleton instance of this class.
public static getInstance ( ) : sfCoreAutoload
return sfCoreAutoload A sfCoreAutoload implementation instance.

loadClass() public method

Tries to load a class that has been specified in autoload.yml.
public loadClass ( string $class ) : boolean
$class string A class name.
return boolean Returns true if the class has been loaded

register() public static method

Register sfAutoload in spl autoloader.
public static register ( ) : void
return void

reloadClasses() public method

Reloads the autoloader.
public reloadClasses ( boolean $force = false ) : boolean
$force boolean Whether to force a reload
return boolean True if the reload was successful, otherwise false

setClassPath() public method

Sets the path for a particular class.
public setClassPath ( string $class, string $path )
$class string A PHP class name
$path string An absolute path

unregister() public static method

Unregister sfAutoload from spl autoloader.
public static unregister ( ) : void
return void

Property Details

$classes protected property

protected $classes

$freshCache protected static property

protected static $freshCache

$instance protected static property

protected static $instance

$overriden protected property

protected $overriden