Execute shell from controller CakePHP 3.x

前端 未结 3 852
没有蜡笔的小新
没有蜡笔的小新 2021-01-24 01:31

I have a specific task in a CakePHP Shell and it\'s executed by a CRON job. But I want the users to be able to execute it from a web interface (like a button or something like t

3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-24 01:57

    create a shell object , the call any of its function to want to excute

     $myShell = new \App\Shell\MyShell;
     $myShell->anyShellFun();
    

提交回复
热议问题