Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
00ca1cb4
Commit
00ca1cb4
authored
Sep 04, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #4914
parent
3af08064
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
50 additions
and
34 deletions
+50
-34
HelloController.php
apps/basic/commands/HelloController.php
+16
-0
PhpDocController.php
build/controllers/PhpDocController.php
+2
-2
ApiController.php
extensions/apidoc/commands/ApiController.php
+2
-2
GuideController.php
extensions/apidoc/commands/GuideController.php
+2
-2
BaseController.php
extensions/apidoc/components/BaseController.php
+2
-2
FixtureController.php
extensions/faker/FixtureController.php
+2
-2
MigrateController.php
extensions/mongodb/console/controllers/MigrateController.php
+2
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-1
Controller.php
framework/console/Controller.php
+2
-2
BaseMigrateController.php
framework/console/controllers/BaseMigrateController.php
+3
-3
FixtureController.php
framework/console/controllers/FixtureController.php
+2
-2
MigrateController.php
framework/console/controllers/MigrateController.php
+2
-2
AssetControllerTest.php
...nit/framework/console/controllers/AssetControllerTest.php
+3
-3
BaseMessageControllerTest.php
...amework/console/controllers/BaseMessageControllerTest.php
+3
-3
MigrateControllerTestTrait.php
...mework/console/controllers/MigrateControllerTestTrait.php
+3
-3
UrlTest.php
tests/unit/framework/helpers/UrlTest.php
+3
-3
No files found.
apps/basic/commands/HelloController.php
View file @
00ca1cb4
...
...
@@ -27,4 +27,20 @@ class HelloController extends Controller
{
echo
$message
.
"
\n
"
;
}
public
function
actionTest
()
{
echo
'Test?'
;
}
// public function getDescription($actionID = null)
// {
// return "I'm custom description for $actionID!";
// }
public
function
getHelp
(
$actionID
=
null
)
{
return
"I'm custom help for
$actionID
!"
;
}
}
build/controllers/PhpDocController.php
View file @
00ca1cb4
...
...
@@ -103,9 +103,9 @@ class PhpDocController extends Controller
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
[
'updateFiles'
]);
return
array_merge
(
parent
::
options
(
$actionI
D
),
[
'updateFiles'
]);
}
protected
function
findFiles
(
$root
)
...
...
extensions/apidoc/commands/ApiController.php
View file @
00ca1cb4
...
...
@@ -159,8 +159,8 @@ class ApiController extends BaseController
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
[
'template'
,
'guide'
]);
return
array_merge
(
parent
::
options
(
$actionI
D
),
[
'template'
,
'guide'
]);
}
}
extensions/apidoc/commands/GuideController.php
View file @
00ca1cb4
...
...
@@ -113,8 +113,8 @@ class GuideController extends BaseController
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
[
'apiDocs'
]);
return
array_merge
(
parent
::
options
(
$actionI
D
),
[
'apiDocs'
]);
}
}
extensions/apidoc/components/BaseController.php
View file @
00ca1cb4
...
...
@@ -127,8 +127,8 @@ abstract class BaseController extends Controller
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
[
'template'
,
'exclude'
]);
return
array_merge
(
parent
::
options
(
$actionI
D
),
[
'template'
,
'exclude'
]);
}
}
extensions/faker/FixtureController.php
View file @
00ca1cb4
...
...
@@ -168,9 +168,9 @@ class FixtureController extends \yii\console\controllers\FixtureController
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
[
return
array_merge
(
parent
::
options
(
$actionI
D
),
[
'templatePath'
,
'language'
,
'fixtureDataPath'
]);
}
...
...
extensions/mongodb/console/controllers/MigrateController.php
View file @
00ca1cb4
...
...
@@ -73,10 +73,10 @@ class MigrateController extends BaseMigrateController
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
parent
::
options
(
$actionI
D
),
[
'migrationCollection'
,
'db'
]
// global for all actions
);
}
...
...
framework/CHANGELOG.md
View file @
00ca1cb4
...
...
@@ -421,7 +421,7 @@ Yii Framework 2 Change Log
-
Enh #2526: Allow for null values in batchInsert (skotos)
-
Enh #2646: Added support for specifying hostinfo in the pattern of a URL rule (qiangxue)
-
Enh #2661: Added boolean column type support for SQLite (qiangxue)
-
Enh #2670: Changed
`console\Controller::globalOptions()`
to
`options($actionI
d
)`
to (make it possible to) differentiate options per action (hqx)
-
Enh #2670: Changed
`console\Controller::globalOptions()`
to
`options($actionI
D
)`
to (make it possible to) differentiate options per action (hqx)
-
Enh #2714: Added support for formatting time intervals relative to the current time with
`yii\base\Formatter`
(drenty)
-
Enh #2726: Added
`yii\db\ActiveRecord::loadDefaultValues()`
that fills default values from DB schema (samdark)
-
Enh #2729: Added
`FilterValidator::skipOnArray`
so that filters like
`trim`
will not fail for array inputs (qiangxue)
...
...
framework/console/Controller.php
View file @
00ca1cb4
...
...
@@ -267,10 +267,10 @@ class Controller extends \yii\base\Controller
* Note that the values setting via options are not available
* until [[beforeAction()]] is being called.
*
* @param string $actionI
d
the action id of the current request
* @param string $actionI
D
the action id of the current request
* @return array the names of the options valid for the action
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
// $id might be used in subclass to provide options specific to action id
return
[
'color'
,
'interactive'
];
...
...
framework/console/controllers/BaseMigrateController.php
View file @
00ca1cb4
...
...
@@ -45,12 +45,12 @@ abstract class BaseMigrateController extends Controller
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
parent
::
options
(
$actionI
D
),
[
'migrationPath'
],
// global for all actions
(
$actionI
d
==
'create'
)
?
[
'templateFile'
]
:
[]
// action create
(
$actionI
D
==
'create'
)
?
[
'templateFile'
]
:
[]
// action create
);
}
...
...
framework/console/controllers/FixtureController.php
View file @
00ca1cb4
...
...
@@ -71,9 +71,9 @@ class FixtureController extends Controller
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
[
return
array_merge
(
parent
::
options
(
$actionI
D
),
[
'namespace'
,
'globalFixtures'
,
'append'
]);
}
...
...
framework/console/controllers/MigrateController.php
View file @
00ca1cb4
...
...
@@ -72,10 +72,10 @@ class MigrateController extends BaseMigrateController
/**
* @inheritdoc
*/
public
function
options
(
$actionI
d
)
public
function
options
(
$actionI
D
)
{
return
array_merge
(
parent
::
options
(
$actionI
d
),
parent
::
options
(
$actionI
D
),
[
'migrationTable'
,
'db'
]
// global for all actions
);
}
...
...
tests/unit/framework/console/controllers/AssetControllerTest.php
View file @
00ca1cb4
...
...
@@ -77,16 +77,16 @@ class AssetControllerTest extends TestCase
/**
* Emulates running of the asset controller action.
* @param string $actionI
d
id of action to be run.
* @param string $actionI
D
id of action to be run.
* @param array $args action arguments.
* @return string command output.
*/
protected
function
runAssetControllerAction
(
$actionI
d
,
array
$args
=
[])
protected
function
runAssetControllerAction
(
$actionI
D
,
array
$args
=
[])
{
$controller
=
$this
->
createAssetController
();
ob_start
();
ob_implicit_flush
(
false
);
$controller
->
run
(
$actionI
d
,
$args
);
$controller
->
run
(
$actionI
D
,
$args
);
return
ob_get_clean
();
}
...
...
tests/unit/framework/console/controllers/BaseMessageControllerTest.php
View file @
00ca1cb4
...
...
@@ -51,16 +51,16 @@ abstract class BaseMessageControllerTest extends TestCase
/**
* Emulates running of the message controller action.
* @param string $actionI
d
id of action to be run.
* @param string $actionI
D
id of action to be run.
* @param array $args action arguments.
* @return string command output.
*/
protected
function
runMessageControllerAction
(
$actionI
d
,
array
$args
=
[])
protected
function
runMessageControllerAction
(
$actionI
D
,
array
$args
=
[])
{
$controller
=
$this
->
createMessageController
();
ob_start
();
ob_implicit_flush
(
false
);
$controller
->
run
(
$actionI
d
,
$args
);
$controller
->
run
(
$actionI
D
,
$args
);
return
ob_get_clean
();
}
...
...
tests/unit/framework/console/controllers/MigrateControllerTestTrait.php
View file @
00ca1cb4
...
...
@@ -63,16 +63,16 @@ trait MigrateControllerTestTrait
/**
* Emulates running of the migrate controller action.
* @param string $actionI
d
id of action to be run.
* @param string $actionI
D
id of action to be run.
* @param array $args action arguments.
* @return string command output.
*/
protected
function
runMigrateControllerAction
(
$actionI
d
,
array
$args
=
[])
protected
function
runMigrateControllerAction
(
$actionI
D
,
array
$args
=
[])
{
$controller
=
$this
->
createMigrateController
();
ob_start
();
ob_implicit_flush
(
false
);
$controller
->
run
(
$actionI
d
,
$args
);
$controller
->
run
(
$actionI
D
,
$args
);
return
ob_get_clean
();
}
...
...
tests/unit/framework/helpers/UrlTest.php
View file @
00ca1cb4
...
...
@@ -38,15 +38,15 @@ class UrlTest extends TestCase
* Mocks controller action with parameters
*
* @param string $controllerId
* @param string $actionI
d
* @param string $actionI
D
* @param string $moduleID
* @param array $params
*/
protected
function
mockAction
(
$controllerId
,
$actionI
d
,
$moduleID
=
null
,
$params
=
[])
protected
function
mockAction
(
$controllerId
,
$actionI
D
,
$moduleID
=
null
,
$params
=
[])
{
\Yii
::
$app
->
controller
=
$controller
=
new
Controller
(
$controllerId
,
\Yii
::
$app
);
$controller
->
actionParams
=
$params
;
$controller
->
action
=
new
Action
(
$actionI
d
,
$controller
);
$controller
->
action
=
new
Action
(
$actionI
D
,
$controller
);
if
(
$moduleID
!==
null
)
{
$controller
->
module
=
new
Module
(
$moduleID
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment