本文整理汇总了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;
}
示例2: runningInConsole
/**
* Determine if we are running in the console.
*
* @return bool
* @static
*/
public static function runningInConsole()
{
return \Illuminate\Foundation\Application::runningInConsole();
}
示例3: inConsole
/**
* 是否运行在命令行内部
* @return bool
*/
public function inConsole()
{
return $this->app->runningInConsole();
}
示例4: runningInConsole
/**
* Override
*/
public function runningInConsole()
{
if (defined('FAKE_NOT_IN_CONSOLE')) {
return !FAKE_NOT_IN_CONSOLE;
} else {
return parent::runningInConsole();
}
}
示例5: runningUnitTests
/**
* Determine if the application is running unit tests.
*
* @return bool
*/
protected function runningUnitTests()
{
return $this->app->runningInConsole() && $this->app->runningUnitTests();
}
示例6: runningInConsole
/**
* Determine if the application is running in the console.
*
* @return bool
*/
protected function runningInConsole()
{
return $this->app->runningInConsole();
}
示例7: __construct
public function __construct(App $app)
{
if (!$app->runningInConsole()) {
$this->authorize('permission_admin');
}
}
示例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();
}