PHP Class ClassLoader, ClearSky

Author: aipa
Show file Open project: robske110/ClearSky Class Usage Examples

Public Methods

Method Description
__construct ( ClassLoader $parent = null )
addPath ( string $path, boolean $prepend = false ) Adds a path to the lookup list
findClass ( string $name ) : string | null Returns the path for the class, if any
getClasses ( ) : string[] Returns an array of the classes loaded
getParent ( ) : ClassLoader Returns the parent ClassLoader, if any
loadClass ( string $name ) : boolean Called when there is a class to load
register ( boolean $prepend = false ) : boolean Attaches the ClassLoader to the PHP runtime
removePath ( $path ) Removes a path from the lookup list

Method Details

__construct() public method

public __construct ( ClassLoader $parent = null )
$parent ClassLoader

addPath() public method

Adds a path to the lookup list
public addPath ( string $path, boolean $prepend = false )
$path string
$prepend boolean

findClass() public method

Returns the path for the class, if any
public findClass ( string $name ) : string | null
$name string
return string | null

getClasses() public method

Returns an array of the classes loaded
public getClasses ( ) : string[]
return string[]

getParent() public method

Returns the parent ClassLoader, if any
public getParent ( ) : ClassLoader
return ClassLoader

loadClass() public method

Called when there is a class to load
public loadClass ( string $name ) : boolean
$name string
return boolean

register() public method

Attaches the ClassLoader to the PHP runtime
public register ( boolean $prepend = false ) : boolean
$prepend boolean
return boolean

removePath() public method

Removes a path from the lookup list
public removePath ( $path )
$path