本文整理匯總了PHP中SiteConfig::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteConfig::all方法的具體用法?PHP SiteConfig::all怎麽用?PHP SiteConfig::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SiteConfig
的用法示例。
在下文中一共展示了SiteConfig::all方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: function
//If config is empty and if the user is not running the installer, Show error
if (!$config && !$isInstalling) {
if (!DB::connection()) {
return Response::configurationError("Oops! The database cant be read!", "Database Connection error");
} else {
return Response::configurationError("Oops! The database is not configured properly!", "Database Configuration error");
}
}
});
App::before(function ($request) {
//dd($request->getPathInfo() == route(Config::get('app-installer::routeName'), [], false));
App::singleton('siteConfig', function () {
//Loading config
$config = array(0);
try {
$configRows = SiteConfig::all();
} catch (Exception $e) {
//Config cant be read! DB cant be accessed or Installation not completed
//return Response::configurationError("Please complete installation and check again.", "Installation incomplete!");
return false;
}
foreach ($configRows as $row) {
$config[$row->name] = (array) json_decode($row->value, true);
}
return $config;
});
$config = app('siteConfig');
//If config is empty, skip the rest
if (!$config) {
return;
}