search for framework path in requirements.php

fixes https://github.com/yiisoft/yii2/issues/15041
This commit is contained in:
Carsten Brandt 2017-10-30 09:33:22 +01:00
parent 2f2e2506c6
commit 6bb488de6b
No known key found for this signature in database
GPG Key ID: BE4F41DE1DEEEED0

View File

@ -11,7 +11,22 @@
*/ */
// you may need to adjust this path to the correct Yii framework path // you may need to adjust this path to the correct Yii framework path
$frameworkPath = dirname(__FILE__) . '/vendor/yiisoft/yii2'; // uncomment and adjust the following line if Yii is not located at the default path
//$frameworkPath = dirname(__FILE__) . '/vendor/yiisoft/yii2';
if (!isset($frameworkPath)) {
$searchPaths = [
dirname(__FILE__) . '/vendor/yiisoft/yii2',
dirname(__FILE__) . '/../vendor/yiisoft/yii2',
];
foreach($searchPaths as $path) {
if (is_dir($path)) {
$frameworkPath = $path;
break;
}
}
}
if (!is_dir($frameworkPath)) { if (!is_dir($frameworkPath)) {
echo '<h1>Error</h1>'; echo '<h1>Error</h1>';