PerformanceUpgrade.php
5 years ago
TransientsUpgrade.php
5 years ago
Upgrades.php
5 years ago
VisitsUpgrade.php
5 years ago
PerformanceUpgrade.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | namespace PrestoPlayer\Database\Upgrades; |
| 4 | |
| 5 | use PrestoPlayer\Models\Setting; |
| 6 | |
| 7 | class PerformanceUpgrade |
| 8 | { |
| 9 | protected $name = 'presto_player_pro_update_performance'; |
| 10 | |
| 11 | public function migrate() |
| 12 | { |
| 13 | if (get_option($this->name, false)) { |
| 14 | return; |
| 15 | } |
| 16 | |
| 17 | // plugin has not yet been installed, default to off |
| 18 | if (!get_option("presto_player_visits_database_version", 0)) { |
| 19 | update_option($this->name, true, 'no'); |
| 20 | return; |
| 21 | } |
| 22 | |
| 23 | // turn on setting if not yet set |
| 24 | Setting::set('performance', 'module_enabled', true); |
| 25 | |
| 26 | update_option($this->name, true, 'no'); |
| 27 | } |
| 28 | } |
| 29 |