diff options
Diffstat (limited to 'php-hoa-consistency-autoload.php')
-rw-r--r-- | php-hoa-consistency-autoload.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/php-hoa-consistency-autoload.php b/php-hoa-consistency-autoload.php new file mode 100644 index 0000000..379b6d5 --- /dev/null +++ b/php-hoa-consistency-autoload.php @@ -0,0 +1,22 @@ +<?php +/* Autoloader for hoa/consistency and its dependencies */ + +/* This will load the autoloader */ +require_once __DIR__ . '/Prelude.php'; + +$vendor = '/usr/share/php'; + +// Use Hoa autoloader +if (!isset($fedoraHoaLoader) || !($fedoraHoaLoader instanceof \Hoa\Consistency\Autoloader)) { + $fedoraHoaLoader = new \Hoa\Consistency\Autoloader(); + $fedoraHoaLoader->register(); + $fedoraHoaLoader->addNamespace('Hoa\\Consistency\\', __DIR__); +} + +// Dependencies +foreach ([ + $vendor . '/Hoa/Exception/autoload.php' => true, + ] as $dep => $mandatory) { + if ($mandatory || file_exists($dep)) require_once($dep); +} + |