Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($vendorDir=null) | |
getPrefixes () | |
getPrefixesPsr4 () | |
getFallbackDirs () | |
getFallbackDirsPsr4 () | |
getClassMap () | |
addClassMap (array $classMap) | |
add ($prefix, $paths, $prepend=false) | |
addPsr4 ($prefix, $paths, $prepend=false) | |
set ($prefix, $paths) | |
setPsr4 ($prefix, $paths) | |
setUseIncludePath ($useIncludePath) | |
getUseIncludePath () | |
setClassMapAuthoritative ($classMapAuthoritative) | |
isClassMapAuthoritative () | |
setApcuPrefix ($apcuPrefix) | |
getApcuPrefix () | |
register ($prepend=false) | |
unregister () | |
loadClass ($class) | |
findFile ($class) | |
Fonctions membres publiques statiques | |
static | getRegisteredLoaders () |
Fonctions membres privées | |
findFileWithExtension ($class, $ext) | |
Attributs privés | |
$vendorDir | |
$prefixLengthsPsr4 = array() | |
$prefixDirsPsr4 = array() | |
$fallbackDirsPsr4 = array() | |
$prefixesPsr0 = array() | |
$fallbackDirsPsr0 = array() | |
$useIncludePath = false | |
$classMap = array() | |
$classMapAuthoritative = false | |
$missingClasses = array() | |
$apcuPrefix | |
Attributs privés statiques | |
static | $registeredLoaders = array() |
ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
$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 namespace or one of its children (Symfony 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.
__construct | ( | $vendorDir = null | ) |
?string | $vendorDir |
Références ClassLoader\$vendorDir.
add | ( | $prefix, | |
$paths, | |||
$prepend = false |
|||
) |
Registers a set of PSR-0 directories for a given prefix, either appending or prepending to the ones previously set for this prefix.
string | $prefix | The prefix |
string[]|string | $paths The PSR-0 root directories | |
bool | $prepend | Whether to prepend the directories |
Références $prefix.
addClassMap | ( | array | $classMap | ) |
string[] | $classMap Class to filename map -param array<string, string> $classMap |
Références ClassLoader\$classMap.
addPsr4 | ( | $prefix, | |
$paths, | |||
$prepend = false |
|||
) |
Registers a set of PSR-4 directories for a given namespace, either appending or prepending to the ones previously set for this namespace.
string | $prefix | The prefix/namespace, with trailing '\' |
string[]|string | $paths The PSR-4 base directories | |
bool | $prepend | Whether to prepend the directories |
findFile | ( | $class | ) |
Finds the path to the file where the class is defined.
string | $class | The name of the class |
Références $class, ClassLoader\findFileWithExtension(), et null.
Référencé par ClassLoader\loadClass().
|
private |
string | $class | |
string | $ext |
Références $class, $dir, et $prefix.
Référencé par ClassLoader\findFile().
getApcuPrefix | ( | ) |
The APCu prefix in use, or null if APCu caching is not enabled.
Références ClassLoader\$apcuPrefix.
getClassMap | ( | ) |
Références ClassLoader\$classMap.
getFallbackDirs | ( | ) |
Références ClassLoader\$fallbackDirsPsr0.
getFallbackDirsPsr4 | ( | ) |
Références ClassLoader\$fallbackDirsPsr4.
getPrefixes | ( | ) |
getPrefixesPsr4 | ( | ) |
Références ClassLoader\$prefixDirsPsr4.
|
static |
Returns the currently registered loaders indexed by their corresponding vendor directories.
getUseIncludePath | ( | ) |
Can be used to check if the autoloader uses the include path to check for classes.
Références ClassLoader\$useIncludePath.
isClassMapAuthoritative | ( | ) |
Should class lookup fail if not found in the current class map?
Références ClassLoader\$classMapAuthoritative.
loadClass | ( | $class | ) |
Loads the given class or interface.
string | $class | The name of the class |
Références $class, ClassLoader\findFile(), Composer\Autoload\includeFile(), et null.
Référencé par Autoloader\createPrependAutoloader().
register | ( | $prepend = false | ) |
Registers this instance as an autoloader.
bool | $prepend | Whether to prepend the autoloader or not |
Références $this, ClassLoader\$vendorDir, et null.
set | ( | $prefix, | |
$paths | |||
) |
Registers a set of PSR-0 directories for a given prefix, replacing any others previously set for this prefix.
string | $prefix | The prefix |
string[]|string | $paths The PSR-0 base directories |
Références $prefix.
setApcuPrefix | ( | $apcuPrefix | ) |
APCu prefix to use to cache found/not-found classes, if the extension is enabled.
string | null | $apcuPrefix |
Références ClassLoader\$apcuPrefix, et null.
setClassMapAuthoritative | ( | $classMapAuthoritative | ) |
Turns off searching the prefix and fallback directories for classes that have not been registered with the class map.
bool | $classMapAuthoritative |
Références ClassLoader\$classMapAuthoritative.
setPsr4 | ( | $prefix, | |
$paths | |||
) |
Registers a set of PSR-4 directories for a given namespace, replacing any others previously set for this namespace.
string | $prefix | The prefix/namespace, with trailing '\' |
string[]|string | $paths The PSR-4 base directories |
Références $prefix.
setUseIncludePath | ( | $useIncludePath | ) |
Turns on searching the include path for class files.
bool | $useIncludePath |
Références ClassLoader\$useIncludePath.
|
private |
Référencé par ClassLoader\getApcuPrefix(), et ClassLoader\setApcuPrefix().
|
private |
Référencé par ClassLoader\addClassMap(), et ClassLoader\getClassMap().
|
private |
Référencé par ClassLoader\isClassMapAuthoritative(), et ClassLoader\setClassMapAuthoritative().
|
private |
Référencé par ClassLoader\getFallbackDirs().
|
private |
Référencé par ClassLoader\getFallbackDirsPsr4().
|
private |
|
private |
Référencé par ClassLoader\getPrefixesPsr4().
|
private |
|
private |
|
staticprivate |
|
private |
Référencé par ClassLoader\getUseIncludePath(), et ClassLoader\setUseIncludePath().
|
private |
Référencé par ClassLoader\__construct(), et ClassLoader\register().