<bdo id='FNVfG'></bdo><ul id='FNVfG'></ul>

    1. <legend id='FNVfG'><style id='FNVfG'><dir id='FNVfG'><q id='FNVfG'></q></dir></style></legend>

    2. <small id='FNVfG'></small><noframes id='FNVfG'>

        <tfoot id='FNVfG'></tfoot>
      1. <i id='FNVfG'><tr id='FNVfG'><dt id='FNVfG'><q id='FNVfG'><span id='FNVfG'><b id='FNVfG'><form id='FNVfG'><ins id='FNVfG'></ins><ul id='FNVfG'></ul><sub id='FNVfG'></sub></form><legend id='FNVfG'></legend><bdo id='FNVfG'><pre id='FNVfG'><center id='FNVfG'></center></pre></bdo></b><th id='FNVfG'></th></span></q></dt></tr></i><div id='FNVfG'><tfoot id='FNVfG'></tfoot><dl id='FNVfG'><fieldset id='FNVfG'></fieldset></dl></div>
      2. Laravel 调度调用控制器

        Laravel Scheduling call controller(Laravel 调度调用控制器)
        <tfoot id='twrIX'></tfoot>
            <tbody id='twrIX'></tbody>

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

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

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

                  问题描述

                  我使用 Laravel 任务调度,但是当我从控制器调用某些方法时遇到问题.

                  I work with Laravel Task Scheduling, but I have a problem when I call some method from my controller.

                  protected function schedule(Schedule $schedule)
                  {
                      $schedule->call('UserController@deleteInactiveUsers')->everyMinute();
                      //$schedule->call('AppHttpControllersUserController@deleteInactiveUsers')->everyMinute();
                  }
                  

                  当我使用未注释的行调用时,出现此错误:

                  When I call with uncommented line i get this error:

                  [ReflectionException]
                  Class RecurrenceInvoiceController does not exist
                  

                  然后我插入完全限定的命名空间路径,然后出现此错误:

                  and then I insert fully qualified namespace path and then I get this error:

                  [PDOException] SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
                  

                  还有

                  [ErrorException] PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known 
                  

                  问题出在哪里?从 Laravel 任务调度中从控制器调用方法哪种方式是正确的.

                  Where is the problem? Which way is correct to call method from Controller from Laravel Task Scheduling.

                  推荐答案

                  几个月前我遇到了同样的问题,直到我能解决它.我使用 laravel 5.2,内核以这种方式调用我的驱动程序:

                  I stumbled months ago with the same problem, until I could fix it. I use laravel 5.2 and the kernel call my drivers this way:

                  $schedule->call('AppHttpControllersMyController@MyAction')->everyMinute();
                  

                  我希望这会帮助其他人;)

                  I hope this will help someone else ;)

                  这篇关于Laravel 调度调用控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                    <tbody id='hrlut'></tbody>

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

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

                        • <legend id='hrlut'><style id='hrlut'><dir id='hrlut'><q id='hrlut'></q></dir></style></legend>
                        • <small id='hrlut'></small><noframes id='hrlut'>