summaryrefslogtreecommitdiffstats
path: root/php-hoa-consistency-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-04-04 19:33:45 +0200
committerRemi Collet <fedora@famillecollet.com>2016-04-04 19:33:45 +0200
commit9bb22968827d26f3e760b0722077b6c0299b6254 (patch)
treefc0e6881ffe59439d4297cd52496923d61ab8e25 /php-hoa-consistency-autoload.php
php-hoa-consistency: new package (wip)
Diffstat (limited to 'php-hoa-consistency-autoload.php')
-rw-r--r--php-hoa-consistency-autoload.php22
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);
+}
+