PHP Class PPI\Framework\Autoload

It is able to load classes that use either: * The technical interoperability standards for PHP 5.3 namespaces and class names (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md); Example usage: PPI\Framework\Autoload::add('Symfony', PPI_VENDOR_PATH . '/path/to/src/Symfony') PPI\Framework\Autoload::register();
Show file Open project: ppi/framework Class Usage Examples

Public Properties

Property Type Description
$_options array

Protected Properties

Property Type Description
$_loader null | object The ClassLoader object.
$_registeredNamespaces array

Public Methods

Method Description
add ( string $key, string $path ) Add a namespace to the autoloader path.
config ( array $config ) Add some items to the class config.
exists ( string $key ) : boolean Check if a namespace has been registered. This is a workaround as the default self::$_options['loader'] class does not have an exists() method.
register ( ) Register the autoloader namespaces or prefixes thus far.

Method Details

add() public static method

Add a namespace to the autoloader path.
public static add ( string $key, string $path )
$key string
$path string

config() public static method

Add some items to the class config.
public static config ( array $config )
$config array

exists() public static method

Check if a namespace has been registered. This is a workaround as the default self::$_options['loader'] class does not have an exists() method.
public static exists ( string $key ) : boolean
$key string
return boolean

register() public static method

Register the autoloader namespaces or prefixes thus far.
public static register ( )

Property Details

$_loader protected static property

The ClassLoader object.
protected static null|object $_loader
return null | object

$_options public static property

public static array $_options
return array

$_registeredNamespaces protected static property

protected static array $_registeredNamespaces
return array