1、编写方法
在welcome控制器加入test方法
public function test($argv1 = null,$argv2 = null)
{
if (isset($_SERVER['REMOTE_ADDR'])) exit('No direct script access allowed');
echo "cli ok\n";
echo $argv1;
echo "\n";
echo $argv2;
}
2、执行cli
$ cd /ci目录/
$ php index.php welcome test "argv1" "argv2"
在welcome控制器加入test方法
public function test($argv1 = null,$argv2 = null)
{
if (isset($_SERVER['REMOTE_ADDR'])) exit('No direct script access allowed');
echo "cli ok\n";
echo $argv1;
echo "\n";
echo $argv2;
}
2、执行cli
$ cd /ci目录/
$ php index.php welcome test "argv1" "argv2"