| 1 |
<?php |
| 2 |
|
| 3 |
class Brizy_Admin_Cloud { |
| 4 |
|
| 5 |
/** |
| 6 |
* @var Brizy_Editor_Project |
| 7 |
*/ |
| 8 |
private $project; |
| 9 |
|
| 10 |
/** |
| 11 |
* @var Brizy_Admin_Cloud_Client |
| 12 |
*/ |
| 13 |
private $cloudClient; |
| 14 |
|
| 15 |
|
| 16 |
/** |
| 17 |
* @return Brizy_Admin_Cloud |
| 18 |
* @throws Exception |
| 19 |
*/ |
| 20 |
public static function _init() { |
| 21 |
|
| 22 |
static $instance; |
| 23 |
|
| 24 |
return $instance ? $instance : $instance = new self( Brizy_Editor_Project::get() ); |
| 25 |
} |
| 26 |
|
| 27 |
/** |
| 28 |
* Brizy_Admin_Cloud constructor. |
| 29 |
* |
| 30 |
* @param Brizy_Editor_Project $project |
| 31 |
* |
| 32 |
* @throws Exception |
| 33 |
*/ |
| 34 |
private function __construct( Brizy_Editor_Project $project ) { |
| 35 |
|
| 36 |
$this->project = $project; |
| 37 |
$this->cloudClient = Brizy_Admin_Cloud_Client::instance( $project, new WP_Http() ); |
| 38 |
|
| 39 |
add_action( 'wp_loaded', array( $this, 'initializeActions' ) ); |
| 40 |
} |
| 41 |
|
| 42 |
public function initializeActions() { |
| 43 |
Brizy_Admin_Cloud_Api::_init( $this->project ); |
| 44 |
} |
| 45 |
} |
| 46 |
|