summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-Reflect-autoload.php
blob: 9fe6a644ec551cffe56838189663a3caff5ccdc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
 * Autoloader for bartlett/php-reflect 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->addPrefixes(array(
    'Symfony\\Component'                  => $vendorDir,
    'JsonSchema'                          => $vendorDir,
    'Seld\\JsonLint'                      => $vendorDir,
    'Bartlett'                            => dirname(dirname(__DIR__)),
));

// Mandatory dependencies
require_once $vendorDir . '/PhpParser/Autoloader.php';
PhpParser\Autoloader::register();
require_once $vendorDir . '/SebastianBergmann/Version/autoload.php';
require_once $vendorDir . '/Doctrine/Common/Collections/autoload.php';
require_once $vendorDir . '/Doctrine/Common/Cache/autoload.php';
require_once $vendorDir . '/phpDocumentor/Reflection/DocBlock/autoload.php';

// Needed when installed for 'Bartlett\CompatInfo\Analyser\CompatibilityAnalyser'
if (is_dir($vendorDir . '/Bartlett/CompatInfo')) {
   $fedoraClassLoader->addPrefix('Bartlett\\CompatInfo', $vendorDir);
}

// Optional dependencies
if (file_exists($vendorDir . '/Bartlett/UmlWriter/autoload.php')) {
   require_once $vendorDir . '/Bartlett/UmlWriter/autoload.php';
}
if (is_dir($vendorDir . '/Psr/Log')) {
   $fedoraClassLoader->addPrefix('Psr\\Log', $vendorDir);
}
if (is_dir($vendorDir . '/Monolog')) {
   $fedoraClassLoader->addPrefix('Monolog', $vendorDir);
}