diff options
| author | Remi Collet <fedora@famillecollet.com> | 2016-04-04 16:38:25 +0200 | 
|---|---|---|
| committer | Remi Collet <fedora@famillecollet.com> | 2016-04-04 16:38:25 +0200 | 
| commit | 280576d10df46e849490b0669312e5ad412b1e82 (patch) | |
| tree | 701b90660e4d2515a02110123639aad03dd98ddd /php-hoa-exception-autoload.php | |
php-hoa-exception: new package (wip)
Diffstat (limited to 'php-hoa-exception-autoload.php')
| -rw-r--r-- | php-hoa-exception-autoload.php | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/php-hoa-exception-autoload.php b/php-hoa-exception-autoload.php new file mode 100644 index 0000000..ab72272 --- /dev/null +++ b/php-hoa-exception-autoload.php @@ -0,0 +1,24 @@ +<?php +/* Autoloader for hoa/event and its dependencies */ + +$vendor = '/usr/share/php'; +// Use Symfony autoloader +if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { +    if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { +        require_once $vendor . '/Symfony/Component/ClassLoader/ClassLoader.php'; +    } + +    $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); +    $fedoraClassLoader->register(); +} + +$fedoraClassLoader->addPrefix('Hoa\\Exception\\', dirname(dirname(__DIR__))); + +// Dependencies +foreach ([ +	$vendor . '/Hoa/Consistency/autoload.php'    => true, +	$vendor . '/Hoa/Event/autoload.php'          => true, +	] as $dep => $mandatory) { +	if ($mandory || file_exists($dep) require_once($dep); +} + | 
