当前位置: 首页>>代码示例>>PHP>>正文


PHP App::isDownForMaintenance方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\App::isDownForMaintenance方法的典型用法代码示例。如果您正苦于以下问题:PHP App::isDownForMaintenance方法的具体用法?PHP App::isDownForMaintenance怎么用?PHP App::isDownForMaintenance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\App的用法示例。


在下文中一共展示了App::isDownForMaintenance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     // Check not 'sync'
     if (Config::get('queue.default') == "sync") {
         Artisan::call('down');
         $this->info("Application maintenance mode enabled.");
         return;
     }
     // Push job onto queue
     Queue::push(function ($job) {
         // Take Application down.
         Artisan::call('down');
         // Add Log message
         Log::info("Application is down, pausing queue while maintenance happens.");
         // Loop, waiting for app to come back up
         while (App::isDownForMaintenance()) {
             echo ".";
             sleep(5);
         }
         // App is back online, kill worker to restart daemon.
         Log::info("Application is up, rebooting queue.");
         Artisan::call('queue:restart');
         $job->delete();
     });
     // Wait until Maintenance Mode enabled.
     while (!App::isDownForMaintenance()) {
         sleep(1);
     }
     $this->info("Application maintenance mode enabled.");
 }
开发者ID:valorin,项目名称:l4-down-safe,代码行数:35,代码来源:DownSafe.php

示例2: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     if (!$this->verifyInstalled() || $this->hasRunningDeployments() || $this->composerOutdated() || $this->nodeOutdated() || !$this->checkRequirements()) {
         return -1;
     }
     $bring_back_up = false;
     if (!App::isDownForMaintenance()) {
         $this->error(Lang::get('app.not_down'));
         if (!$this->confirm(Lang::get('app.switch_down'))) {
             return;
         }
         $bring_back_up = true;
         $this->call('down');
     }
     $this->backupDatabase();
     $this->updateConfiguration();
     $this->clearCaches();
     $this->migrate();
     $this->optimize();
     $this->restartQueue();
     $this->restartSocket();
     // If we prompted the user to bring the app down, bring it back up
     if ($bring_back_up) {
         $this->call('up');
     }
 }
开发者ID:rebelinblue,项目名称:deployer,代码行数:31,代码来源:UpdateApp.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if (App::isDownForMaintenance()) {
         throw new HttpException(503);
     }
     return $next($request);
 }
开发者ID:tangtienviet,项目名称:StyleCI,代码行数:15,代码来源:CheckForMaintenanceMode.php

示例4: handle

 /**
  * Execute the console command.
  */
 public function handle()
 {
     $bring_back_up = false;
     // Check the app is offline, if not ask the user if it can be brought down
     if (!App::isDownForMaintenance()) {
         $this->error(Lang::get('app.not_down'));
         if (!$this->confirm(Lang::get('app.switch_down'))) {
             return;
         }
         $bring_back_up = true;
         $this->call('down');
     }
     $this->cleanupDeployments();
     // If we prompted the user to bring the app down, bring it back up
     if ($bring_back_up) {
         $this->call('up');
     }
 }
开发者ID:rebelinblue,项目名称:deployer,代码行数:21,代码来源:ClearStalledDeployment.php


注:本文中的Illuminate\Support\Facades\App::isDownForMaintenance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。