ClassLoader
public class ClassLoader
Constructor Summary | |
---|---|
ClassLoader(string ns, mixed includePath) Creates a new ClassLoader that loads classes of the specified namespace. |
Method Summary | |
---|---|
string | Gets the file extension of class files in the namespace of this class loader. |
string | Gets the base include path for all class files in the namespace of this class loader. |
string | Gets the namespace separator used by classes in the namespace of this class loader. |
boolean | loadClass(mixed className, string classname) Loads the given class or interface. |
void | register() Installs this class loader on the SPL autoload stack. |
void | setFileExtension(string fileExtension) Sets the file extension of class files in the namespace of this class loader. |
void | setIncludePath(string includePath) Sets the base include path for all class files in the namespace of this class loader. |
void | setNamespaceSeparator(string sep) Sets the namespace separator used by classes in the namespace of this class loader. |
void | Uninstalls this class loader on the SPL autoload stack. |
public ClassLoader(string ns, mixed includePath)
Creates a new ClassLoader that loads classes of the specified namespace.
public string getFileExtension()
Gets the file extension of class files in the namespace of this class loader.
public string getIncludePath()
Gets the base include path for all class files in the namespace of this class loader.
public string getNamespaceSeparator()
Gets the namespace separator used by classes in the namespace of this class loader.
public boolean loadClass(mixed className, string classname)
Loads the given class or interface.
public void register()
Installs this class loader on the SPL autoload stack.
public void setFileExtension(string fileExtension)
Sets the file extension of class files in the namespace of this class loader.
public void setIncludePath(string includePath)
Sets the base include path for all class files in the namespace of this class loader.
public void setNamespaceSeparator(string sep)
Sets the namespace separator used by classes in the namespace of this class loader.
public void unregister()
Uninstalls this class loader on the SPL autoload stack.
A ClassLoader is an autoloader for class files that can be installed on the SPL autoload stack. It is a class loader that loads only classes of a specific namespace or all namespaces and is suitable for working together with other autoloaders in the SPL autoload stack.
If no include path is configured through
setIncludePath
, a ClassLoader relies on the PHP include_path.