MIOLO20
|
Membros públicos | |
__construct ($ns=null, $includePath=null) | |
setNamespaceSeparator ($sep) | |
getNamespaceSeparator () | |
setIncludePath ($includePath) | |
getIncludePath () | |
setFileExtension ($fileExtension) | |
getFileExtension () | |
register () | |
unregister () | |
loadClass ($className) | |
canLoadClass ($className) | |
Membros públicos estáticos | |
static | classExists ($className) |
static | getClassLoader ($className) |
A ClassLoader
is an autoloader for class files that can be installed on the SPL autoload stack. It is a class loader that either loads only classes of a specific namespace or all namespaces and it is suitable for working together with other autoloaders in the SPL autoload stack.
If no include path is configured through the constructor or setIncludePath
, a ClassLoader relies on the PHP include_path
.
Definido na linha 34 do ficheiro ClassLoader.php.
__construct | ( | $ns = null, | |
$includePath = null ) |
Creates a new ClassLoader
that loads classes of the specified namespace from the specified include path.
If no include path is given, the ClassLoader relies on the PHP include_path. If neither a namespace nor an include path is given, the ClassLoader will be responsible for loading all classes, thereby relying on the PHP include_path.
string | $ns | The namespace of the classes to load. |
string | $includePath | The base include path to use. |
Definido na linha 52 do ficheiro ClassLoader.php.
canLoadClass | ( | $className | ) |
Asks this ClassLoader whether it can potentially load the class (file) with the given name.
string | $className | The fully-qualified name of the class. |
Definido na linha 160 do ficheiro ClassLoader.php.
|
static |
Checks whether a class with a given name exists. A class "exists" if it is either already defined in the current request or if there is an autoloader on the SPL autoload stack that is a) responsible for the class in question and b) is able to load a class file in which the class definition resides.
If the class is not already defined, each autoloader in the SPL autoload stack is asked whether it is able to tell if the class exists. If the autoloader is a ClassLoader
, canLoadClass
is used, otherwise the autoload function of the autoloader is invoked and expected to return a value that evaluates to TRUE if the class (file) exists. As soon as one autoloader reports that the class exists, TRUE is returned.
Note that, depending on what kinds of autoloaders are installed on the SPL autoload stack, the class (file) might already be loaded as a result of checking for its existence. This is not the case with a ClassLoader
, who separates these responsibilities.
string | $className | The fully-qualified name of the class. |
Definido na linha 191 do ficheiro ClassLoader.php.
|
static |
Gets the ClassLoader
from the SPL autoload stack that is responsible for (and is able to load) the class with the given name.
string | $className | The name of the class. |
ClassLoader
for the class or NULL if no such ClassLoader
exists. Definido na linha 229 do ficheiro ClassLoader.php.
getFileExtension | ( | ) |
Gets the file extension of class files in the namespace of this ClassLoader.
Definido na linha 113 do ficheiro ClassLoader.php.
getIncludePath | ( | ) |
Gets the base include path for all class files in the namespace of this ClassLoader.
Definido na linha 93 do ficheiro ClassLoader.php.
getNamespaceSeparator | ( | ) |
Gets the namespace separator used by classes in the namespace of this ClassLoader.
Definido na linha 73 do ficheiro ClassLoader.php.
loadClass | ( | $className | ) |
Loads the given class or interface.
string | $classname | The name of the class to load. |
Definido na linha 140 do ficheiro ClassLoader.php.
register | ( | ) |
Registers this ClassLoader on the SPL autoload stack.
Definido na linha 121 do ficheiro ClassLoader.php.
setFileExtension | ( | $fileExtension | ) |
Sets the file extension of class files in the namespace of this ClassLoader.
string | $fileExtension |
Definido na linha 103 do ficheiro ClassLoader.php.
setIncludePath | ( | $includePath | ) |
Sets the base include path for all class files in the namespace of this ClassLoader.
string | $includePath |
Definido na linha 83 do ficheiro ClassLoader.php.
setNamespaceSeparator | ( | $sep | ) |
Sets the namespace separator used by classes in the namespace of this ClassLoader.
string | $sep | The separator to use. |
Definido na linha 63 do ficheiro ClassLoader.php.
unregister | ( | ) |
Removes this ClassLoader from the SPL autoload stack.
Definido na linha 129 do ficheiro ClassLoader.php.