\SplAutoloader

SplClassLoader implementation that implements the technical interoperability standards for PHP 5.3 namespaces and class names.

http://groups.google.com/group/php-standards/web/final-proposal

// Example which loads classes for the Doctrine Common package in the
// Doctrine\Common namespace.
$classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine');
$classLoader->register();

Synopsis

class SplAutoloader {
}

Members

private

  • $_fileExtension
  • $_includePath
  • $_namespace
  • $_namespaceSeparator

Methods

public

  • __construct() — Creates a new <tt>SplClassLoader</tt> that loads classes of the specified namespace.
  • getFileExtension() — Gets the file extension of class files in the namespace of this class loader.
  • getIncludePath() — Gets the base include path for all class files in the namespace of this class loader.
  • getNamespaceSeparator() — Gets the namespace seperator used by classes in the namespace of this class loader.
  • loadClass() — Loads the given class or interface.
  • register() — Installs this class loader on the SPL autoload stack.
  • setFileExtension() — Sets the file extension of class files in the namespace of this class loader.
  • setIncludePath() — Sets the base include path for all class files in the namespace of this class loader.
  • setNamespaceSeparator() — Sets the namespace separator used by classes in the namespace of this class loader.
  • unregister() — Uninstalls this class loader from the SPL autoloader stack.

History