本文整理汇总了PHP中Illuminate\Foundation\Application::setRequestForConsoleEnvironment方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::setRequestForConsoleEnvironment方法的具体用法?PHP Application::setRequestForConsoleEnvironment怎么用?PHP Application::setRequestForConsoleEnvironment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Foundation\Application
的用法示例。
在下文中一共展示了Application::setRequestForConsoleEnvironment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: refreshApplication
/**
* Refresh the application instance.
*
* @return void
*/
protected function refreshApplication()
{
$this->app = $this->createApplication();
$this->client = $this->createClient();
$this->app->setRequestForConsoleEnvironment();
$this->app->boot();
}
示例2: _before
public function _before(\Codeception\TestCase $test)
{
$this->kernel = $this->getApplication();
$this->kernel->boot();
$this->kernel->setRequestForConsoleEnvironment();
$this->client = new LaravelConnector($this->kernel);
$this->client->followRedirects(true);
if ($this->config['filters']) {
$this->haveEnabledFilters();
}
if ($this->transactionCleanup()) {
$this->kernel['db']->beginTransaction();
}
}
示例3: refreshApplication
/**
* Refresh the application instance.
*
* @param \Illuminate\Foundation\Application $app Optionally provide your own unbooted
* Laravel Application instance. This
* parameter can largely be ignored and
* is used just for unit testing
* @return void
*/
public function refreshApplication($app = null)
{
$this->app = $app instanceof Application ? $app : $this->createApplication();
$this->app->setRequestForConsoleEnvironment();
$this->app->boot();
if ($this->migrateDatabase) {
$artisan = $this->app->make('artisan');
try {
$artisan->call('migrate:install');
} catch (QueryException $e) {
// migration table is already installed
}
$artisan->call('migrate:refresh');
if ($this->seedDatabase) {
$artisan->call('db:seed', array('--class' => $this->seedClass));
}
}
}
示例4: setRequestForConsoleEnvironment
/**
* Set the application request for the console environment.
*
* @return void
* @static
*/
public static function setRequestForConsoleEnvironment()
{
\Illuminate\Foundation\Application::setRequestForConsoleEnvironment();
}