本文整理匯總了PHP中Illuminate\Contracts\Foundation\Application::isInstalled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::isInstalled方法的具體用法?PHP Application::isInstalled怎麽用?PHP Application::isInstalled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Contracts\Foundation\Application
的用法示例。
在下文中一共展示了Application::isInstalled方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: set
/**
* @param $key
* @param $value
* @return bool
*/
public function set($key, $value)
{
$setting = Setting::whereKey($key)->first();
if (!is_object($setting)) {
$setting = new Setting();
$setting->key = $key;
}
$setting->value = $value;
$setting->save();
if ($this->application->isInstalled()) {
$this->cache->forget($this->cache_key);
}
return true;
}
示例2: 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();
});
}
}
}
示例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()) {
$config = $application->make(ConfigRepository::class);
$setting = $application->make(SettingsRepository::class);
date_default_timezone_set($setting->get('setting.timezone', $config['app.timezone']));
$config->set('app.debug', $setting->get('setting.debug', true));
$config->set('mail.driver', $setting->get('mail.driver', 'smtp'));
$config->set('mail.host', $setting->get('mail.host'));
$config->set('mail.port', $setting->get('mail.port'));
$config->set('mail.from.address', $setting->get('mail.from'));
$config->set('mail.from.name', $setting->get('site.title', 'Notadd'));
$config->set('mail.encryption', $setting->get('mail.encryption'));
$config->set('mail.username', $setting->get('mail.username'));
$config->set('mail.password', $setting->get('mail.password'));
}
}