1
0
mirror of https://github.com/flarum/core.git synced 2025-10-09 14:06:26 +02:00
Files
php-flarum/src/Core.php
2015-06-20 20:38:44 +02:00

28 lines
546 B
PHP

<?php namespace Flarum;
class Core
{
public static function isInstalled()
{
return file_exists(base_path('../config.php'));
}
public static function inDebugMode()
{
return env('APP_DEBUG');
}
public static function config($key, $default = null)
{
if (! static::isInstalled()) {
return $default;
}
if (is_null($value = app('db')->table('config')->where('key', $key)->pluck('value'))) {
$value = $default;
}
return $value;
}
}