diff options
Diffstat (limited to 'php-nikic-php-parser-autoload.php')
-rw-r--r-- | php-nikic-php-parser-autoload.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/php-nikic-php-parser-autoload.php b/php-nikic-php-parser-autoload.php new file mode 100644 index 0000000..61dca27 --- /dev/null +++ b/php-nikic-php-parser-autoload.php @@ -0,0 +1,19 @@ +<?php +/** + * Autoloader for nikic/php-parser and its dependencies + */ + +$vendorDir = '/usr/share/php'; + +// Use Symfony PSR4 autoloader +if (!isset($fedoraPsr4ClassLoader) || !($fedoraPsr4ClassLoader instanceof \Symfony\Component\ClassLoader\Psr4ClassLoader)) { + if (!class_exists('Symfony\\Component\\ClassLoader\\Psr4ClassLoader', false)) { + require_once '/usr/share/php/Symfony/Component/ClassLoader/Psr4ClassLoader.php'; + } + + $fedoraPsr4ClassLoader = new \Symfony\Component\ClassLoader\Psr4ClassLoader(); + $fedoraPsr4ClassLoader->register(true); +} + +$fedoraPsr4ClassLoader->addPrefix('PhpParser\\', __DIR__); + |