Commit 35cd2bff by Carsten Brandt

apidoc command: fixed vendor path

parent f39b1e4b
......@@ -14,9 +14,11 @@ $composerAutoload = [
__DIR__ . '/vendor/autoload.php', // standalone with "composer install" run
__DIR__ . '/../../autoload.php', // script is installed as a composer binary
];
$vendorPath = null;
foreach($composerAutoload as $autoload) {
if (file_exists($autoload)) {
require($autoload);
$vendorPath = dirname($autoload);
break;
}
}
......@@ -45,5 +47,8 @@ $application = new yii\console\Application([
'controllerNamespace' => 'yii\\apidoc\\commands',
'controllerPath' => '@yii/apidoc/commands',
]);
if ($vendorPath !== null) {
$application->setVendorPath($vendorPath);
}
$exitCode = $application->run();
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