Move Config::get() to DI::config()->get()

This commit is contained in:
nupplaPhil 2020-01-19 21:21:12 +01:00
parent c67ad31c8b
commit 1ce63185ab
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
38 changed files with 342 additions and 342 deletions

View file

@ -24,31 +24,31 @@ function mailstream_install() {
Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Hook::register('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron');
if (Config::get('mailstream', 'dbversion') == '0.1') {
if (DI::config()->get('mailstream', 'dbversion') == '0.1') {
q('ALTER TABLE `mailstream_item` DROP INDEX `uid`');
q('ALTER TABLE `mailstream_item` DROP INDEX `contact-id`');
q('ALTER TABLE `mailstream_item` DROP INDEX `plink`');
q('ALTER TABLE `mailstream_item` CHANGE `plink` `uri` char(255) NOT NULL');
Config::set('mailstream', 'dbversion', '0.2');
}
if (Config::get('mailstream', 'dbversion') == '0.2') {
if (DI::config()->get('mailstream', 'dbversion') == '0.2') {
q('DELETE FROM `pconfig` WHERE `cat` = "mailstream" AND `k` = "delay"');
Config::set('mailstream', 'dbversion', '0.3');
}
if (Config::get('mailstream', 'dbversion') == '0.3') {
if (DI::config()->get('mailstream', 'dbversion') == '0.3') {
q('ALTER TABLE `mailstream_item` CHANGE `created` `created` timestamp NOT NULL DEFAULT now()');
q('ALTER TABLE `mailstream_item` CHANGE `completed` `completed` timestamp NULL DEFAULT NULL');
Config::set('mailstream', 'dbversion', '0.4');
}
if (Config::get('mailstream', 'dbversion') == '0.4') {
if (DI::config()->get('mailstream', 'dbversion') == '0.4') {
q('ALTER TABLE `mailstream_item` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin');
Config::set('mailstream', 'dbversion', '0.5');
}
if (Config::get('mailstream', 'dbversion') == '0.5') {
if (DI::config()->get('mailstream', 'dbversion') == '0.5') {
Config::set('mailstream', 'dbversion', '1.0');
}
if (Config::get('retriever', 'dbversion') != '1.0') {
if (DI::config()->get('retriever', 'dbversion') != '1.0') {
$schema = file_get_contents(dirname(__file__).'/database.sql');
$arr = explode(';', $schema);
foreach ($arr as $a) {
@ -74,7 +74,7 @@ function mailstream_uninstall() {
function mailstream_module() {}
function mailstream_addon_admin(&$a,&$o) {
$frommail = Config::get('mailstream', 'frommail');
$frommail = DI::config()->get('mailstream', 'frommail');
$template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/');
$config = ['frommail',
DI::l10n()->t('From Address'),
@ -276,7 +276,7 @@ function mailstream_send(\Friendica\App $a, $message_id, $item, $user) {
$attachments = [];
mailstream_do_images($a, $item, $attachments);
$frommail = Config::get('mailstream', 'frommail');
$frommail = DI::config()->get('mailstream', 'frommail');
if ($frommail == "") {
$frommail = 'friendica@localhost.local';
}