mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
fixed chdir in dev controller
This commit is contained in:
@ -97,12 +97,15 @@ class DevController extends Controller
|
|||||||
$dirs = array_merge($dirs, $this->listSubDirs("$base/apps"));
|
$dirs = array_merge($dirs, $this->listSubDirs("$base/apps"));
|
||||||
asort($dirs);
|
asort($dirs);
|
||||||
|
|
||||||
|
$oldcwd = getcwd();
|
||||||
foreach($dirs as $dir) {
|
foreach($dirs as $dir) {
|
||||||
$displayDir = substr($dir, strlen($base));
|
$displayDir = substr($dir, strlen($base));
|
||||||
$this->stdout("Running '$command' in $displayDir...\n", Console::BOLD);
|
$this->stdout("Running '$command' in $displayDir...\n", Console::BOLD);
|
||||||
|
chdir($dir);
|
||||||
passthru($command);
|
passthru($command);
|
||||||
$this->stdout("done.\n", Console::BOLD, Console::FG_GREEN);
|
$this->stdout("done.\n", Console::BOLD, Console::FG_GREEN);
|
||||||
}
|
}
|
||||||
|
chdir($oldcwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user