1.CI cmd命令行调用方式
php index.php 类名/方法名 参数(windows环境不用加引号)
(1)code 在Controlller创建一个类如下所示即可
class Cmd extends CI_Controller
{
public function import($file){
var_dump($file);exit;
if (!file_exists($file)) {return;}
}
}
(2)调用
C:\xampp7\htdocs\viewsql>php index.php cmd/import helloworld
string(10) "helloworld"