diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-04-04 19:26:48 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-04-04 19:26:48 +0200 |
commit | f0e887057f634d86755dc0edbe908a44977b40ff (patch) | |
tree | 88796a546bf20618df84c2b7a58b6ccaaea8b9d8 | |
parent | 280576d10df46e849490b0669312e5ad412b1e82 (diff) |
php-hoa-exception: use Hoa autoloader
-rw-r--r-- | php-hoa-exception-autoload.php | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/php-hoa-exception-autoload.php b/php-hoa-exception-autoload.php index ab72272..269e5f8 100644 --- a/php-hoa-exception-autoload.php +++ b/php-hoa-exception-autoload.php @@ -1,24 +1,13 @@ <?php -/* Autoloader for hoa/event and its dependencies */ +/* Autoloader for hoa/exception 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); + if ($mandatory || file_exists($dep)) require_once($dep); } +$fedoraHoaLoader->addNamespace('Hoa\\Exception\\', __DIR__, true); |