3.12.0-b1.php
5 years ago
3.12.0-b7.php
5 years ago
4.0.0-b1.php
4 years ago
4.0.0-b3.php
4 years ago
4.0.0-rc3.php
4 years ago
4.0.0-rc4.php
4 years ago
4.0.1-b1.php
4 years ago
4.0.4-b1.php
4 years ago
4.1.2-b1.php
5 years ago
4.1.2-b2.php
4 years ago
4.10.0-b1.php
3 years ago
4.11.0-b1.php
3 years ago
4.11.0-rc2.php
3 years ago
4.12.0-b1.php
3 years ago
4.12.0-b2.php
3 years ago
4.12.0-b3.php
3 years ago
4.12.0-b4.php
3 years ago
4.3.0-b3.php
4 years ago
4.3.0-b4.php
4 years ago
4.3.0-rc2.php
4 years ago
4.4.0-b1.php
4 years ago
4.5.0-b1.php
4 years ago
4.6.0-b1.php
4 years ago
4.6.0-b4.php
4 years ago
4.6.2-rc2.php
4 years ago
4.7.0-b2.php
4 years ago
4.7.1-b1.php
4 years ago
5.0.0-b1.php
4 years ago
4.10.0-b1.php
62 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | * |
| 9 | */ |
| 10 | |
| 11 | namespace Piwik\Updates; |
| 12 | |
| 13 | use Piwik\Common; |
| 14 | use Piwik\Db; |
| 15 | use Piwik\Updater; |
| 16 | use Piwik\Updates as PiwikUpdates; |
| 17 | use Piwik\Updater\Migration; |
| 18 | use Piwik\Updater\Migration\Factory as MigrationFactory; |
| 19 | |
| 20 | /** |
| 21 | * Update for version 4.10.0-b1 |
| 22 | */ |
| 23 | class Updates_4_10_0_b1 extends PiwikUpdates |
| 24 | { |
| 25 | /** |
| 26 | * @var MigrationFactory |
| 27 | */ |
| 28 | private $migration; |
| 29 | |
| 30 | public function __construct(MigrationFactory $factory) |
| 31 | { |
| 32 | $this->migration = $factory; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @param Updater $updater |
| 37 | * |
| 38 | * @return Migration[] |
| 39 | */ |
| 40 | public function getMigrations(Updater $updater) |
| 41 | { |
| 42 | $table = Common::prefixTable('report'); |
| 43 | $invalidCount = Db::fetchOne( |
| 44 | "SELECT COUNT(*) FROM $table WHERE reports = ? OR parameters = ?", |
| 45 | ['Array', 'Array'] |
| 46 | ); |
| 47 | |
| 48 | if (0 === (int) $invalidCount) { |
| 49 | return []; |
| 50 | } |
| 51 | |
| 52 | return [ |
| 53 | $this->migration->db->sql("DELETE FROM " . $table . " WHERE reports = 'Array' OR parameters = 'Array'"), |
| 54 | ]; |
| 55 | } |
| 56 | |
| 57 | public function doUpdate(Updater $updater) |
| 58 | { |
| 59 | $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); |
| 60 | } |
| 61 | } |
| 62 |