Skip to content

Commit

Permalink
Finished console Gii feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangxue committed Sep 14, 2014
1 parent 443779d commit 00cfe93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions extensions/gii/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Yii Framework 2 gii extension Change Log
- Enh #3088: The gii module will manage their own URL rules now (qiangxue)
- Enh #3222: Added `useTablePrefix` option to the model generator for Gii (horizons2)
- Enh #3811: Now Gii model generator makes autocomplete for model class field (mitalcoi)
- New #1280: Gii can now be run from command line (schmunk42, cebe, qiangxue)


2.0.0-beta April 13, 2014
Expand Down
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ Yii Framework 2 Change Log
- Chg: `yii\web\Request::cookieValidationKey` must be explicitly specified for each application that wants to use cookie validation (qiangxue)
- Chg: Added `yii\composer\Installer::postCreateProject()` and modified the syntax of calling installer methods in composer.json (qiangxue)
- Chg: When an ID is found to be in both `Application::controllerMap` and `Application::modules`, the former will take precedence (qiangxue)
- New #1280: Gii can now be run from command line (schmunk42, cebe, qiangxue)
- New #3911: Added `yii\behaviors\SluggableBehavior` that fills the specified model attribute with the transliterated and adjusted version to use in URLs (creocoder)
- New #4193: Added `yii\filters\Cors` CORS filter to allow Cross Origin Resource Sharing (pgaultier)
- New #4945: Added `yii\test\ArrayFixture` (Ragazzo)
Expand Down
10 changes: 5 additions & 5 deletions framework/console/controllers/HelpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,11 @@ protected function getSubCommandHelp($controller, $actionID)
*/
protected function formatOptionHelp($name, $required, $type, $defaultValue, $comment)
{
$doc = '';
$comment = trim($comment);
$type = trim($type);
if (strncmp($type, 'bool', 4) === 0) {
$type = 'boolean, 0 or 1';
}

if ($defaultValue !== null && !is_array($defaultValue)) {
if ($type === null) {
Expand All @@ -344,10 +347,7 @@ protected function formatOptionHelp($name, $required, $type, $defaultValue, $com
$defaultValue = var_export($defaultValue, true);
}
$doc = "$type (defaults to " . $defaultValue . ")";
} elseif (trim($type) !== '') {
if (strncmp($type, 'bool', 4) === 0) {
$type = 'boolean, 0 or 1';
}
} else {
$doc = $type;
}

Expand Down

0 comments on commit 00cfe93

Please sign in to comment.