]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/Updater.php
Merge pull request #779 from ArthurHoaro/feature/import-parser-logs
[github/shaarli/Shaarli.git] / application / Updater.php
index f5ebf31af9bf29211354a6111abd0380c0407953..fd7e2073089eaca16a51fee881a1a68b45cc05df 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+use Shaarli\Config\ConfigJson;
+use Shaarli\Config\ConfigPhp;
+use Shaarli\Config\ConfigManager;
 
 /**
  * Class Updater.
@@ -361,6 +364,22 @@ class Updater
 
         return true;
     }
+
+    /**
+     * Add 'http://' to Piwik URL the setting is set.
+     *
+     * @return bool true if the update is successful, false otherwise.
+     */
+    public function updateMethodPiwikUrl()
+    {
+        if (! $this->conf->exists('plugins.PIWIK_URL') || startsWith($this->conf->get('plugins.PIWIK_URL'), 'http')) {
+            return true;
+        }
+
+        $this->conf->set('plugins.PIWIK_URL', 'http://'. $this->conf->get('plugins.PIWIK_URL'));
+        $this->conf->write($this->isLoggedIn);
+        return true;
+    }
 }
 
 /**