Doctrine


Doctrine\Common\ClassLoader
/Doctrine/Common/ClassLoader.php at line 36

Class ClassLoader

ClassLoader

public class ClassLoader

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.

Author:
Roman Borschel
Since:
2.0

Constructor Summary

ClassLoader(string ns, mixed includePath)

Creates a new ClassLoader that loads classes of the specified namespace.

Method Summary
string

getFileExtension()

Gets the file extension of class files in the namespace of this class loader.

string

getIncludePath()

Gets the base include path for all class files in the namespace of this class loader.

string

getNamespaceSeparator()

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

unregister()

Uninstalls this class loader on the SPL autoload stack.

Constructor Detail

/Doctrine/Common/ClassLoader.php at line 49

ClassLoader

public ClassLoader(string ns, mixed includePath)

Creates a new ClassLoader that loads classes of the specified namespace.

Parameters:
ns - The namespace to use.

Method Detail

/Doctrine/Common/ClassLoader.php at line 110

getFileExtension

public string getFileExtension()

Gets the file extension of class files in the namespace of this class loader.


/Doctrine/Common/ClassLoader.php at line 90

getIncludePath

public string getIncludePath()

Gets the base include path for all class files in the namespace of this class loader.


/Doctrine/Common/ClassLoader.php at line 70

getNamespaceSeparator

public string getNamespaceSeparator()

Gets the namespace separator used by classes in the namespace of this class loader.


/Doctrine/Common/ClassLoader.php at line 137

loadClass

public boolean loadClass(mixed className, string classname)

Loads the given class or interface.

Parameters:
classname - The name of the class to load.
Returns:
TRUE if the class has been successfully loaded, FALSE otherwise.

/Doctrine/Common/ClassLoader.php at line 118

register

public void register()

Installs this class loader on the SPL autoload stack.


/Doctrine/Common/ClassLoader.php at line 100

setFileExtension

public void setFileExtension(string fileExtension)

Sets the file extension of class files in the namespace of this class loader.


/Doctrine/Common/ClassLoader.php at line 80

setIncludePath

public void setIncludePath(string includePath)

Sets the base include path for all class files in the namespace of this class loader.


/Doctrine/Common/ClassLoader.php at line 60

setNamespaceSeparator

public void setNamespaceSeparator(string sep)

Sets the namespace separator used by classes in the namespace of this class loader.

Parameters:
sep - The separator to use.

/Doctrine/Common/ClassLoader.php at line 126

unregister

public void unregister()

Uninstalls this class loader on the SPL autoload stack.


Doctrine