1113. Class

1113.1. Zend\Loader\ModuleAutoloader

1113.1.1. Methods

1113.1.1.1. __construct

__construct()

Constructor

Allow configuration of the autoloader via the constructor.

Parameters:null|array|Traversable

1113.1.1.2. setOptions

setOptions()

Configure the autoloader

In most cases, $options should be either an associative array or Traversable object.

Parameters:array|Traversable
Return type:ModuleAutoloader

1113.1.1.3. getModuleClassMap

getModuleClassMap()

Retrieves the class map for all loaded modules.

Return type:array

1113.1.1.4. setModuleClassMap

setModuleClassMap()

Sets the class map used to speed up the module autoloading.

Parameters:array
Return type:ModuleLoader

1113.1.1.5. autoload

autoload()

Autoload a class

Parameters:$class
Return type:mixed False [if unable to load $class] get_class($class) [if $class is successfully loaded]

1113.1.1.6. loadModuleFromDir

loadModuleFromDir()

loadModuleFromDir

Parameters:
  • string
  • string
Return type:

mixed False [if unable to load $class] get_class($class) [if $class is successfully loaded]

1113.1.1.7. loadModuleFromPhar

loadModuleFromPhar()

loadModuleFromPhar

Parameters:
  • string
  • string
Return type:

mixed False [if unable to load $class] get_class($class) [if $class is successfully loaded]

1113.1.1.8. register

register()

Register the autoloader with spl_autoload registry

Return type:void

1113.1.1.9. unregister

unregister()

Unregister the autoloader with spl_autoload registry

Return type:void

1113.1.1.10. registerPaths

registerPaths()

registerPaths

Parameters:array|Traversable
Throws InvalidArgumentException:
 
Return type:ModuleAutoloader

1113.1.1.11. registerPath

registerPath()

registerPath

Parameters:
  • string
  • bool|string
Throws InvalidArgumentException:
 
Return type:

ModuleAutoloader

1113.1.1.12. getPaths

getPaths()

getPaths

This is primarily for unit testing, but could have other uses.

Return type:array

1113.1.1.13. pharFileToModuleName

pharFileToModuleName()

Returns the base module name from the path to a phar

Parameters:string
Return type:string

1113.1.1.14. normalizePath

normalizePath()

Normalize a path for insertion in the stack

Parameters:
  • string
  • bool – Whether trailing slash should be included
Return type:

string