framework/src/Core.php
2015-05-27 16:25:44 +09:30

25 lines
461 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 = DB::table('config')->where('key', $key)->pluck('value'))) {
$value = $default;
}
return $value;
}
}