本文整理汇总了PHP中Illuminate\Contracts\Foundation\Application::booted方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::booted方法的具体用法?PHP Application::booted怎么用?PHP Application::booted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Foundation\Application
的用法示例。
在下文中一共展示了Application::booted方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new console kernel instance.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function __construct(Application $app, Dispatcher $events)
{
$this->app = $app;
$this->events = $events;
$this->app->booted(function () {
$this->defineConsoleSchedule();
});
}
示例2: __construct
/**
* Create a new console kernel instance.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function __construct(Application $app, Dispatcher $events)
{
if (!defined('ARTISAN_BINARY')) {
define('ARTISAN_BINARY', 'artisan');
}
$this->app = $app;
$this->events = $events;
$this->app->booted(function () {
$this->defineConsoleSchedule();
});
}
示例3: bootstrap
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $application
*
* @return void
*/
public function bootstrap(Application $application)
{
if ($application->isInstalled()) {
if ($application->routesAreCached()) {
$application->booted(function () use($application) {
require $application->getCachedRoutesPath();
});
} else {
$application->make('events')->fire(new RouteRegister($application, $application['router']));
$application->booted(function () use($application) {
$application['router']->getRoutes()->refreshNameLookups();
});
}
}
}
示例4: bootstrap
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
/** @var \Illuminate\Foundation\Application $app*/
$env = $app->environment();
$filesystem = $this->files = new Filesystem();
$loader = new FileLoader($filesystem, $app['path.config']);
$config = new Repository($loader, $filesystem, $env);
$loader->setRepository($config);
$app->instance('config', $config);
$configuredLoader = $app['config']->get('laradic_config.loader');
if (isset($configuredLoader) && $configuredLoader !== 'file') {
if ($configuredLoader === 'db') {
$loader = new DatabaseLoader($filesystem, $app['path.config']);
$config->setLoader($loader);
$app->booted(function () use($app, $loader, $config) {
$loader->setDatabase($app['db']->connection());
$loader->setDatabaseTable($app['config']->get('laradic_config.loaders.db.table'));
});
$loader->setRepository($config);
}
}
if (file_exists($cached = $app->getCachedConfigPath()) && !$app->runningInConsole()) {
$items = (require $cached);
$loadedFromCache = true;
}
if (!isset($loadedFromCache)) {
# $this->loadConfigurationFiles($app, $config);
}
date_default_timezone_set($config['app.timezone']);
mb_internal_encoding('UTF-8');
}