Download the PHP package fedora/autoloader without Composer
On this page you can find all versions of the php package fedora/autoloader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fedora/autoloader
More information about fedora/autoloader
Files in fedora/autoloader
Package autoloader
Short Description Fedora PHP Autoloader
License MIT
Homepage https://github.com/php-fedora/autoloader
Informations about the package autoloader
Fedora Autoloader
Static PSR-4, PSR-0, and classmap autoloader. Includes loader for required and optional dependencies.
Autoloader
PSR-4
\Fedora\Autoloader\Autoload::addPsr4($prefix, $path, $prepend = false)
PSR-0
\Fedora\Autoloader\Autoload::addPsr0($prefix, $path, $prepend = false)
Classmap
\Fedora\Autoloader\Autoload::addClassMap(array $classMap, $path)
phpab
Template
Template: res/phpab/fedora.php.tpl
For an example of its' usage, see tests/genclassmap.sh.
Dependencies loader
Loops through provided array of dependencies:
- If dependency is not an array:
- If dependency is required, it is only required/loaded if it exists,
otherwise a
\RuntimeException
is thrown. - If dependency is not required, it is only required/loaded if it exists.
- If dependency is required, it is only required/loaded if it exists,
otherwise a
- If dependency is an array:
- Loops through all items until the first item that exists is found and
then it is required/loaded. If no item is found and the dependency
is required, the last item will be required/loaded if it exists,
otherwise a
\RuntimeException
is thrown.
- Loops through all items until the first item that exists is found and
then it is required/loaded. If no item is found and the dependency
is required, the last item will be required/loaded if it exists,
otherwise a
Required dependencies
\Fedora\Autoloader\Dependencies::required(array $requiredDependencies)
Example 1
Equates to:
Example 2
Equates to:
Optional dependencies
\Fedora\Autoloader\Dependencies::optional(array $optionalDependencies)
Example 1
Equates to:
Example 2
Equates to:
License
The MIT License (MIT)