本文整理汇总了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);
}
}