메소드 | 설명 | |
---|---|---|
findClass ( string $class ) : string | boolean | Tries to get the path to the class based on registered maps. | |
getClass ( string $class ) : boolean | Tries to find the class file based on currently registered rules. | |
getClassFromCache ( string $class ) : boolean | First tries to find the class in the cache. If the class is not found in the cache, then it tries to find it by using the registered maps. | |
getInstance ( ) | Get an instance of ClassLoader. | |
registerCacheDriver ( |
Sets a cache layer in front of the autoloader. | |
registerMap ( array $maps ) | Register a namespace or PEAR map rule. | |
unregisterMap ( string $mapPrefix ) : boolean | Removes the given map prefix from class loader. |
메소드 | 설명 | |
---|---|---|
__construct ( ) | Base constructor. | |
registerAutoloader ( ) | Registers SPL autoload function. |
public getClassFromCache ( string $class ) : boolean | ||
$class | string | Name of the class you are trying to find. |
리턴 | boolean | True is retuned if the class if found and loaded into memory. |
public registerCacheDriver ( |
||
$cache | Instance of the \Webiny\Component\Cache\Cache class. |
public registerMap ( array $maps ) | ||
$maps | array | - Array of maps rules. An example rule is ['Webiny' => '/var/WebinyFramework/library'] |
public unregisterMap ( string $mapPrefix ) : boolean | ||
$mapPrefix | string | Map prefix that should be removed. |
리턴 | boolean | Returns true if the map prefix was found and removed, otherwise false. |