| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* E2pdf License Model |
| 5 |
* |
| 6 |
* @copyright Copyright 2017 https://e2pdf.com |
| 7 |
* @license GPL v2 |
| 8 |
* @version 1 |
| 9 |
* @link https://e2pdf.com |
| 10 |
* @since 0.00.01 |
| 11 |
*/ |
| 12 |
if (!defined('ABSPATH')) { |
| 13 |
die('Access denied.'); |
| 14 |
} |
| 15 |
|
| 16 |
class Model_E2pdf_License extends Model_E2pdf_Model { |
| 17 |
|
| 18 |
private $license; |
| 19 |
|
| 20 |
function __construct() { |
| 21 |
parent::__construct(); |
| 22 |
$this->load_license(); |
| 23 |
} |
| 24 |
|
| 25 |
public function get($key) { |
| 26 |
|
| 27 |
if (isset($this->license[$key])) { |
| 28 |
return $this->license[$key]; |
| 29 |
} else { |
| 30 |
return false; |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
public function load_license() { |
| 35 |
$model_e2pdf_api = new Model_E2pdf_Api; |
| 36 |
$model_e2pdf_api->set(array( |
| 37 |
'action' => 'license/info', |
| 38 |
)); |
| 39 |
$license = $model_e2pdf_api->request(); |
| 40 |
$this->license = $license; |
| 41 |
} |
| 42 |
|
| 43 |
} |
| 44 |
|