| 1 |
<?php |
| 2 |
|
| 3 |
namespace Hostinger; |
| 4 |
|
| 5 |
use Hostinger\Bootstrap; |
| 6 |
|
| 7 |
defined( 'ABSPATH' ) || exit; |
| 8 |
|
| 9 |
class Hostinger { |
| 10 |
protected string $plugin_name = 'Hostinger'; |
| 11 |
protected string $version; |
| 12 |
|
| 13 |
public function bootstrap(): void { |
| 14 |
$this->version = $this->get_plugin_version(); |
| 15 |
$bootstrap = new Bootstrap(); |
| 16 |
$bootstrap->run(); |
| 17 |
} |
| 18 |
|
| 19 |
public function run(): void { |
| 20 |
$this->bootstrap(); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Define constant |
| 25 |
* |
| 26 |
* @param string $name Constant name. |
| 27 |
* @param string|bool $value Constant value. |
| 28 |
*/ |
| 29 |
private function define( string $name, $value ): void { |
| 30 |
if ( ! defined( $name ) ) { |
| 31 |
define( $name, $value ); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
private function get_plugin_version(): string { |
| 36 |
if ( defined( 'HOSTINGER_VERSION' ) ) { |
| 37 |
return HOSTINGER_VERSION; |
| 38 |
} |
| 39 |
|
| 40 |
return '1.0.0'; |
| 41 |
} |
| 42 |
} |
| 43 |
|