Replace PostUpdate key-value config entries with key-value pair entries

This commit is contained in:
Philipp 2022-12-29 20:18:13 +01:00
parent 47764387b3
commit 10f8631cd9
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
11 changed files with 112 additions and 101 deletions

View file

@ -22,7 +22,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs;
use Friendica\Core\L10n;
use Friendica\Core\Update;
@ -38,9 +38,9 @@ class PostUpdate extends \Asika\SimpleConsole\Console
*/
private $appMode;
/**
* @var IManageConfigValues
* @var ICanManageKeyValuePairs
*/
private $config;
private $keyValue;
/**
* @var L10n
*/
@ -60,13 +60,13 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, IManageConfigValues $config, L10n $l10n, array $argv = null)
public function __construct(App\Mode $appMode, ICanManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null)
{
parent::__construct($argv);
$this->appMode = $appMode;
$this->config = $config;
$this->l10n = $l10n;
$this->appMode = $appMode;
$this->keyValue = $keyValue;
$this->l10n = $l10n;
}
protected function doExecute(): int
@ -83,7 +83,7 @@ HELP;
$this->out($this->getHelp());
return 0;
} elseif ($reset_version) {
$this->config->set('system', 'post_update_version', $reset_version);
$this->keyValue->set('post_update_version', $reset_version);
echo $this->l10n->t('Post update version number has been set to %s.', $reset_version) . "\n";
return 0;
}