1127. Class

1127.1. Zend\Loader\StandardAutoloader

PSR-0 compliant autoloader

Allows autoloading both namespaced and vendor-prefixed classes. Class lookups are performed on the filesystem. If a class file for the referenced class is not found, a PHP warning will be raised by include().

1127.1.1. Methods

1127.1.1.1. __construct

__construct()

Constructor

Parameters:null|array|Traversable

1127.1.1.2. setOptions

setOptions()

Configure autoloader

Allows specifying both “namespace” and “prefix” pairs, using the following structure: <code> array(

‘namespaces’ => array(
‘Zend’ => ‘/path/to/Zend/library’, ‘Doctrine’ => ‘/path/to/Doctrine/library’,

), ‘prefixes’ => array(

Phly_‘ => ‘/path/to/Phly/library’,

), ‘fallback_autoloader’ => true,

) </code>

Parameters:array|Traversable
Throws ExceptionInvalidArgumentException:
 
Return type:StandardAutoloader

1127.1.1.3. setFallbackAutoloader

setFallbackAutoloader()

Set flag indicating fallback autoloader status

Parameters:bool
Return type:StandardAutoloader

1127.1.1.4. isFallbackAutoloader

isFallbackAutoloader()

Is this autoloader acting as a fallback autoloader?

Return type:bool

1127.1.1.5. registerNamespace

registerNamespace()

Register a namespace/directory pair

Parameters:
  • string
  • string
Return type:

StandardAutoloader

1127.1.1.6. registerNamespaces

registerNamespaces()

Register many namespace/directory pairs at once

Parameters:array
Throws ExceptionInvalidArgumentException:
 
Return type:StandardAutoloader

1127.1.1.7. registerPrefix

registerPrefix()

Register a prefix/directory pair

Parameters:
  • string
  • string
Return type:

StandardAutoloader

1127.1.1.8. registerPrefixes

registerPrefixes()

Register many namespace/directory pairs at once

Parameters:array
Throws ExceptionInvalidArgumentException:
 
Return type:StandardAutoloader

1127.1.1.9. autoload

autoload()

Defined by Autoloadable; autoload a class

Parameters:string
Return type:false|string

1127.1.1.10. register

register()

Register the autoloader with spl_autoload

Return type:void

1127.1.1.11. transformClassNameToFilename

transformClassNameToFilename()

Transform the class name to a filename

Parameters:
  • string
  • string
Return type:

string

1127.1.1.12. loadClass

loadClass()

Load a class, based on its type (namespaced or prefixed)

Parameters:
  • string
  • string
Return type:

bool|string

Throws :

ExceptionInvalidArgumentException

1127.1.1.13. normalizeDirectory

normalizeDirectory()

Normalize the directory to include a trailing directory separator

Parameters:string
Return type:string

1127.1.2. Constants

1127.1.2.1. NS_SEPARATOR

1127.1.2.2. PREFIX_SEPARATOR

1127.1.2.3. LOAD_NS

1127.1.2.4. LOAD_PREFIX

1127.1.2.5. ACT_AS_FALLBACK

1127.1.2.6. AUTOREGISTER_ZF