"Fossies" - the Fresh Open Source Software Archive

Member "matomo/core/Updates/0.2.10.php" (3 Aug 2022, 2500 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\Filesystem;
   13 use Piwik\Updater;
   14 use Piwik\Updates;
   15 use Piwik\Updater\Migration\Factory as MigrationFactory;
   16 
   17 /**
   18  */
   19 class Updates_0_2_10 extends Updates
   20 {
   21     /**
   22      * @var MigrationFactory
   23      */
   24     private $migration;
   25 
   26     public function __construct(MigrationFactory $factory)
   27     {
   28         $this->migration = $factory;
   29     }
   30 
   31     public function getMigrations(Updater $updater)
   32     {
   33         $tableNotExistsError = Updater\Migration\Db::ERROR_CODE_TABLE_NOT_EXISTS;
   34         return array(
   35             $this->migration->db->createTable('option', array(
   36                 'idoption' => 'BIGINT NOT NULL AUTO_INCREMENT' ,
   37                 'option_name' => 'VARCHAR( 64 ) NOT NULL' ,
   38                 'option_value' => 'LONGTEXT NOT NULL' ,
   39             ), array('idoption', 'option_name')),
   40 
   41             // 0.1.7 [463]
   42             $this->migration->db->changeColumnType('log_visit', 'location_provider', 'VARCHAR( 100 ) DEFAULT NULL'),
   43 
   44             // 0.1.7 [470]
   45             $this->migration->db->changeColumnTypes('logger_api_call', array(
   46                 'parameter_names_default_values' => 'TEXT',
   47                 'parameter_values' => 'TEXT',
   48                 'returned_value' => 'TEXT',
   49             ))->addErrorCodeToIgnore($tableNotExistsError),
   50             $this->migration->db->changeColumnType('logger_error', 'message', 'TEXT')->addErrorCodeToIgnore($tableNotExistsError),
   51             $this->migration->db->changeColumnType('logger_exception', 'message', 'TEXT')->addErrorCodeToIgnore($tableNotExistsError),
   52             $this->migration->db->changeColumnType('logger_message', 'message', 'TEXT')->addErrorCodeToIgnore($tableNotExistsError),
   53 
   54             // 0.2.2 [489]
   55             $this->migration->db->changeColumnType('site', 'feedburnerName', 'VARCHAR( 100 ) DEFAULT NULL'),
   56         );
   57     }
   58 
   59     public function doUpdate(Updater $updater)
   60     {
   61         $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
   62 
   63         $obsoleteDirectories = array(
   64             '/plugins/AdminHome',
   65             '/plugins/Home',
   66             '/plugins/PluginsAdmin',
   67         );
   68         foreach ($obsoleteDirectories as $dir) {
   69             if (file_exists(PIWIK_INCLUDE_PATH . $dir)) {
   70                 Filesystem::unlinkRecursive(PIWIK_INCLUDE_PATH . $dir, true);
   71             }
   72         }
   73     }
   74 }