<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 不兼容修改-001 > 該修改是由于 Swoole 無法在協程中 fork 進程,因此只能通過該方式處理進程守護。 當你使用 `composer update` 命令升級后出現以下異常時,請根據以下提示修復 ## event 依賴找不到 啟動時拋出以下異常 ``` [error] 2020-01-11 08:11:55.697 <802> Bean definition not found: event [code] 0 [type] Mix\Bean\Exception\NotFoundException ``` 再 manifest.php 中找到事件調度器的配置,增加 name => 'event' 配置: ~~~ // 事件調度器 [ // 名稱 'name' => 'event', // 作用域 'scope' => \Mix\Bean\BeanDefinition::SINGLETON, // 類路徑 'class' => \Mix\Event\EventDispatcher::class, // 構造函數注入 'constructorArgs' => [ \App\Common\Listeners\DatabaseListener::class, \App\Common\Listeners\RedisListener::class, ], ], ~~~ ## 后臺執行失效 - 升級后 `-d` 后臺執行失效,如下: ``` php bin/mix.php http:start -d ``` - 或者啟動服務器時,拋出以下異常 ``` MacOS unsupport fork in coroutine, please use it before the Swoole\Coroutine\Scheduler start. ``` ### 解決方法 首先再 `Common/Listeners` 目錄中創建一個 `CommandListener.php` ~~~ <?php namespace App\Common\Listeners; use Mix\Console\CommandLine\Flag; use Mix\Console\Event\CommandBeforeExecuteEvent; use Mix\Event\ListenerInterface; use Mix\Helper\ProcessHelper; /** * Class CommandListener * @package App\Common\Listeners * @author liu,jian <coder.keda@gmail.com> */ class CommandListener implements ListenerInterface { /** * 監聽的事件 * @return array */ public function events(): array { // 要監聽的事件數組,可監聽多個事件 return [ CommandBeforeExecuteEvent::class, ]; } /** * 處理事件 * @param object $event * @throws \Swoole\Exception */ public function process(object $event) { // 事件觸發后,會執行該方法 // 守護處理 if ($event instanceof CommandBeforeExecuteEvent) { switch ($event->command) { case \App\Http\Commands\StartCommand::class: case \App\WebSocket\Commands\StartCommand::class: case \App\Tcp\Commands\StartCommand::class: case \App\Udp\Commands\StartCommand::class: case \App\Sync\Commands\StartCommand::class: if (Flag::bool(['d', 'daemon'], false)) { ProcessHelper::daemon(); } break; } } } } ~~~ 然后再 manifest.php 中找到事件調度器的配置,將上面的監聽器類注冊進去: ~~~ // 事件調度器 [ // 名稱 'name' => 'event', // 作用域 'scope' => \Mix\Bean\BeanDefinition::SINGLETON, // 類路徑 'class' => \Mix\Event\EventDispatcher::class, // 構造函數注入 'constructorArgs' => [ \App\Common\Listeners\CommandListener::class, \App\Common\Listeners\DatabaseListener::class, \App\Common\Listeners\RedisListener::class, ], ], ~~~ 然后找到項目中全部的 StartCommand::class 文件中刪除守護處理的相關代碼: ``` // 守護處理 $daemon = Flag::bool(['d', 'daemon'], false); if ($daemon) { ProcessHelper::daemon(); } ``` ## DatabaseListener/RedisListener 監聽命令數據失效 - 把 DatabaseListener 監聽的事件從 ExecuteEvent::class 修改為 ExecutedEvent::class - 把 RedisListener 監聽的事件從 ExecuteEvent::class 修改為 CalledEvent::class
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看