"Fossies" - the Fresh Open Source Software Archive

Member "matomo/core/Updates/1.1.php" (3 Aug 2022, 1015 Bytes) of package /linux/www/matomo-4.11.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 /**
    3  * Matomo - free/libre analytics platform
    4  *
    5  * @link https://matomo.org
    6  * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
    7  *
    8  */
    9 
   10 namespace Piwik\Updates;
   11 
   12 use Piwik\Config;
   13 use Piwik\Piwik;
   14 use Piwik\Updates;
   15 use Piwik\Updater;
   16 
   17 /**
   18  */
   19 class Updates_1_1 extends Updates
   20 {
   21     public function doUpdate(Updater $updater)
   22     {
   23         $config = Config::getInstance();
   24 
   25         try {
   26             $superuser = $config->superuser;
   27         } catch (\Exception $e) {
   28             return;
   29         }
   30 
   31         if (empty($superuser['login'])) {
   32             return;
   33         }
   34 
   35         $rootLogin = $superuser['login'];
   36         try {
   37             // throws an exception if invalid
   38             Piwik::checkValidLoginString($rootLogin);
   39         } catch (\Exception $e) {
   40             throw new \Exception('Superuser login name "' . $rootLogin . '" is no longer a valid format. '
   41                 . $e->getMessage()
   42                 . ' Edit your config/config.ini.php to change it.');
   43         }
   44     }
   45 }