本文整理匯總了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();
}