diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-02 12:12:19 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-02 21:53:36 -0600 |
commit | 0b12eb06403687d700fdcfc130f3dcc7164518ea (patch) | |
tree | 0e682ff568a92e8af82d5eeb182480b33fa0bc75 /lib/private/Repair | |
parent | 53195b156c68082f1e02e45ba2a266c15ef1bcaa (diff) | |
download | nextcloud-server-0b12eb06403687d700fdcfc130f3dcc7164518ea.tar.gz nextcloud-server-0b12eb06403687d700fdcfc130f3dcc7164518ea.zip |
Execute UpdateLanguageCode only once
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Repair')
-rw-r--r-- | lib/private/Repair/NC12/UpdateLanguageCodes.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/Repair/NC12/UpdateLanguageCodes.php b/lib/private/Repair/NC12/UpdateLanguageCodes.php index ed65a5cbbe3..69f06df83e9 100644 --- a/lib/private/Repair/NC12/UpdateLanguageCodes.php +++ b/lib/private/Repair/NC12/UpdateLanguageCodes.php @@ -23,6 +23,7 @@ namespace OC\Repair\NC12; +use OCP\IConfig; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; @@ -31,11 +32,16 @@ class UpdateLanguageCodes implements IRepairStep { /** @var IDBConnection */ private $connection; + /** @var IConfig */ + private $config; + /** * @param IDBConnection $db */ - public function __construct(IDBConnection $connection) { + public function __construct(IDBConnection $connection, + IConfig $config) { $this->connection = $connection; + $this->config = $config; } /** @@ -49,6 +55,13 @@ class UpdateLanguageCodes implements IRepairStep { * {@inheritdoc} */ public function run(IOutput $output) { + + $versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0'); + + if (version_compare($versionFromBeforeUpdate, '12.0.0.13', '>')) { + return; + } + $languages = [ 'bg_BG' => 'bg', 'cs_CZ' => 'cs', |