3) Introducing ConfigFactory

This commit is contained in:
Philipp Holzer 2019-02-03 22:22:03 +01:00
parent 36120615dd
commit b541efc5e6
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
11 changed files with 26 additions and 24 deletions

View file

@ -21,6 +21,7 @@
* system will call the name_uninstall() function.
*
*/
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
@ -76,9 +77,9 @@ function geonames_uninstall() {
Logger::log("removed geonames");
}
function geonames_load_config(\Friendica\App $a)
function geonames_load_config(\Friendica\App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__. '/config/geonames.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('geonames'));
}
function geonames_post_hook($a, &$item) {

View file

@ -36,9 +36,9 @@ function gravatar_uninstall() {
Logger::log("unregistered gravatar in avatar_lookup hook");
}
function gravatar_load_config(App $a)
function gravatar_load_config(App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/gravatar.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('gravatar'));
}
/**

View file

@ -52,9 +52,9 @@ function impressum_footer($a, &$b) {
}
}
function impressum_load_config(\Friendica\App $a)
function impressum_load_config(\Friendica\App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/impressum.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('impressum'));
}
function impressum_show($a,&$b) {

View file

@ -53,6 +53,7 @@
*
* ...etc.
*/
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
@ -70,9 +71,9 @@ function ldapauth_uninstall()
Hook::unregister('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate');
}
function ldapauth_load_config(\Friendica\App $a)
function ldapauth_load_config(\Friendica\App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/ldapauth.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('ldapauth'));
}
function ldapauth_hook_authenticate($a, &$b)

View file

@ -36,9 +36,9 @@ function libravatar_uninstall()
Logger::log("unregistered libravatar in avatar_lookup hook");
}
function libravatar_load_config(App $a)
function libravatar_load_config(App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/libravatar.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('libravatar'));
}
/**

View file

@ -8,13 +8,13 @@
* Author: Klaus Weidenbach
*
*/
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Util\Network;
use Friendica\Util\Strings;
@ -47,9 +47,9 @@ function openstreetmap_uninstall()
Logger::log("removed openstreetmap");
}
function openstreetmap_load_config(\Friendica\App $a)
function openstreetmap_load_config(\Friendica\App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/openstreetmap.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('openstreetmap'));
}
function openstreetmap_alterheader($a, &$navHtml)

View file

@ -30,6 +30,7 @@
* about http/https but beware to put the trailing / at the end of your
* setting.
*/
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
@ -51,9 +52,9 @@ function piwik_uninstall() {
Logger::log("uninstalled piwik addon");
}
function piwik_load_config(\Friendica\App $a)
function piwik_load_config(\Friendica\App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/piwik.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('piwik'));
}
function piwik_analytics($a,&$b) {

View file

@ -8,7 +8,6 @@
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
@ -36,9 +35,9 @@ function public_server_uninstall()
Hook::unregister('logged_in', 'addon/public_server/public_server.php', 'public_server_login');
}
function public_server_load_config(App $a)
function public_server_load_config(App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/public_server.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('public_server'));
}
function public_server_register_account($a, $b)

View file

@ -378,9 +378,9 @@ function pumpio_settings_post(App $a, array &$b)
}
}
function pumpio_load_config(App $a)
function pumpio_load_config(App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/pumpio.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('pumpio'));
}
function pumpio_hook_fork(App $a, array &$b)

View file

@ -35,9 +35,9 @@ function testdrive_uninstall() {
}
function testdrive_load_config(App $a)
function testdrive_load_config(App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/testdrive.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('testdrive'));
}
function testdrive_globaldir_update($a,&$b) {

View file

@ -140,9 +140,9 @@ function twitter_uninstall()
Hook::unregister('addon_settings_post', __FILE__, 'twitter_settings_post');
}
function twitter_load_config(App $a)
function twitter_load_config(App $a, Config\ConfigCacheLoader $loader)
{
$a->loadConfigFile(__DIR__ . '/config/twitter.config.php');
$a->getConfig()->loadConfigArray($loader->loadConfigFile('twitter'));
}
function twitter_check_item_notification(App $a, array &$notification_data)