| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) exit; |
| 3 |
if (!class_exists('WPCOMWPCli')) : |
| 4 |
|
| 5 |
require_once dirname( __FILE__ ) . '/recover.php'; |
| 6 |
|
| 7 |
class WPCOMWPCli { |
| 8 |
public $settings; |
| 9 |
public $siteinfo; |
| 10 |
public $bvinfo; |
| 11 |
public $bvapi; |
| 12 |
|
| 13 |
public function __construct($settings, $bvinfo, $bvsiteinfo, $bvapi) { |
| 14 |
$this->settings = $settings; |
| 15 |
$this->siteinfo = $bvsiteinfo; |
| 16 |
$this->bvinfo = $bvinfo; |
| 17 |
$this->bvapi = $bvapi; |
| 18 |
} |
| 19 |
|
| 20 |
public function get_connection_key() { |
| 21 |
WP_CLI::line($this->bvinfo->getConnectionKey()); |
| 22 |
} |
| 23 |
|
| 24 |
public function refresh_connection_key() { |
| 25 |
WPCOMRecover::refreshDefaultSecret($this->settings); |
| 26 |
WP_CLI::success('Key Refreshed Successfully.'); |
| 27 |
} |
| 28 |
|
| 29 |
} |
| 30 |
endif; |