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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
diff -up ./bin/apigen.rpm ./bin/apigen
--- ./bin/apigen.rpm 2015-10-30 13:44:43.000000000 +0100
+++ ./bin/apigen 2015-11-03 08:06:32.480579189 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
-require __DIR__ . '/bootstrap.php';
+require '/usr/share/php/ApiGen/autoload.php';
// Create temp dir
@@ -26,8 +26,8 @@ if (isset($_SERVER['argv']) && ($tmp = a
$configurator = new Nette\Configurator;
$configurator->setDebugMode( ! Tracy\Debugger::$productionMode);
$configurator->setTempDirectory($tempDir);
-$configurator->addConfig(__DIR__ . '/../src/DI/config.neon');
-$configurator->addParameters(['rootDir' => __DIR__ . '/..']);
+$configurator->addConfig('/usr/share/php/ApiGen/DI/config.neon');
+$configurator->addParameters(['rootDir' => '/usr/share/php/ApiGen']);
$container = $configurator->createContainer();
diff -up ./src/autoload.php.rpm ./src/autoload.php
--- ./src/autoload.php.rpm 2015-11-03 08:06:32.481579194 +0100
+++ ./src/autoload.php 2015-11-03 08:10:03.608531505 +0100
@@ -0,0 +1,31 @@
+<?php
+// Autoloader for apigen/apigen and its dependencies
+$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();
+}
+
+$fedoraClassLoader->addPrefix('ApiGen\\', dirname(__DIR__));
+
+// Dependencies
+$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendor);
+$fedoraClassLoader->addPrefix('TokenReflection\\', $vendor);
+$fedoraClassLoader->addPrefix('Michelf\\', $vendor);
+
+require_once $vendor . '/Nette/Application/autoload.php';
+require_once $vendor . '/Nette/Bootstrap/autoload.php';
+require_once $vendor . '/Nette/DI/autoload.php';
+require_once $vendor . '/Nette/Neon/autoload.php';
+require_once $vendor . '/Nette/Mail/autoload.php';
+require_once $vendor . '/Nette/RobotLoader/autoload.php';
+require_once $vendor . '/Nette/SafeStream/autoload.php';
+require_once $vendor . '/Latte/autoload.php';
+require_once $vendor . '/Tracy/autoload.php';
+require_once $vendor . '/FSHL/autoload.php';
+require_once $vendor . '/Kdyby/Events/autoload.php';
diff -up ./src/Configuration/ConfigurationOptionsResolver.php.rpm ./src/Configuration/ConfigurationOptionsResolver.php
--- ./src/Configuration/ConfigurationOptionsResolver.php.rpm 2015-10-30 13:44:43.000000000 +0100
+++ ./src/Configuration/ConfigurationOptionsResolver.php 2015-11-03 08:06:32.481579194 +0100
@@ -231,10 +231,10 @@ class ConfigurationOptionsResolver
private function getTemplateConfigPathFromTheme($theme)
{
if ($theme === self::TEMPLATE_THEME_DEFAULT) {
- return $this->themeConfigPathResolver->resolve('/vendor/apigen/theme-default/src/config.neon');
+ return $this->themeConfigPathResolver->resolve('/themes/theme-default/config.neon');
} elseif ($theme === self::TEMPLATE_THEME_BOOTSTRAP) {
- return $this->themeConfigPathResolver->resolve('/vendor/apigen/theme-bootstrap/src/config.neon');
+ return $this->themeConfigPathResolver->resolve('/themes/theme-bootstrap/config.neon');
}
throw new ConfigurationException(CO::TEMPLATE_THEME . ' ' . $theme . ' is not supported.');
diff -up ./src/DI/ApiGenExtension.php.rpm ./src/DI/ApiGenExtension.php
--- ./src/DI/ApiGenExtension.php.rpm 2015-11-03 08:08:42.874167346 +0100
+++ ./src/DI/ApiGenExtension.php 2015-11-03 08:09:24.816356528 +0100
@@ -61,10 +61,6 @@ class ApiGenExtension extends CompilerEx
$application = $builder->getDefinition($builder->getByType('ApiGen\Console\Application'));
foreach (array_keys($builder->findByTag(self::TAG_CONSOLE_COMMAND)) as $serviceName) {
- $className = $builder->getDefinition($serviceName)->getClass();
- if ( ! $this->isPhar() && $className === 'ApiGen\Command\SelfUpdateCommand') {
- continue;
- }
$application->addSetup('add', ['@' . $serviceName]);
}
}
diff -up ./src/DI/apigen.services.neon.rpm ./src/DI/apigen.services.neon
--- ./src/DI/apigen.services.neon.rpm 2015-11-03 08:08:48.525192830 +0100
+++ ./src/DI/apigen.services.neon 2015-11-03 08:08:55.423223948 +0100
@@ -1,7 +1,6 @@
services:
# commands
- {class: ApiGen\Command\GenerateCommand, tags: [console.command]}
- - {class: ApiGen\Command\SelfUpdateCommand, tags: [console.command]}
# configuration
- ApiGen\Configuration\Configuration
diff -up ./src/Theme/ThemeConfigPathResolver.php.rpm ./src/Theme/ThemeConfigPathResolver.php
--- ./src/Theme/ThemeConfigPathResolver.php.rpm 2015-10-30 13:44:43.000000000 +0100
+++ ./src/Theme/ThemeConfigPathResolver.php 2015-11-03 08:06:32.481579194 +0100
@@ -38,7 +38,7 @@ class ThemeConfigPathResolver
{
$allowedPaths = [
$this->rootDir,
- $this->rootDir . '/../../..'
+ '/usr/share/apigen'
];
foreach ($allowedPaths as $allowedPath) {
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
--- ./tests/bootstrap.php.rpm 2015-10-30 13:44:43.000000000 +0100
+++ ./tests/bootstrap.php 2015-11-03 08:10:14.113578889 +0100
@@ -1,7 +1,13 @@
<?php
-include __DIR__ . '/../vendor/autoload.php';
+include '@BUILDROOT@/usr/share/php/ApiGen/autoload.php';
+require_once $vendor . '/Symfony/Component/ClassLoader/Psr4ClassLoader.php';
+$Loader = new \Symfony\Component\ClassLoader\Psr4ClassLoader();
+$Loader->addPrefix("ApiGen\\Tests\\", __DIR__);
+$Loader->register();
+
+require_once $vendor . '/Mockery/autoload.php';
$tempDir = __DIR__ . '/temp/' . getmypid();
define('TEMP_DIR', $tempDir);
|