<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                過去,開發者會對每個他們想要調用的命令行指令建立 Cron 對象。然而,這很令人頭痛。你的命令行指令調用不再包含在版本控制里面,并且你必須 SSH 進入你的服務器以添加 Cron 對象。讓我們來讓生活變得更輕松。Laravel 命令調用器允許你順暢地且語義化地定義命令調用在 Laravel 里面,而且你的服務器只需要一個 Cron 對象。 你的命令調用保存在 `app/Console/Kernel.php` 文件。你會在這個類里看到一個 `schedule` 方法。為了幫助您開始,方法里面包含一個簡單的例子。你可以依照你需要的自由地添加任何數量的預定工作到 `Schedule` 對象。你只需要添加這個 Cron 對象到服務器: ~~~ * * * * * php /path/to/artisan schedule:run 1>> /dev/null 2>&1 ~~~ 這個 Cron 將會每分鐘調用 Laravel 命令調用器。接著,Laravel 評估你的預定工作并在時間到時執行工作。這不能再更簡單了! ## 更多調用的例子 讓我們來多看幾個調用的例子: ### 調用閉包 ~~~ $schedule->call(function() { // 執行一些任務... })->hourly(); ~~~ ### 調用終端機命令 ~~~ $schedule->exec('composer self-update')->daily(); ~~~ ### 自己配置 Cron 表達式 ~~~ $schedule->command('foo')->cron('* * * * *'); ~~~ ### 頻繁的工作 ~~~ $schedule->command('foo')->everyFiveMinutes(); $schedule->command('foo')->everyTenMinutes(); $schedule->command('foo')->everyThirtyMinutes(); ~~~ ### 每天一次的工作 ~~~ $schedule->command('foo')->daily(); ~~~ ### 每天一次在特定時間 (24 小時制) 的工作 ~~~ $schedule->command('foo')->dailyAt('15:00'); ~~~ ### 每天兩次的工作 ~~~ $schedule->command('foo')->twiceDaily(); ~~~ ### 每個工作日執行的工作 ~~~ $schedule->command('foo')->weekdays(); ~~~ ### 每周一次的工作 ~~~ $schedule->command('foo')->weekly(); // 調用每周一次在特定的日子 (0-6) 和時間的工作... $schedule->command('foo')->weeklyOn(1, '8:00'); ~~~ ### 每月一次的工作 ~~~ $schedule->command('foo')->monthly(); ~~~ ### 特定日期的工作 ~~~ $schedule->command('foo')->mondays(); $schedule->command('foo')->tuesdays(); $schedule->command('foo')->wednesdays(); $schedule->command('foo')->thursdays(); $schedule->command('foo')->fridays(); $schedule->command('foo')->saturdays(); $schedule->command('foo')->sundays(); ~~~ ### Prevent Jobs From Overlapping By default, scheduled jobs will be run even if the previous instance of the job is still running. To prevent this, you may use the `withoutOverlapping` method: ~~~ $schedule->command('foo')->withoutOverlapping(); ~~~ In this example, the `foo` command will be run every minute if it is not already running. ### 限制應該執行工作的環境 ~~~ $schedule->command('foo')->monthly()->environments('production'); ~~~ 指定工作在當應用程序處于維護模式也應該執行 ~~~ $schedule->command('foo')->monthly()->evenInMaintenanceMode(); ~~~ ### 只允許工作在閉包返回 true 的時候執行 ~~~ $schedule->command('foo')->monthly()->when(function() { return true; }); ~~~ ### 將預定工作的輸出發送到指定的 E-mail ~~~ $schedule->command('foo')->sendOutputTo($filePath)->emailOutputTo('foo@example.com'); ~~~ > 注意: 你必須先把輸出存到文件中才可以發送 email。 ### 將預定工作的輸出發送到指定的路徑 ~~~ $schedule->command('foo')->sendOutputTo($filePath); ~~~ ### 在預定工作執行之后 Ping 一個給定的 URL ~~~ $schedule->command('foo')->thenPing($url); ~~~
                  <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>

                              哎呀哎呀视频在线观看