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.0.0-b3.php
61 lines
| 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\Updater; |
| 14 | use Piwik\Updates as PiwikUpdates; |
| 15 | use Piwik\Updater\Migration\Factory as MigrationFactory; |
| 16 | |
| 17 | /** |
| 18 | * Update for version 4.0.0-b3. |
| 19 | */ |
| 20 | class Updates_4_0_0_b3 extends PiwikUpdates |
| 21 | { |
| 22 | /** |
| 23 | * @var MigrationFactory |
| 24 | */ |
| 25 | private $migration; |
| 26 | |
| 27 | public function __construct(MigrationFactory $factory) |
| 28 | { |
| 29 | $this->migration = $factory; |
| 30 | } |
| 31 | |
| 32 | public function getMigrations(Updater $updater) |
| 33 | { |
| 34 | $migrations = []; |
| 35 | |
| 36 | $config = Config::getInstance(); |
| 37 | $general = $config->General; |
| 38 | if (empty($general['login_whitelist_apply_to_reporting_api_requests'])) { |
| 39 | $migrations[] = $this->migration->config->set('General', 'login_allowlist_apply_to_reporting_api_requests', '0'); |
| 40 | } |
| 41 | |
| 42 | return $migrations; |
| 43 | } |
| 44 | |
| 45 | public function doUpdate(Updater $updater) |
| 46 | { |
| 47 | $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); |
| 48 | |
| 49 | $config = Config::getInstance(); |
| 50 | $general = $config->General; |
| 51 | if (!empty($general['login_whitelist_ip'])) { |
| 52 | // the migration->config->set does not support arrays yet so we do it here. |
| 53 | $general['login_allowlist_ip'] = $general['login_whitelist_ip']; |
| 54 | $config->General = $general; |
| 55 | $config->forceSave(); |
| 56 | } |
| 57 | |
| 58 | } |
| 59 | |
| 60 | } |
| 61 |