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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
diff -up ./bin/phpreflect.json.dist.rpm ./bin/phpreflect.json.dist
diff -up ./bin/phpreflect.rpm ./bin/phpreflect
--- ./bin/phpreflect.rpm 2015-01-15 17:38:39.000000000 +0100
+++ ./bin/phpreflect 2015-01-16 11:26:45.900540580 +0100
@@ -1,23 +1,35 @@
-#!/usr/bin/env php
+#!/usr/bin/php
<?php
$appName = 'phpReflect';
if (\Phar::running()) {
$vendorDir = 'phar://' . strtolower($appName) . '.phar/vendor';
} else {
- $baseDir = dirname(__DIR__);
- $vendorDir = $baseDir . '/vendor';
-
- if (!file_exists($vendorDir . '/autoload.php')) {
- $vendorDir = dirname(dirname($baseDir));
- }
+ $vendorDir = '/usr/share/php';
if (!getenv("BARTLETTRC")) {
putenv("BARTLETTRC=" . strtolower($appName) . '.json');
}
}
-$loader = require_once $vendorDir . '/autoload.php';
-$loader->setUseIncludePath(true);
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+require_once $vendorDir . '/SebastianBergmann/Version/Version.php';
+
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+ 'Symfony\\Component' => $vendorDir,
+ 'Doctrine\\Common' => $vendorDir,
+ 'phpDocumentor\\Reflection' => $vendorDir,
+ 'Seld\\JsonLint' => $vendorDir,
+ 'JsonSchema' => $vendorDir,
+ 'Bartlett' => $vendorDir,
+));
+$loader->useIncludePath(true);
+$loader->register();
if (PHP_SAPI !== 'cli') {
return;
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
--- ./tests/bootstrap.php.rpm 2015-01-16 11:32:46.045016105 +0100
+++ ./tests/bootstrap.php 2015-01-16 11:32:49.152028834 +0100
@@ -1,16 +1,31 @@
<?php
$baseDir = dirname(__DIR__);
-$vendorDir = $baseDir . '/vendor';
+$vendorDir = '/usr/share/php';
-$loader = require_once $vendorDir . '/autoload.php';
-$loader->addClassMap(
- array(
+$tab = array(
'Bartlett\Tests\Reflect\Analyser\FooAnalyser'
=> __DIR__ . '/Analyser/FooAnalyser.php',
'Bartlett\Tests\Reflect\Analyser\BarAnalyser'
=> __DIR__ . '/Analyser/BarAnalyser.php',
'Bartlett\Tests\Reflect\Model\GenericModelTest'
=> __DIR__ . '/Model/GenericModelTest.php',
- )
);
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+ 'Bartlett\\Tests\\Reflect' => $baseDir . '/tests',
+ 'Bartlett' => $baseDir . '/src',
+));
+$loader->useIncludePath(true);
+$loader->register();
+
+foreach ($tab as $class => $file) {
+ require_once $file;
+}
|