82df35a59b
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
39 lines
753 B
PHP
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);
|
|
}
|