Skip to content

Commit 8492d9f

Browse files
authored
Merge pull request #2571 from MGatner/cli-params
Retain CLI segments
2 parents 489c2bf + 2523083 commit 8492d9f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

system/CodeIgniter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,13 +838,16 @@ protected function createController()
838838
*/
839839
protected function runController($class)
840840
{
841+
// If this is a console request then use the input segments as parameters
842+
$params = defined('SPARKED') ? $this->request->getSegments() : $this->router->params();
843+
841844
if (method_exists($class, '_remap'))
842845
{
843-
$output = $class->_remap($this->method, ...$this->router->params());
846+
$output = $class->_remap($this->method, ...$params);
844847
}
845848
else
846849
{
847-
$output = $class->{$this->method}(...$this->router->params());
850+
$output = $class->{$this->method}(...$params);
848851
}
849852

850853
$this->benchmark->stop('controller');

0 commit comments

Comments
 (0)