Commit 05339536 by Alexander Makarov

Used Exception instead of die() in classmap CLI controller

parent fa661221
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace yii\build\controllers; namespace yii\build\controllers;
use yii\console\Controller; use yii\console\Controller;
use yii\console\Exception;
use yii\helpers\FileHelper; use yii\helpers\FileHelper;
/** /**
...@@ -53,7 +54,7 @@ class ClassmapController extends Controller ...@@ -53,7 +54,7 @@ class ClassmapController extends Controller
$map = []; $map = [];
foreach ($files as $file) { foreach ($files as $file) {
if (strpos($file, $root) !== 0) { if (strpos($file, $root) !== 0) {
die("Something wrong: $file\n"); throw new Exception("Something wrong: $file\n");
} }
$path = str_replace('\\', '/', substr($file, strlen($root))); $path = str_replace('\\', '/', substr($file, strlen($root)));
$map[$path] = "\t'yii" . substr(str_replace('/', '\\', $path), 0, -4) . "' => YII_PATH . '$path',"; $map[$path] = "\t'yii" . substr(str_replace('/', '\\', $path), 0, -4) . "' => YII_PATH . '$path',";
......
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