framework/src/Core.php

28 lines
581 B
PHP
Raw Normal View History

<?php namespace Flarum;
class Core
{
public static function isInstalled()
{
return app()->bound('flarum.config');
}
2015-06-20 20:38:44 +02:00
public static function inDebugMode()
{
return static::isInstalled() && app('flarum.config')['debug'];
2015-06-20 20:38:44 +02:00
}
public static function config($key, $default = null)
{
2015-05-27 16:25:44 +09:30
if (! static::isInstalled()) {
return $default;
}
if (is_null($value = app('flarum.db')->table('config')->where('key', $key)->pluck('value'))) {
$value = $default;
}
return $value;
}
}