Commit d8669124 by Ragazzo Committed by Alexander Makarov

fixed console guide and docs of FixtureController

parent 3f597fd4
......@@ -305,13 +305,13 @@ yii fixture User UserProfile
yii fixture User --append
// load all fixtures
yii fixture/load *
yii fixture/load "*"
// same as above
yii fixture *
yii fixture "*"
// load all fixtures except ones
yii fixture * -DoNotLoadThisOne
yii fixture "*" -DoNotLoadThisOne
// load fixtures, but search them in different namespace. By default namespace is: tests\unit\fixtures.
yii fixture User --namespace='alias\my\custom\namespace'
......@@ -335,10 +335,10 @@ yii fixture/unload User
yii fixture/unload User,UserProfile
// unload all fixtures
yii fixture/unload all
yii fixture/unload "*"
// unload all fixtures except ones
yii fixture/unload all -DoNotUnloadThisOne
yii fixture/unload "*" -DoNotUnloadThisOne
```
......
......@@ -77,6 +77,9 @@ file via the `appconfig` option when executing the command:
yii <route> --appconfig=path/to/config.php ...
```
> Note: When specifying in console commands * as an input argument you should quote as "*", to avoid executing it as a shell command on
some platforms.
Creating your own console commands
----------------------------------
......@@ -151,3 +154,8 @@ public function actionIndex()
return 0;
}
```
There are some predefined console controller constants for this cases like the following:
- Controller::EXIT_CODE_NORMAL;
- Controller::EXIT_CODE_ERROR.
......@@ -25,10 +25,10 @@ use yii\test\FixtureTrait;
* yii fixture User
*
* #load all fixtures
* yii fixture *
* yii fixture "*"
*
* #load all fixtures except User
* yii fixture * -User
* yii fixture "*" -User
*
* #append fixtures to already loaded
* yii fixture User --append
......@@ -92,10 +92,10 @@ class FixtureController extends Controller
* yii fixture/load --append User UserProfile
*
* # load all available fixtures found under 'tests\unit\fixtures'
* yii fixture/load *
* yii fixture/load "*"
*
* # load all fixtures except User and UserProfile
* yii fixture/load * -User -UserProfile
* yii fixture/load "*" -User -UserProfile
* ~~~
*
* @throws Exception if the specified fixture does not exist.
......@@ -164,10 +164,10 @@ class FixtureController extends Controller
* yii fixture/unload User UserProfile
*
* # unload all fixtures found under 'tests\unit\fixtures'
* yii fixture/unload *
* yii fixture/unload "*"
*
* # unload all fixtures except User and UserProfile
* yii fixture/unload * -User -UserProfile
* yii fixture/unload "*" -User -UserProfile
* ~~~
*
* @throws Exception if the specified fixture does not exist.
......
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