PHP Class BaseClassLoader, ClearSky

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Inheritance: extends Threaded, implements ClassLoader
ファイルを表示 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

Protected Methods

Method Description
getAndRemoveLookupEntries ( )

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

getAndRemoveLookupEntries() protected method

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