mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
Fixes #17124: Fixed ErrorException when run ./yii fixture/unload without arguments
This commit is contained in:
committed by
Alexander Makarov
parent
fc98a95a90
commit
e6513a2c9e
@ -8,6 +8,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #17156: Fixes PHP 7.2 warning when a data provider has no data as a parameter for a GridView (evilito)
|
||||
- Bug #17083: Fixed `yii\validators\EmailValidator::$checkDNS` tells that every domain is correct on alpine linux (mikk150)
|
||||
- Bug #17180: Do not populate `yii\web\Response::$response` when response code is 204 (mikk150)
|
||||
- Bug #17124: Fixed ErrorException when run `./yii fixture/unload` without arguments (ricpelo)
|
||||
|
||||
|
||||
2.0.16.1 February 28, 2019
|
||||
|
||||
@ -109,11 +109,7 @@ class FixtureController extends Controller
|
||||
public function actionLoad(array $fixturesInput = [])
|
||||
{
|
||||
if ($fixturesInput === []) {
|
||||
$this->stdout($this->getHelpSummary() . "\n");
|
||||
|
||||
$helpCommand = Console::ansiFormat('yii help fixture', [Console::FG_CYAN]);
|
||||
$this->stdout("Use $helpCommand to get usage info.\n");
|
||||
|
||||
$this->printHelpMessage();
|
||||
return ExitCode::OK;
|
||||
}
|
||||
|
||||
@ -188,6 +184,11 @@ class FixtureController extends Controller
|
||||
*/
|
||||
public function actionUnload(array $fixturesInput = [])
|
||||
{
|
||||
if ($fixturesInput === []) {
|
||||
$this->printHelpMessage();
|
||||
return ExitCode::OK;
|
||||
}
|
||||
|
||||
$filtered = $this->filterFixtures($fixturesInput);
|
||||
$except = $filtered['except'];
|
||||
|
||||
@ -232,6 +233,18 @@ class FixtureController extends Controller
|
||||
$this->notifyUnloaded($fixtures);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show help message.
|
||||
* @param array $fixturesInput
|
||||
*/
|
||||
private function printHelpMessage()
|
||||
{
|
||||
$this->stdout($this->getHelpSummary() . "\n");
|
||||
|
||||
$helpCommand = Console::ansiFormat('yii help fixture', [Console::FG_CYAN]);
|
||||
$this->stdout("Use $helpCommand to get usage info.\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies user that fixtures were successfully loaded.
|
||||
* @param array $fixtures
|
||||
|
||||
Reference in New Issue
Block a user