| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* E2pdf Files Helper |
| 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 Helper_E2pdf_Files { |
| 17 |
|
| 18 |
private $files = array(); |
| 19 |
|
| 20 |
/** |
| 21 |
* On init |
| 22 |
* Assign $_FILES array to $files |
| 23 |
*/ |
| 24 |
public function __construct() { |
| 25 |
$this->files = $_FILES; |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Get value from $_FILES |
| 30 |
* |
| 31 |
* @param string $key - Array key |
| 32 |
* |
| 33 |
* @return mixed |
| 34 |
*/ |
| 35 |
public function get($key) { |
| 36 |
|
| 37 |
if (!$key) { |
| 38 |
if (!empty($this->files)) { |
| 39 |
return $this->files; |
| 40 |
} else { |
| 41 |
return false; |
| 42 |
} |
| 43 |
} else { |
| 44 |
|
| 45 |
if (isset($this->files[$key])) { |
| 46 |
return $this->files[$key]; |
| 47 |
} else { |
| 48 |
return null; |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
} |
| 54 |
|