<legend id='gAk3e'><style id='gAk3e'><dir id='gAk3e'><q id='gAk3e'></q></dir></style></legend>
  • <i id='gAk3e'><tr id='gAk3e'><dt id='gAk3e'><q id='gAk3e'><span id='gAk3e'><b id='gAk3e'><form id='gAk3e'><ins id='gAk3e'></ins><ul id='gAk3e'></ul><sub id='gAk3e'></sub></form><legend id='gAk3e'></legend><bdo id='gAk3e'><pre id='gAk3e'><center id='gAk3e'></center></pre></bdo></b><th id='gAk3e'></th></span></q></dt></tr></i><div id='gAk3e'><tfoot id='gAk3e'></tfoot><dl id='gAk3e'><fieldset id='gAk3e'></fieldset></dl></div>

      <small id='gAk3e'></small><noframes id='gAk3e'>

      <tfoot id='gAk3e'></tfoot>

      • <bdo id='gAk3e'></bdo><ul id='gAk3e'></ul>

        从控制器 CakePHP 3.x 执行 shell

        Execute shell from controller CakePHP 3.x(从控制器 CakePHP 3.x 执行 shell)
      1. <small id='SmDsB'></small><noframes id='SmDsB'>

        <tfoot id='SmDsB'></tfoot>
          <bdo id='SmDsB'></bdo><ul id='SmDsB'></ul>
              <i id='SmDsB'><tr id='SmDsB'><dt id='SmDsB'><q id='SmDsB'><span id='SmDsB'><b id='SmDsB'><form id='SmDsB'><ins id='SmDsB'></ins><ul id='SmDsB'></ul><sub id='SmDsB'></sub></form><legend id='SmDsB'></legend><bdo id='SmDsB'><pre id='SmDsB'><center id='SmDsB'></center></pre></bdo></b><th id='SmDsB'></th></span></q></dt></tr></i><div id='SmDsB'><tfoot id='SmDsB'></tfoot><dl id='SmDsB'><fieldset id='SmDsB'></fieldset></dl></div>
                  <tbody id='SmDsB'></tbody>
                <legend id='SmDsB'><style id='SmDsB'><dir id='SmDsB'><q id='SmDsB'></q></dir></style></legend>

                  本文介绍了从控制器 CakePHP 3.x 执行 shell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 CakePHP Shell 中有一项特定任务,它由 CRON 作业执行.但我希望用户能够随时从网络界面(如按钮或类似的东西)执行它.

                  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 this) whenever he wants.

                  所以,我的问题是,这是否可以从控制器执行 shell?

                  So, my question is, is this possible to execute a shell from a controller ?

                  在控制器中模拟:

                  bin/cake MyShell
                  

                  我知道在以前版本的 CakePHP 中是可能的,但是我在最新版本中没有找到与此相关的内容.使用 exec("bin/cake MyShell") 对我来说似乎很脏.

                  I know it was possible in the previous versions of CakePHP, but I didn't find something related to this in the newest version. And use exec("bin/cake MyShell") seems really dirty to me.

                  推荐答案

                  创建一个shell对象,调用它的任何一个要执行的函数

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

                   $myShell = new AppShellMyShell;
                   $myShell->anyShellFun();
                  

                  这篇关于从控制器 CakePHP 3.x 执行 shell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

                  <legend id='1fpLW'><style id='1fpLW'><dir id='1fpLW'><q id='1fpLW'></q></dir></style></legend>

                      <tfoot id='1fpLW'></tfoot>
                    • <i id='1fpLW'><tr id='1fpLW'><dt id='1fpLW'><q id='1fpLW'><span id='1fpLW'><b id='1fpLW'><form id='1fpLW'><ins id='1fpLW'></ins><ul id='1fpLW'></ul><sub id='1fpLW'></sub></form><legend id='1fpLW'></legend><bdo id='1fpLW'><pre id='1fpLW'><center id='1fpLW'></center></pre></bdo></b><th id='1fpLW'></th></span></q></dt></tr></i><div id='1fpLW'><tfoot id='1fpLW'></tfoot><dl id='1fpLW'><fieldset id='1fpLW'></fieldset></dl></div>
                        <bdo id='1fpLW'></bdo><ul id='1fpLW'></ul>

                          <small id='1fpLW'></small><noframes id='1fpLW'>

                              <tbody id='1fpLW'></tbody>