本文整理匯總了PHP中Configuration::has方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configuration::has方法的具體用法?PHP Configuration::has怎麽用?PHP Configuration::has使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Configuration
的用法示例。
在下文中一共展示了Configuration::has方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: hasRoute
public function hasRoute($route, $key = null)
{
if (\Configuration::has('admin_routes')) {
$routes = \Admin::routes();
// limit the search to a particular route group
if (isset($key)) {
try {
$routes = $routes[$key];
foreach ($routes as $k => $r) {
if (array_key_exists($route, $r)) {
return true;
}
}
} catch (\ErrorException $e) {
// try general execution
}
}
// general execution
if (isset($routes)) {
foreach ($routes as $k => $r) {
foreach ($r as $key => $foundRoute) {
if (array_key_exists($route, $foundRoute)) {
return true;
}
}
}
}
}
return false;
}
示例2: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
if (\Schema::hasTable('config')) {
if (!\Configuration::has('app_name')) {
\Configuration::set('app_name', env('APP_NAME'));
}
}
}
示例3: register
/**
* Register the application services.
*
* @return void
*/
public function register()
{
\App::bind('admin', function () {
// set debug mode!
if (!\Configuration::has('debug')) {
\Configuration::set('debug', true);
}
return new \App\Classes\Admin();
});
}
示例4: handle
/**
* Handle a formatted log message.
* <p>If logfile is defined, then that file is appended. Otherwise,
* the PHP system logging mechanism is used.
* @param string $message Formatted log message to handle.
*/
function handle($message)
{
// notice that error_log() is not preferred because apache munges
// the log output and makes any formatted message with a newline
// practically unreadable.
if ($this->config->has('message-handler')) {
$mh = $this->config->get('message-handler');
if (function_exists($mh)) {
$mh($message);
} else {
error_log("Invalid message handler {$mh}\n" . "unhandled message: {$message}");
}
} elseif ($this->config->has('logfile')) {
$this->openLogFile();
fwrite($this->logfile, $message);
} else {
error_log($message);
}
}