miniflux-legacy/app/helpers/config.php
Frederic Guillot 82df35a59b Change the database structure to have a single database
This is a major change for the next release of Miniflux.

- There is now only one database that can supports multiple users
- There is no automated schema migration for this release
- A migration procedure is available in the ChangeLog file
2016-12-26 09:51:38 -05:00

39 lines
753 B
PHP

<?php
namespace Miniflux\Helper;
use Miniflux\Model;
use Miniflux\Session\SessionStorage;
function config($parameter, $default = null)
{
$session = SessionStorage::getInstance();
$cache = $session->getConfig();
$value = null;
if (empty($cache)) {
$cache = Model\Config\get_all($session->getUserId());
$session->setConfig($cache);
}
if (array_key_exists($parameter, $cache)) {
$value = $cache[$parameter];
}
if ($value === null) {
$value = $default;
}
return $value;
}
function bool_config($parameter, $default = false)
{
return (bool) config($parameter, $default);
}
function int_config($parameter, $default = false)
{
return (int) config($parameter, $default);
}