aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Updater.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/Updater.php')
-rw-r--r--application/Updater.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/application/Updater.php b/application/Updater.php
index 0702158a..bc859536 100644
--- a/application/Updater.php
+++ b/application/Updater.php
@@ -73,7 +73,7 @@ class Updater
73 } 73 }
74 74
75 if ($this->methods === null) { 75 if ($this->methods === null) {
76 throw new UpdaterException('Couldn\'t retrieve Updater class methods.'); 76 throw new UpdaterException(t('Couldn\'t retrieve Updater class methods.'));
77 } 77 }
78 78
79 foreach ($this->methods as $method) { 79 foreach ($this->methods as $method) {
@@ -398,7 +398,7 @@ class Updater
398 */ 398 */
399 public function updateMethodCheckUpdateRemoteBranch() 399 public function updateMethodCheckUpdateRemoteBranch()
400 { 400 {
401 if (shaarli_version === 'dev' || $this->conf->get('updates.check_updates_branch') === 'latest') { 401 if (SHAARLI_VERSION === 'dev' || $this->conf->get('updates.check_updates_branch') === 'latest') {
402 return true; 402 return true;
403 } 403 }
404 404
@@ -413,7 +413,7 @@ class Updater
413 $latestMajor = $matches[1]; 413 $latestMajor = $matches[1];
414 414
415 // Get current major version digit 415 // Get current major version digit
416 preg_match('/(\d+)\.\d+$/', shaarli_version, $matches); 416 preg_match('/(\d+)\.\d+$/', SHAARLI_VERSION, $matches);
417 $currentMajor = $matches[1]; 417 $currentMajor = $matches[1];
418 418
419 if ($currentMajor === $latestMajor) { 419 if ($currentMajor === $latestMajor) {
@@ -490,7 +490,7 @@ class UpdaterException extends Exception
490 } 490 }
491 491
492 if (! empty($this->method)) { 492 if (! empty($this->method)) {
493 $out .= 'An error occurred while running the update '. $this->method . PHP_EOL; 493 $out .= t('An error occurred while running the update ') . $this->method . PHP_EOL;
494 } 494 }
495 495
496 if (! empty($this->previous)) { 496 if (! empty($this->previous)) {
@@ -530,11 +530,11 @@ function read_updates_file($updatesFilepath)
530function write_updates_file($updatesFilepath, $updates) 530function write_updates_file($updatesFilepath, $updates)
531{ 531{
532 if (empty($updatesFilepath)) { 532 if (empty($updatesFilepath)) {
533 throw new Exception('Updates file path is not set, can\'t write updates.'); 533 throw new Exception(t('Updates file path is not set, can\'t write updates.'));
534 } 534 }
535 535
536 $res = file_put_contents($updatesFilepath, implode(';', $updates)); 536 $res = file_put_contents($updatesFilepath, implode(';', $updates));
537 if ($res === false) { 537 if ($res === false) {
538 throw new Exception('Unable to write updates in '. $updatesFilepath . '.'); 538 throw new Exception(t('Unable to write updates in '. $updatesFilepath . '.'));
539 } 539 }
540} 540}