diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-06-16 13:50:53 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-06-16 13:50:53 +0200 |
commit | 8e71918cb0b763bc31fdf4a3f4637d26e2e8705a (patch) | |
tree | c1a7e0c3b5f6e96ae17de16aed263be7cd3a04ec /autoload.php | |
parent | 0906317ed69409bc398d0bda62f6e458b592daac (diff) |
php-liuggio-statsd-php-client: autoloader
Diffstat (limited to 'autoload.php')
-rw-r--r-- | autoload.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/autoload.php b/autoload.php new file mode 100644 index 0000000..d4e19e1 --- /dev/null +++ b/autoload.php @@ -0,0 +1,18 @@ +<?php +$vendor = '/usr/share/php'; +if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { + if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { + require_once $vendor . '/Symfony/Component/ClassLoader/ClassLoader.php'; + } + + $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); + $fedoraClassLoader->register(); +} + +if (is_dir($vendor . '/Monolog')) { + $fedoraClassLoader->addPrefix('Monolog', $vendor); + $fedoraClassLoader->addPrefix('Psr\\Log', $vendor); +} +$fedoraClassLoader->addPrefix('Liuggio\\StatsdClient', dirname(dirname(__DIR__))); + +return $fedoraClassLoader; |