Commit 35cd2bff by Carsten Brandt

apidoc command: fixed vendor path

parent f39b1e4b
...@@ -14,9 +14,11 @@ $composerAutoload = [ ...@@ -14,9 +14,11 @@ $composerAutoload = [
__DIR__ . '/vendor/autoload.php', // standalone with "composer install" run __DIR__ . '/vendor/autoload.php', // standalone with "composer install" run
__DIR__ . '/../../autoload.php', // script is installed as a composer binary __DIR__ . '/../../autoload.php', // script is installed as a composer binary
]; ];
$vendorPath = null;
foreach($composerAutoload as $autoload) { foreach($composerAutoload as $autoload) {
if (file_exists($autoload)) { if (file_exists($autoload)) {
require($autoload); require($autoload);
$vendorPath = dirname($autoload);
break; break;
} }
} }
...@@ -45,5 +47,8 @@ $application = new yii\console\Application([ ...@@ -45,5 +47,8 @@ $application = new yii\console\Application([
'controllerNamespace' => 'yii\\apidoc\\commands', 'controllerNamespace' => 'yii\\apidoc\\commands',
'controllerPath' => '@yii/apidoc/commands', 'controllerPath' => '@yii/apidoc/commands',
]); ]);
if ($vendorPath !== null) {
$application->setVendorPath($vendorPath);
}
$exitCode = $application->run(); $exitCode = $application->run();
exit($exitCode); exit($exitCode);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment