summaryrefslogtreecommitdiffstats
path: root/php-phine-path-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-10-27 16:00:40 +0100
committerRemi Collet <fedora@famillecollet.com>2015-10-27 16:00:40 +0100
commitcbca9d9142a144a49912134172f7b86741f88c31 (patch)
treeba9838de2927fe913b420b18774f49ee64295778 /php-phine-path-autoload.php
php-phine-path: 1.1.0, new package
Diffstat (limited to 'php-phine-path-autoload.php')
-rw-r--r--php-phine-path-autoload.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/php-phine-path-autoload.php b/php-phine-path-autoload.php
new file mode 100644
index 0000000..f58f89d
--- /dev/null
+++ b/php-phine-path-autoload.php
@@ -0,0 +1,17 @@
+<?php
+/* Autoloader for phine/path and its dependencies */
+
+$vendorDir = '/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 $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php';
+ }
+
+ $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
+ $fedoraClassLoader->register();
+}
+
+$fedoraClassLoader->addPrefix('Phine\\Path\\', dirname(dirname(__DIR__)));
+
+require_once $vendorDir . '/Phine/Exception/autoload.php';