Reduce use of legacy 'Config::ICONS_DIR'.
Also some minor cleanup in 'API#_get_config()'.
This commit is contained in:
@@ -366,22 +366,19 @@ class API extends Handler {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see RPC::_make_init_params()
|
||||
* @see RPC::_make_runtime_info()
|
||||
* @return array<string, array<string, string>|bool|int|string>
|
||||
*/
|
||||
private function _get_config(): array {
|
||||
$config = [
|
||||
"icons_dir" => Config::get(Config::ICONS_DIR),
|
||||
"icons_url" => Config::get(Config::ICONS_URL)
|
||||
return [
|
||||
'custom_sort_types' => $this->_get_custom_sort_types(),
|
||||
'daemon_is_running' => file_is_locked('update_daemon.lock'),
|
||||
'icons_url' => Config::get_self_url() . '/public.php',
|
||||
'num_feeds' => ORM::for_table('ttrss_feeds')
|
||||
->where('owner_uid', $_SESSION['uid'])
|
||||
->count(),
|
||||
];
|
||||
|
||||
$config["daemon_is_running"] = file_is_locked("update_daemon.lock");
|
||||
$config["custom_sort_types"] = $this->_get_custom_sort_types();
|
||||
|
||||
$config["num_feeds"] = ORM::for_table('ttrss_feeds')
|
||||
->where('owner_uid', $_SESSION['uid'])
|
||||
->count();
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
function getConfig(): bool {
|
||||
|
||||
@@ -1743,7 +1743,10 @@ class RSSUtils {
|
||||
$tmph->run_hooks(PluginHost::HOOK_HOUSE_KEEPING);
|
||||
}
|
||||
|
||||
/** migrates favicons from legacy storage in feed-icons/ to cache/feed-icons/using new naming (sans .ico suffix) */
|
||||
/**
|
||||
* migrates favicons from legacy storage in feed-icons/ to cache/feed-icons/using new naming (sans .ico suffix)
|
||||
* @todo Remove this and Config::ICONS_DIR at some point
|
||||
*/
|
||||
static function migrate_feed_icons() : void {
|
||||
$old_dir = Config::get(Config::ICONS_DIR);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user