Composer.Autoload.ClassLoader - JoomlaPubDB/PubDB GitHub Wiki
Namespace: \Composer\Autoload
Summary:
ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
Description:
$loader = new \Composer\Autoload\ClassLoader();
// register classes with namespaces
$loader->add('Symfony\Component', __DIR__.'/component');
$loader->add('Symfony', __DIR__.'/framework');
// activate the autoloader
$loader->register();
// to enable searching the include path (eg. for PEAR packages)
$loader->setUseIncludePath(true);
In this example, if you try to use a class in the Symfony\Component namespace or one of its children (Symfony\Component\Console for instance), the autoloader will first look for the class under the component/ directory, and it will then fallback to the framework/ directory if not found before giving up.
This class is loosely based on the Symfony UniversalClassLoader.
- No constants found
- private $prefixLengthsPsr4
- private $prefixDirsPsr4
- private $fallbackDirsPsr4
- private $prefixesPsr0
- private $fallbackDirsPsr0
- private $useIncludePath
- private $classMap
- private $classMapAuthoritative
- private $missingClasses
- private $apcuPrefix
- public getPrefixes()
- public getPrefixesPsr4()
- public getFallbackDirs()
- public getFallbackDirsPsr4()
- public getClassMap()
- public addClassMap()
- public add()
- public addPsr4()
- public set()
- public setPsr4()
- public setUseIncludePath()
- public getUseIncludePath()
- public setClassMapAuthoritative()
- public isClassMapAuthoritative()
- public setApcuPrefix()
- public getApcuPrefix()
- public register()
- public unregister()
- public loadClass()
- public findFile()
- private findFileWithExtension()
- File: administrator/helpers/vendor/composer/ClassLoader.php
- Package: Default
- Class Hierarchy:
- \Composer\Autoload\ClassLoader
- See Also:
Tag | Version | Description |
---|---|---|
author | Fabien Potencier [email protected] | |
author | Jordi Boggiano [email protected] |
Type:
Details:
Type:
Details:
Type:
Details:
Type:
Details:
Type:
Details:
Type:
Details:
Type:
Details:
Type:
Details:
Type:
Details:
Type:
Details:
public getPrefixes()
Details:
- Inherited From: \Composer\Autoload\ClassLoader
public getPrefixesPsr4()
Details:
- Inherited From: \Composer\Autoload\ClassLoader
public getFallbackDirs()
Details:
- Inherited From: \Composer\Autoload\ClassLoader
public getFallbackDirsPsr4()
Details:
- Inherited From: \Composer\Autoload\ClassLoader
public getClassMap()
Details:
- Inherited From: \Composer\Autoload\ClassLoader
public addClassMap(array $classMap)
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
array |
$classMap | Class to filename map |
public add(string $prefix, array|string $paths, boolean $prepend = false)
Summary
Registers a set of PSR-0 directories for a given prefix, either appending or prepending to the ones previously set for this prefix.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
string |
$prefix | The prefix |
array|string |
$paths | The PSR-0 root directories |
boolean |
$prepend | Whether to prepend the directories |
public addPsr4(string $prefix, array|string $paths, boolean $prepend = false)
Summary
Registers a set of PSR-4 directories for a given namespace, either appending or prepending to the ones previously set for this namespace.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
string |
$prefix | The prefix/namespace, with trailing '\' |
array|string |
$paths | The PSR-4 base directories |
boolean |
$prepend | Whether to prepend the directories |
Type | Description |
---|---|
\InvalidArgumentException |
public set(string $prefix, array|string $paths)
Summary
Registers a set of PSR-0 directories for a given prefix, replacing any others previously set for this prefix.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
string |
$prefix | The prefix |
array|string |
$paths | The PSR-0 base directories |
public setPsr4(string $prefix, array|string $paths)
Summary
Registers a set of PSR-4 directories for a given namespace, replacing any others previously set for this namespace.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
string |
$prefix | The prefix/namespace, with trailing '\' |
array|string |
$paths | The PSR-4 base directories |
Type | Description |
---|---|
\InvalidArgumentException |
public setUseIncludePath(boolean $useIncludePath)
Summary
Turns on searching the include path for class files.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
boolean |
$useIncludePath |
public getUseIncludePath() : boolean
Summary
Can be used to check if the autoloader uses the include path to check for classes.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Returns: boolean
public setClassMapAuthoritative(boolean $classMapAuthoritative)
Summary
Turns off searching the prefix and fallback directories for classes that have not been registered with the class map.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
boolean |
$classMapAuthoritative |
public isClassMapAuthoritative() : boolean
Summary
Should class lookup fail if not found in the current class map?
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Returns: boolean
public setApcuPrefix(string|null $apcuPrefix)
Summary
APCu prefix to use to cache found/not-found classes, if the extension is enabled.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
string|null |
$apcuPrefix |
public getApcuPrefix() : string|null
Summary
The APCu prefix in use, or null if APCu caching is not enabled.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Returns: string|null
public register(boolean $prepend = false)
Summary
Registers this instance as an autoloader.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
boolean |
$prepend | Whether to prepend the autoloader or not |
public unregister()
Summary
Unregisters this instance as an autoloader.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
public loadClass(string $class) : boolean|null
Summary
Loads the given class or interface.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
string |
$class | The name of the class |
Returns: boolean|null - True if loaded, null otherwise
public findFile(string $class) : string|false
Summary
Finds the path to the file where the class is defined.
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
string |
$class | The name of the class |
Returns: string|false - The path if found, false otherwise
private findFileWithExtension( $class, $ext)
Details:
- Inherited From: \Composer\Autoload\ClassLoader
Type | Name | Description |
---|---|---|
|
$class | |
|
$ext |
This document was automatically generated from source code comments on 2020-07-13 using phpDocumentor and fr3nch13/phpdoc-markdown