| 1 |
<?php |
| 2 |
namespace EverCompare; |
| 3 |
/** |
| 4 |
* Installer class |
| 5 |
*/ |
| 6 |
class Installer { |
| 7 |
|
| 8 |
/** |
| 9 |
* Run the installer |
| 10 |
* |
| 11 |
* @return void |
| 12 |
*/ |
| 13 |
public function run() { |
| 14 |
$this->add_version(); |
| 15 |
$this->add_redirection_flag(); |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Add time and version on DB |
| 20 |
*/ |
| 21 |
public function add_version() { |
| 22 |
$installed = get_option( 'evercompare_installed' ); |
| 23 |
|
| 24 |
if ( ! $installed ) { |
| 25 |
update_option( 'evercompare_installed', time() ); |
| 26 |
} |
| 27 |
|
| 28 |
update_option( 'evercompare_version', EVERCOMPARE_VERSION ); |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* [add_redirection_flag] redirection flug |
| 33 |
*/ |
| 34 |
public function add_redirection_flag(){ |
| 35 |
add_option( 'evercompare_do_activation_redirect', true ); |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
} |