]>
Commit | Line | Data |
---|---|---|
65715e5b ER |
1 | <?php |
2 | $phpDir = defined('PHP_DATADIR') && PHP_DATADIR ? PHP_DATADIR . '/php/' : '/usr/share/php/'; | |
3 | ||
4 | // Use Symfony autoloader | |
5 | if (!isset($loader) || !($loader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { | |
6 | if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { | |
7 | require_once $phpDir . '/Symfony/Component/ClassLoader/ClassLoader.php'; | |
8 | } | |
9 | ||
10 | $loader = new \Symfony\Component\ClassLoader\ClassLoader(); | |
11 | $loader->register(); | |
12 | } | |
13 | ||
14 | $baseDir = dirname(__DIR__); | |
15 | ||
16 | $loader->addPrefixes(array( | |
17 | 'Composer\\' => $baseDir, | |
18 | // Dependencies | |
19 | 'Composer\\Semver\\' => array($phpDir), | |
20 | 'Composer\\Spdx\\' => array($phpDir), | |
21 | 'JsonSchema' => array($phpDir), | |
22 | 'Seld\\JsonLint' => array($phpDir), | |
23 | 'Seld\\PharUtils\\' => array($phpDir), | |
24 | 'Symfony\\Component\\Console\\' => array($phpDir), | |
25 | 'Symfony\\Component\\Finder' => array($phpDir), | |
26 | 'Symfony\\Component\\Process\\' => array($phpDir), | |
27 | )); | |
28 | $loader->register(); | |
29 | ||
30 | return $loader; |