framework/src/Core.php
2015-06-08 11:21:42 +02:00

25 lines
468 B
PHP

<?php namespace Flarum;
use DB;
class Core
{
public static function isInstalled()
{
return file_exists(base_path('../config.php'));
}
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;
}
}