1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Modules\Informer\Handler { |
4
|
|
|
|
5
|
|
|
use Frames, Modules\Informer, Utils\Validate, Utils\View, Language, Template; |
6
|
|
|
|
7
|
|
|
class Information extends Frames\Admin\Area\Authorized { |
8
|
|
|
|
9
|
|
|
protected $title = 'TITLE_SYSTEM_INFORMATION'; |
10
|
|
|
|
11
|
|
|
# Get boolean value for php configuration |
12
|
|
|
|
13
|
|
|
private function getBooleanValue(string $value) { |
14
|
|
|
|
15
|
|
|
return (Validate::boolean($value) ? 'On' : 'Off'); |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
# Process debug mode block |
19
|
|
|
|
20
|
|
|
private function processDebugMode(Template\Block $debug_mode) { |
21
|
|
|
|
22
|
|
|
if (DEBUG_MODE) { |
23
|
|
|
|
24
|
|
|
$debug_mode->class = 'red'; |
|
|
|
|
25
|
|
|
|
26
|
|
|
$debug_mode->text = Language::get('INFORMATION_VALUE_DEBUG_MODE_ON'); |
|
|
|
|
27
|
|
|
|
28
|
|
|
} else { |
29
|
|
|
|
30
|
|
|
$debug_mode->class = ''; |
|
|
|
|
31
|
|
|
|
32
|
|
|
$debug_mode->text = Language::get('INFORMATION_VALUE_DEBUG_MODE_OFF'); |
|
|
|
|
33
|
|
|
} |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
# Get contents |
37
|
|
|
|
38
|
|
|
private function getContents() { |
39
|
|
|
|
40
|
|
|
$contents = View::get('Blocks/Informer/Information'); |
41
|
|
|
|
42
|
|
|
# Set server entries |
43
|
|
|
|
44
|
|
|
$contents->os_version = Informer::osVersion(); |
45
|
|
|
|
46
|
|
|
$contents->php_version = phpversion(); |
47
|
|
|
|
48
|
|
|
$contents->mysql_version = Informer::mysqlVersion(); |
49
|
|
|
|
50
|
|
|
# Set system entries |
51
|
|
|
|
52
|
|
|
$contents->system_version = CADMIUM_VERSION; |
53
|
|
|
|
54
|
|
|
# Set external entries |
55
|
|
|
|
56
|
|
|
$contents->jquery_version = JQUERY_VERSION; |
57
|
|
|
|
58
|
|
|
$contents->semantic_ui_version = SEMANTIC_UI_VERSION; |
59
|
|
|
|
60
|
|
|
$contents->ckeditor_version = CKEDITOR_VERSION; |
61
|
|
|
|
62
|
|
|
# Set php entries |
63
|
|
|
|
64
|
|
|
$contents->php_display_errors = $this->getBooleanValue(ini_get('display_errors')); |
65
|
|
|
|
66
|
|
|
$contents->php_display_startup_errors = $this->getBooleanValue(ini_get('display_startup_errors')); |
67
|
|
|
|
68
|
|
|
$contents->php_file_uploads = $this->getBooleanValue(ini_get('file_uploads')); |
69
|
|
|
|
70
|
|
|
$contents->php_upload_max_filesize = ini_get('upload_max_filesize'); |
71
|
|
|
|
72
|
|
|
$contents->php_post_max_size = ini_get('post_max_size'); |
73
|
|
|
|
74
|
|
|
# Set debug mode |
75
|
|
|
|
76
|
|
|
$this->processDebugMode($contents->getBlock('debug_mode')); |
77
|
|
|
|
78
|
|
|
# ------------------------ |
79
|
|
|
|
80
|
|
|
return $contents; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
# Handle request |
84
|
|
|
|
85
|
|
|
protected function handle() { |
86
|
|
|
|
87
|
|
|
return $this->getContents(); |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
} |
91
|
|
|
|
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.