當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application::runningInConsole方法代碼示例

本文整理匯總了PHP中Illuminate\Foundation\Application::runningInConsole方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::runningInConsole方法的具體用法?PHP Application::runningInConsole怎麽用?PHP Application::runningInConsole使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Foundation\Application的用法示例。


在下文中一共展示了Application::runningInConsole方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadCurrentApplication

 protected function loadCurrentApplication()
 {
     if ($this->app->runningInConsole()) {
         $application = new Application(['name' => 'Soda CMS']);
         $application->url = new ApplicationUrl(['domain' => 'soda.dev', 'folder' => '']);
     } else {
         $application = Application::with('url')->whereHas('url', function ($q) {
             $domain = $this->app->request->getHttpHost();
             $q->where('domain', $domain)->where(function ($sq) {
                 $folder = $this->app->request->segment(1) == null ? '' : $this->app->request->segment(1);
                 $sq->where('folder', $folder)->orWhere('folder', '');
             })->orderBy('folder', 'DESC');
         })->first();
     }
     $this->application = $application;
     return $this;
 }
開發者ID:ryzr,項目名稱:soda-cms,代碼行數:17,代碼來源:SodaInstance.php

示例2: runningInConsole

 /**
  * Determine if we are running in the console.
  *
  * @return bool 
  * @static 
  */
 public static function runningInConsole()
 {
     return \Illuminate\Foundation\Application::runningInConsole();
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:10,代碼來源:_ide_helper.php

示例3: inConsole

 /**
  * 是否運行在命令行內部
  * @return bool
  */
 public function inConsole()
 {
     return $this->app->runningInConsole();
 }
開發者ID:jhasheng,項目名稱:purple,代碼行數:8,代碼來源:PurpleHook.php

示例4: runningInConsole

 /**
  * Override
  */
 public function runningInConsole()
 {
     if (defined('FAKE_NOT_IN_CONSOLE')) {
         return !FAKE_NOT_IN_CONSOLE;
     } else {
         return parent::runningInConsole();
     }
 }
開發者ID:kttis,項目名稱:LaravelFly,代碼行數:11,代碼來源:Application.php

示例5: runningUnitTests

 /**
  * Determine if the application is running unit tests.
  *
  * @return bool
  */
 protected function runningUnitTests()
 {
     return $this->app->runningInConsole() && $this->app->runningUnitTests();
 }
開發者ID:n6ither,項目名稱:vixit,代碼行數:9,代碼來源:VerifyCsrfToken.php

示例6: runningInConsole

 /**
  * Determine if the application is running in the console.
  *
  * @return bool
  */
 protected function runningInConsole()
 {
     return $this->app->runningInConsole();
 }
開發者ID:torann,項目名稱:localization,代碼行數:9,代碼來源:Localization.php

示例7: __construct

 public function __construct(App $app)
 {
     if (!$app->runningInConsole()) {
         $this->authorize('permission_admin');
     }
 }
開發者ID:codeedu,項目名稱:laravel52-carnaval,代碼行數:6,代碼來源:PermissionsController.php

示例8: __construct

 /**
  *  Create a new SaveUrlMiddleware instance
  *
  *  @param  Store   $store
  *  @param  Config  $config
  *  @return void
  */
 public function __construct(Application $app)
 {
     $this->store = $app['session.store'];
     $this->sessionKey = $app['config']->get('save-url.session-key');
     $this->isRunningInConsole = !$app->environment('testing') && $app->runningInConsole();
 }
開發者ID:Waavi,項目名稱:save-url,代碼行數:13,代碼來源:SaveUrlMiddleware.php


注:本文中的Illuminate\Foundation\Application::runningInConsole方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。