diff --git a/requirements.php b/requirements.php index 356773a..91a0fb0 100644 --- a/requirements.php +++ b/requirements.php @@ -28,11 +28,19 @@ if (!isset($frameworkPath)) { } } -if (!is_dir($frameworkPath)) { - echo '
The path to yii framework seems to be incorrect.
'; - echo 'You need to install Yii framework via composer or adjust the framework path in file ' . basename(__FILE__) . '.
'; - echo 'Please refer to the README on how to install Yii.
'; +if (!isset($frameworkPath) || !is_dir($frameworkPath)) { + $message = "The path to yii framework seems to be incorrect.
\n" + . 'You need to install Yii framework via composer or adjust the framework path in file ' . basename(__FILE__) . ".
\n" + . 'Please refer to the README on how to install Yii.
\n"; + + if (!empty($_SERVER['argv'])) { + // do not print HTML when used in console mode + echo strip_tags($message); + } else { + echo $message; + } + exit(1); } require_once($frameworkPath . '/requirements/YiiRequirementChecker.php');