"Fossies" - the Fresh Open Source Software Archive

Member "matomo/core/Updates/1.6-b1.php" (3 Aug 2022, 1979 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\Updater;
   13 use Piwik\Updates;
   14 use Piwik\Updater\Migration\Factory as MigrationFactory;
   15 
   16 /**
   17  */
   18 class Updates_1_6_b1 extends Updates
   19 {
   20     /**
   21      * @var MigrationFactory
   22      */
   23     private $migration;
   24 
   25     public function __construct(MigrationFactory $factory)
   26     {
   27         $this->migration = $factory;
   28     }
   29 
   30     public function getMigrations(Updater $updater)
   31     {
   32         $idActionType = 'INTEGER(10) UNSIGNED NOT NULL';
   33         $customVarType = 'VARCHAR(200) DEFAULT NULL';
   34 
   35         $customVarColumns = array(
   36             'custom_var_k1' => $customVarType,
   37             'custom_var_v1' => $customVarType,
   38             'custom_var_k2' => $customVarType,
   39             'custom_var_v2' => $customVarType,
   40             'custom_var_k3' => $customVarType,
   41             'custom_var_v3' => $customVarType,
   42             'custom_var_k4' => $customVarType,
   43             'custom_var_v4' => $customVarType,
   44             'custom_var_k5' => $customVarType,
   45             'custom_var_v5' => $customVarType,
   46         );
   47 
   48         return array(
   49             $this->migration->db->addColumns('log_conversion_item', array(
   50                 'idaction_category2' => $idActionType,
   51                 'idaction_category3' => $idActionType,
   52                 'idaction_category4' => $idActionType,
   53                 'idaction_category5' => $idActionType,
   54             ), 'idaction_category'),
   55             $this->migration->db->changeColumnTypes('log_visit', $customVarColumns),
   56             $this->migration->db->changeColumnTypes('log_conversion', $customVarColumns),
   57             $this->migration->db->changeColumnTypes('log_link_visit_action', $customVarColumns),
   58         );
   59     }
   60 
   61     public function doUpdate(Updater $updater)
   62     {
   63         $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
   64     }
   65 }