We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30b02c6 commit b2adb88Copy full SHA for b2adb88
1 file changed
system/CodeIgniter.php
@@ -838,13 +838,18 @@ protected function createController()
838
*/
839
protected function runController($class)
840
{
841
+ // If this is a CLI request then use the input segments as parameters
842
+ $params = (is_cli() && ! (ENVIRONMENT === 'testing'))
843
+ ? $this->request->getSegments()
844
+ : $this->router->params();
845
+
846
if (method_exists($class, '_remap'))
847
- $output = $class->_remap($this->method, ...$this->router->params());
848
+ $output = $class->_remap($this->method, ...$params);
849
}
850
else
851
- $output = $class->{$this->method}(...$this->router->params());
852
+ $output = $class->{$this->method}(...$params);
853
854
855
$this->benchmark->stop('controller');
0 commit comments