当前位置: 首页>>代码示例>>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;未经允许,请勿转载。