summaryrefslogtreecommitdiffstats
path: root/php-hoa-compiler-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-04-06 17:02:14 +0200
committerRemi Collet <fedora@famillecollet.com>2016-04-06 17:02:14 +0200
commit278834effbfc977bc7dfa545b20fb12184afd4ce (patch)
tree9e9b093b1817c619996af49e626fb496c2a603bd /php-hoa-compiler-autoload.php
php-hoa-compiler: wip
Diffstat (limited to 'php-hoa-compiler-autoload.php')
-rw-r--r--php-hoa-compiler-autoload.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/php-hoa-compiler-autoload.php b/php-hoa-compiler-autoload.php
new file mode 100644
index 0000000..9fafec9
--- /dev/null
+++ b/php-hoa-compiler-autoload.php
@@ -0,0 +1,21 @@
+<?php
+/* Autoloader for hoa/compiler and its dependencies */
+
+$vendor = '/usr/share/php';
+
+// Dependencies
+foreach ([
+ $vendor . '/Hoa/Consistency/autoload.php' => true,
+ $vendor . '/Hoa/Exception/autoload.php' => true,
+ $vendor . '/Hoa/File/autoload.php' => true,
+ $vendor . '/Hoa/Iterator/autoload.php' => true,
+ $vendor . '/Hoa/Math/autoload.php' => true,
+ $vendor . '/Hoa/Protocol/autoload.php' => true,
+ $vendor . '/Hoa/Regex/autoload.php' => true,
+ $vendor . '/Hoa/Visitor/autoload.php' => true,
+ ] as $dep => $mandatory) {
+ if ($mandatory || file_exists($dep)) require_once($dep);
+}
+
+$fedoraHoaLoader->addNamespace('Hoa\\Compiler\\', __DIR__, true);
+