OSInet /
qa
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * @file |
||||
| 4 | * Variable.php |
||||
| 5 | * |
||||
| 6 | * @author: Frédéric G. MARAND <[email protected]> |
||||
| 7 | * |
||||
| 8 | * @copyright (c) 2014 Ouest Systèmes Informatiques (OSInet). |
||||
| 9 | * |
||||
| 10 | * @license General Public License version 2 or later |
||||
| 11 | */ |
||||
| 12 | |||||
| 13 | namespace Drupal\qa; |
||||
| 14 | |||||
| 15 | |||||
| 16 | class Variable { |
||||
| 17 | public $is_set; |
||||
| 18 | public $name; |
||||
| 19 | public $value; |
||||
| 20 | public $default; |
||||
| 21 | |||||
| 22 | public function __construct($name) { |
||||
| 23 | $this->name = $name; |
||||
| 24 | $this->is_set = isset($GLOBALS['conf'][$name]); |
||||
| 25 | if ($this->is_set) { |
||||
| 26 | $this->value = $GLOBALS['conf'][$name]; |
||||
| 27 | } |
||||
| 28 | |||||
| 29 | if (function_exists('variable_get_default')) { |
||||
| 30 | $this->default = variable_get_default($name); |
||||
| 31 | } |
||||
| 32 | } |
||||
| 33 | |||||
| 34 | public function dump() { |
||||
| 35 | return kprint_r($this->value, TRUE, $this->name); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 36 | } |
||||
| 37 | |||||
| 38 | public function link() { |
||||
| 39 | return l($this->name, "/admin/reports/qa/variable/{$this->name}"); |
||||
|
0 ignored issues
–
show
The function
l was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 40 | } |
||||
| 41 | } |
||||
| 42 |