diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-10-14 14:39:34 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-10-14 14:39:34 +0200 |
commit | 461fac51d513a34c07af350be9f79f364826e99c (patch) | |
tree | baa99356a2eae4b8718a51c9a6beabb29b978f85 /cli-prompt-autoload.php | |
parent | 86f09d7be4666093aee7595e775de93e0d18272d (diff) |
php-seld-cli-prompt: add autoloader
Diffstat (limited to 'cli-prompt-autoload.php')
-rw-r--r-- | cli-prompt-autoload.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cli-prompt-autoload.php b/cli-prompt-autoload.php new file mode 100644 index 0000000..1da2de3 --- /dev/null +++ b/cli-prompt-autoload.php @@ -0,0 +1,15 @@ +<?php +/* Autoloader for seld/cli-prompt 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('Seld\\CliPrompt\\', dirname(dirname(__DIR__))); |