Browse Source

Major rework on formatting, sonar integration, cleanups

Kai Kretschmann 9 months ago
parent
commit
a79b951536

+ 4
- 0
.buildpath View File

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<buildpath>
3
+	<buildpathentry kind="src" path=""/>
4
+</buildpath>

+ 4
- 2
.htaccess View File

@@ -1,8 +1,8 @@
1 1
 Options -indexes
2 2
 
3
-Header always set Strict-Transport-Security "max-age=31536000"
3
+#Header always set Strict-Transport-Security "max-age=31536000"
4 4
 
5
-Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; report-uri https://report-uri.io/report/e7e84fa898ae6e0d0e8d70e25cd237c7;"
5
+#Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; report-uri https://report-uri.io/report/e7e84fa898ae6e0d0e8d70e25cd237c7;"
6 6
 
7 7
 <Files stats.php>
8 8
 # Chart.js uses some dynamic functions.
@@ -18,3 +18,5 @@ AuthType	Basic
18 18
 AuthName	"Restricted Area"
19 19
 AuthUserFile	/var/www/webuser
20 20
 Require		valid-user
21
+Require		ip 127.0.0.1
22
+Require		ip ::1

+ 0
- 5
.project View File

@@ -6,11 +6,6 @@
6 6
 	</projects>
7 7
 	<buildSpec>
8 8
 		<buildCommand>
9
-			<name>org.eclipse.php.composer.core.builder.buildPathManagementBuilder</name>
10
-			<arguments>
11
-			</arguments>
12
-		</buildCommand>
13
-		<buildCommand>
14 9
 			<name>org.eclipse.wst.common.project.facet.core.builder</name>
15 10
 			<arguments>
16 11
 			</arguments>

+ 1
- 1
.settings/org.eclipse.php.debug.core.Debug_Process_Preferences.prefs View File

@@ -1,7 +1,7 @@
1 1
 DefaultProjectBasePath=/Lggr
2 2
 eclipse.preferences.version=1
3 3
 org.eclipse.php.debug.core.use-project-settings=true
4
-org.eclipse.php.debug.coredefaultPHP=PHP 7.2.0 (CLI)
4
+org.eclipse.php.debug.coredefaultPHP=PHP 5.6.32 (CLI)
5 5
 org.eclipse.php.debug.coreoutput_encoding=UTF-8
6 6
 org.eclipse.php.debug.corestop_at_first_line_string=true
7 7
 org.eclipse.php.debug.coretransfer_encoding=UTF-8

+ 207
- 0
.settings/org.eclipse.php.formatter.core.prefs View File

@@ -0,0 +1,207 @@
1
+eclipse.preferences.version=1
2
+formatterProfile=_KKRphp
3
+indentationChar=\ 
4
+insert_space_after_opening_paren_in_declare=false
5
+insert_space_before_closing_paren_in_declare=false
6
+insert_space_before_opening_paren_in_declare=false
7
+org.eclipse.php.core.formatter.insert_new_line_in_function_invoke=3
8
+org.eclipse.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_force_split=false
9
+org.eclipse.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_indent_policy=0
10
+org.eclipse.php.formatter.core.formatter.alignment_for_arguments_in_allocation_expression_line_wrap_policy=1
11
+org.eclipse.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_force_split=false
12
+org.eclipse.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_indent_policy=0
13
+org.eclipse.php.formatter.core.formatter.alignment_for_arguments_in_method_invocation_line_wrap_policy=1
14
+org.eclipse.php.formatter.core.formatter.alignment_for_assignment_force_split=false
15
+org.eclipse.php.formatter.core.formatter.alignment_for_assignment_indent_policy=0
16
+org.eclipse.php.formatter.core.formatter.alignment_for_assignment_line_wrap_policy=0
17
+org.eclipse.php.formatter.core.formatter.alignment_for_binary_expression_force_split=false
18
+org.eclipse.php.formatter.core.formatter.alignment_for_binary_expression_indent_policy=0
19
+org.eclipse.php.formatter.core.formatter.alignment_for_binary_expression_line_wrap_policy=1
20
+org.eclipse.php.formatter.core.formatter.alignment_for_compact_if_force_split=false
21
+org.eclipse.php.formatter.core.formatter.alignment_for_compact_if_indent_policy=0
22
+org.eclipse.php.formatter.core.formatter.alignment_for_compact_if_line_wrap_policy=0
23
+org.eclipse.php.formatter.core.formatter.alignment_for_conditional_expression_force_split=false
24
+org.eclipse.php.formatter.core.formatter.alignment_for_conditional_expression_indent_policy=0
25
+org.eclipse.php.formatter.core.formatter.alignment_for_conditional_expression_line_wrap_policy=0
26
+org.eclipse.php.formatter.core.formatter.alignment_for_expressions_in_array_initializer_force_split=true
27
+org.eclipse.php.formatter.core.formatter.alignment_for_expressions_in_array_initializer_indent_policy=0
28
+org.eclipse.php.formatter.core.formatter.alignment_for_expressions_in_array_initializer_line_wrap_policy=3
29
+org.eclipse.php.formatter.core.formatter.alignment_for_parameters_in_method_declaration_force_split=false
30
+org.eclipse.php.formatter.core.formatter.alignment_for_parameters_in_method_declaration_indent_policy=0
31
+org.eclipse.php.formatter.core.formatter.alignment_for_parameters_in_method_declaration_line_wrap_policy=1
32
+org.eclipse.php.formatter.core.formatter.alignment_for_superclass_in_type_declaration_force_split=false
33
+org.eclipse.php.formatter.core.formatter.alignment_for_superclass_in_type_declaration_indent_policy=0
34
+org.eclipse.php.formatter.core.formatter.alignment_for_superclass_in_type_declaration_line_wrap_policy=0
35
+org.eclipse.php.formatter.core.formatter.alignment_for_superinterfaces_in_type_declaration_force_split=false
36
+org.eclipse.php.formatter.core.formatter.alignment_for_superinterfaces_in_type_declaration_indent_policy=0
37
+org.eclipse.php.formatter.core.formatter.alignment_for_superinterfaces_in_type_declaration_line_wrap_policy=1
38
+org.eclipse.php.formatter.core.formatter.blank_lines_before_field=1
39
+org.eclipse.php.formatter.core.formatter.blank_lines_before_member_type=1
40
+org.eclipse.php.formatter.core.formatter.blank_lines_before_method=1
41
+org.eclipse.php.formatter.core.formatter.blank_lines_between_type_declarations=1
42
+org.eclipse.php.formatter.core.formatter.brace_position_for_block=0
43
+org.eclipse.php.formatter.core.formatter.brace_position_for_lambda_function_declaration=0
44
+org.eclipse.php.formatter.core.formatter.brace_position_for_method_declaration=0
45
+org.eclipse.php.formatter.core.formatter.brace_position_for_switch=0
46
+org.eclipse.php.formatter.core.formatter.brace_position_for_type_declaration=0
47
+org.eclipse.php.formatter.core.formatter.comment.clear_blank_lines_in_block_comment=false
48
+org.eclipse.php.formatter.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
49
+org.eclipse.php.formatter.core.formatter.comment.format_block_comments=true
50
+org.eclipse.php.formatter.core.formatter.comment.format_header=false
51
+org.eclipse.php.formatter.core.formatter.comment.format_html=true
52
+org.eclipse.php.formatter.core.formatter.comment.format_javadoc_comments=true
53
+org.eclipse.php.formatter.core.formatter.comment.format_line_comments=true
54
+org.eclipse.php.formatter.core.formatter.comment.format_source_code=true
55
+org.eclipse.php.formatter.core.formatter.comment.indent_parameter_description=true
56
+org.eclipse.php.formatter.core.formatter.comment.indent_root_tags=true
57
+org.eclipse.php.formatter.core.formatter.comment.insert_new_line_before_root_tags=true
58
+org.eclipse.php.formatter.core.formatter.comment.insert_new_line_for_parameter=true
59
+org.eclipse.php.formatter.core.formatter.comment.line_length=9999
60
+org.eclipse.php.formatter.core.formatter.comment.new_lines_at_block_boundaries=true
61
+org.eclipse.php.formatter.core.formatter.comment.new_lines_at_javadoc_boundaries=true
62
+org.eclipse.php.formatter.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
63
+org.eclipse.php.formatter.core.formatter.continuation_indentation=1
64
+org.eclipse.php.formatter.core.formatter.continuation_indentation_for_array_initializer=1
65
+org.eclipse.php.formatter.core.formatter.disabling_tag=@formatter\:off
66
+org.eclipse.php.formatter.core.formatter.enabling_tag=@formatter\:on
67
+org.eclipse.php.formatter.core.formatter.format_guardian_clause_on_one_line=false
68
+org.eclipse.php.formatter.core.formatter.format_line_comment_starting_on_first_column=true
69
+org.eclipse.php.formatter.core.formatter.indent_body_declarations_compare_to_type_header=true
70
+org.eclipse.php.formatter.core.formatter.indent_breaks_compare_to_cases=true
71
+org.eclipse.php.formatter.core.formatter.indent_empty_lines=false
72
+org.eclipse.php.formatter.core.formatter.indent_statements_compare_to_block=true
73
+org.eclipse.php.formatter.core.formatter.indent_statements_compare_to_body=true
74
+org.eclipse.php.formatter.core.formatter.indent_switchstatements_compare_to_cases=true
75
+org.eclipse.php.formatter.core.formatter.indent_switchstatements_compare_to_switch=true
76
+org.eclipse.php.formatter.core.formatter.indentation.size=4
77
+org.eclipse.php.formatter.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=false
78
+org.eclipse.php.formatter.core.formatter.insert_new_line_before_catch_in_try_statement=true
79
+org.eclipse.php.formatter.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=true
80
+org.eclipse.php.formatter.core.formatter.insert_new_line_before_else_in_if_statement=false
81
+org.eclipse.php.formatter.core.formatter.insert_new_line_before_finally_in_try_statement=true
82
+org.eclipse.php.formatter.core.formatter.insert_new_line_before_while_in_do_statement=true
83
+org.eclipse.php.formatter.core.formatter.insert_new_line_in_empty_block=false
84
+org.eclipse.php.formatter.core.formatter.insert_new_line_in_empty_method_body=false
85
+org.eclipse.php.formatter.core.formatter.insert_new_line_in_empty_type_declaration=false
86
+org.eclipse.php.formatter.core.formatter.insert_space_after_arrow_in_array_creation=true
87
+org.eclipse.php.formatter.core.formatter.insert_space_after_arrow_in_field_access=false
88
+org.eclipse.php.formatter.core.formatter.insert_space_after_arrow_in_foreach=true
89
+org.eclipse.php.formatter.core.formatter.insert_space_after_arrow_in_method_invocation=false
90
+org.eclipse.php.formatter.core.formatter.insert_space_after_arrow_in_yield=true
91
+org.eclipse.php.formatter.core.formatter.insert_space_after_assignment_operator=true
92
+org.eclipse.php.formatter.core.formatter.insert_space_after_binary_operator=true
93
+org.eclipse.php.formatter.core.formatter.insert_space_after_closing_brace_in_block=true
94
+org.eclipse.php.formatter.core.formatter.insert_space_after_closing_paren_in_cast=true
95
+org.eclipse.php.formatter.core.formatter.insert_space_after_colon_in_conditional=true
96
+org.eclipse.php.formatter.core.formatter.insert_space_after_coloncolon_in_field_access=false
97
+org.eclipse.php.formatter.core.formatter.insert_space_after_coloncolon_in_method_invocation=false
98
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_array_creation=false
99
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_echo=true
100
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_for_inits=true
101
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_global=true
102
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_list=true
103
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_method_declaration_parameters=true
104
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_method_invocation_arguments=true
105
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_multiple_constant_declarations=true
106
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_multiple_field_declarations=true
107
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_static=true
108
+org.eclipse.php.formatter.core.formatter.insert_space_after_comma_in_superinterfaces=true
109
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_bracket_in_array_reference=false
110
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_array_creation=false
111
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_cast=false
112
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_catch=false
113
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_for=false
114
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_foreach=false
115
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_if=false
116
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_list=false
117
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_method_declaration=false
118
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_method_invocation=false
119
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=false
120
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_switch=false
121
+org.eclipse.php.formatter.core.formatter.insert_space_after_opening_paren_in_while=false
122
+org.eclipse.php.formatter.core.formatter.insert_space_after_postfix_operator=false
123
+org.eclipse.php.formatter.core.formatter.insert_space_after_prefix_operator=true
124
+org.eclipse.php.formatter.core.formatter.insert_space_after_question_in_conditional=true
125
+org.eclipse.php.formatter.core.formatter.insert_space_after_semicolon_in_for=true
126
+org.eclipse.php.formatter.core.formatter.insert_space_after_unary_operator=true
127
+org.eclipse.php.formatter.core.formatter.insert_space_before_arrow_in_array_creation=true
128
+org.eclipse.php.formatter.core.formatter.insert_space_before_arrow_in_field_access=false
129
+org.eclipse.php.formatter.core.formatter.insert_space_before_arrow_in_foreach=true
130
+org.eclipse.php.formatter.core.formatter.insert_space_before_arrow_in_method_invocation=false
131
+org.eclipse.php.formatter.core.formatter.insert_space_before_arrow_in_yield=true
132
+org.eclipse.php.formatter.core.formatter.insert_space_before_assignment_operator=true
133
+org.eclipse.php.formatter.core.formatter.insert_space_before_binary_operator=true
134
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_bracket_in_array_reference=false
135
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_array_creation=false
136
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_cast=false
137
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_catch=false
138
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_for=false
139
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_foreach=false
140
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_if=false
141
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_list=false
142
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_method_declaration=false
143
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_method_invocation=false
144
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=false
145
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_switch=false
146
+org.eclipse.php.formatter.core.formatter.insert_space_before_closing_paren_in_while=false
147
+org.eclipse.php.formatter.core.formatter.insert_space_before_colon_in_case=false
148
+org.eclipse.php.formatter.core.formatter.insert_space_before_colon_in_conditional=true
149
+org.eclipse.php.formatter.core.formatter.insert_space_before_colon_in_default=false
150
+org.eclipse.php.formatter.core.formatter.insert_space_before_coloncolon_in_field_access=false
151
+org.eclipse.php.formatter.core.formatter.insert_space_before_coloncolon_in_method_invocation=false
152
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_array_creation=false
153
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_echo=false
154
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_for_inits=false
155
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_global=false
156
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_list=false
157
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_method_declaration_parameters=false
158
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_method_invocation_arguments=false
159
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_multiple_constant_declarations=false
160
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_multiple_field_declarations=false
161
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_static=false
162
+org.eclipse.php.formatter.core.formatter.insert_space_before_comma_in_superinterfaces=false
163
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_brace_in_block=true
164
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_brace_in_method_declaration=true
165
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_brace_in_switch=true
166
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_brace_in_type_declaration=true
167
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_bracket_in_array_reference=false
168
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_array_creation=false
169
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_catch=true
170
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_for=true
171
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_foreach=true
172
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_if=true
173
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_list=true
174
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_method_declaration=false
175
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_method_invocation=false
176
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_switch=true
177
+org.eclipse.php.formatter.core.formatter.insert_space_before_opening_paren_in_while=true
178
+org.eclipse.php.formatter.core.formatter.insert_space_before_postfix_operator=true
179
+org.eclipse.php.formatter.core.formatter.insert_space_before_prefix_operator=false
180
+org.eclipse.php.formatter.core.formatter.insert_space_before_question_in_conditional=true
181
+org.eclipse.php.formatter.core.formatter.insert_space_before_semicolon=false
182
+org.eclipse.php.formatter.core.formatter.insert_space_before_semicolon_in_for=false
183
+org.eclipse.php.formatter.core.formatter.insert_space_before_unary_operator=false
184
+org.eclipse.php.formatter.core.formatter.insert_space_between_brackets_in_array_type_reference=false
185
+org.eclipse.php.formatter.core.formatter.insert_space_between_empty_parens_in_method_declaration=false
186
+org.eclipse.php.formatter.core.formatter.insert_space_between_empty_parens_in_method_invocation=false
187
+org.eclipse.php.formatter.core.formatter.join_lines_in_comments=true
188
+org.eclipse.php.formatter.core.formatter.keep_else_statement_on_same_line=false
189
+org.eclipse.php.formatter.core.formatter.keep_elseif_statement_on_same_line=true
190
+org.eclipse.php.formatter.core.formatter.keep_imple_if_on_one_line=false
191
+org.eclipse.php.formatter.core.formatter.keep_then_statement_on_same_line=false
192
+org.eclipse.php.formatter.core.formatter.lineSplit=80
193
+org.eclipse.php.formatter.core.formatter.never_indent_block_comments_on_first_column=false
194
+org.eclipse.php.formatter.core.formatter.never_indent_line_comments_on_first_column=false
195
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_after_namespace=1
196
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_after_use_statements=0
197
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
198
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_at_end_of_class_body=0
199
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_at_end_of_method_body=0
200
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_before_namespace=0
201
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_before_use_statements=0
202
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_between_namespaces=1
203
+org.eclipse.php.formatter.core.formatter.number_of_blank_lines_between_use_statements=0
204
+org.eclipse.php.formatter.core.formatter.number_of_empty_lines_to_preserve=1
205
+org.eclipse.php.formatter.core.formatter.put_empty_statement_on_new_line=false
206
+org.eclipse.php.formatter.core.formatter.tabulation.size=4
207
+org.eclipse.php.formatter.core.formatter.use_on_off_tags=true

+ 5
- 0
.settings/org.eclipse.php.ui.prefs View File

@@ -1,2 +1,7 @@
1
+cleanup.format.on.save=false
2
+cleanup.organize.on.save=false
3
+cleanup.remove_trailing_whitespaces=true
4
+cleanup.remove_trailing_whitespaces_all=false
5
+cleanup.remove_trailing_whitespaces_ignore_empty=true
1 6
 eclipse.preferences.version=1
2 7
 org.eclipse.php.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>

+ 4
- 5
.settings/org.eclipse.wst.common.project.facet.core.xml View File

@@ -1,8 +1,7 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <faceted-project>
3
-  <fixed facet="php.core.component"/>
4
-  <fixed facet="php.component"/>
5
-  <installed facet="php.core.component" version="1"/>
6
-  <installed facet="php.component" version="7.1"/>
7
-  <installed facet="php.composer.component" version="1"/>
3
+	<fixed facet="php.core.component" />
4
+	<fixed facet="php.component" />
5
+	<installed facet="php.core.component" version="1" />
6
+	<installed facet="php.component" version="5.6" />
8 7
 </faceted-project>

+ 10
- 0
.settings/org.phpsrc.eclipse.pti.tools.phpunit.prefs View File

@@ -0,0 +1,10 @@
1
+bootstrap=
2
+debug_print_output=true
3
+eclipse.preferences.version=1
4
+no_namespace_check=true
5
+pear_library=<Internal>
6
+php_executable=PHP 5.6.32 (CLI)
7
+source_file_pattern_folder=\\%p\\inc
8
+test_file_pattern_file=%fTest.%e
9
+test_file_pattern_folder=\\%p\\tests
10
+test_file_super_class=PHPUnit_Framework_TestCase

+ 6
- 4
admin/cron.php View File

@@ -1,7 +1,8 @@
1 1
 <?php
2
-spl_autoload_register(function ($class) {
3
-    include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
4
-});
2
+spl_autoload_register(
3
+    function ($class) {
4
+        include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
5
+    });
5 6
 
6 7
 $iCount = 0;
7 8
 $aPerf = array();
@@ -16,7 +17,8 @@ try {
16 17
     
17 18
     $iCount = $l->purgeOldMessages();
18 19
     $aPerf = $l->getPerf();
19
-} catch (LggrException $e) {
20
+}
21
+catch (LggrException $e) {
20 22
     die($e->getMessage());
21 23
 } // try
22 24
 

+ 6
- 4
admin/cron_often.php View File

@@ -1,7 +1,8 @@
1 1
 <?php
2
-spl_autoload_register(function ($class) {
3
-    include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
4
-});
2
+spl_autoload_register(
3
+    function ($class) {
4
+        include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
5
+    });
5 6
 
6 7
 $iCountServers = 0;
7 8
 $aPerf = array();
@@ -17,7 +18,8 @@ try {
17 18
     $iCountServers = $l->updateServers();
18 19
     
19 20
     $aPerf = $l->getPerf();
20
-} catch (LggrException $e) {
21
+}
22
+catch (LggrException $e) {
21 23
     die($e->getMessage());
22 24
 } // try
23 25
 

+ 6
- 4
admin/normalize.php View File

@@ -1,7 +1,8 @@
1 1
 <?php
2
-spl_autoload_register(function ($class) {
3
-    include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
4
-});
2
+spl_autoload_register(
3
+    function ($class) {
4
+        include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
5
+    });
5 6
 
6 7
 $iCount = 0;
7 8
 $a = array();
@@ -17,6 +18,7 @@ try {
17 18
     $l->normalizeHosts();
18 19
     
19 20
     $a = $l->getPerf();
20
-} catch (LggrException $e) {
21
+}
22
+catch (LggrException $e) {
21 23
     die($e->getMessage());
22 24
 } // try

+ 4
- 3
api.php View File

@@ -1,7 +1,8 @@
1 1
 <?php
2
-spl_autoload_register(function ($class) {
3
-    include 'inc/' . strtolower($class) . '_class.php';
4
-});
2
+spl_autoload_register(
3
+    function ($class) {
4
+        include 'inc/' . strtolower($class) . '_class.php';
5
+    });
5 6
 
6 7
 session_start();
7 8
 

+ 21
- 12
archived.php View File

@@ -7,8 +7,10 @@ require 'tpl/head.inc.php';
7 7
 $l = null;
8 8
 try {
9 9
     $l = new Lggr($state, $config);
10
-} catch (LggrException $e) {
11
-    echo '<div class="container"><div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div></div>';
10
+}
11
+catch (LggrException $e) {
12
+    echo '<div class="container"><div class="alert alert-danger" role="alert">' .
13
+         $e->getMessage() . '</div></div>';
12 14
     
13 15
     require 'tpl/foot.inc.php';
14 16
     
@@ -22,8 +24,10 @@ try {
22 24
     $searchvalue = '';
23 25
     $searchvalueprog = '';
24 26
     $isSearch = false;
25
-} catch (LggrException $e) {
26
-    echo '<div class="container"><div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div></div>';
27
+}
28
+catch (LggrException $e) {
29
+    echo '<div class="container"><div class="alert alert-danger" role="alert">' .
30
+         $e->getMessage() . '</div></div>';
27 31
     
28 32
     require 'tpl/foot.inc.php';
29 33
     
@@ -31,7 +35,8 @@ try {
31 35
 }
32 36
 
33 37
 if (version_compare(phpversion(), '5.4', '<')) {
34
-    echo '<div class="container"><div class="alert alert-danger" role="alert">Your PHP version ' . phpversion() . ' might be too old, expecting at least 5.4</div></div>';
38
+    echo '<div class="container"><div class="alert alert-danger" role="alert">Your PHP version ' .
39
+         phpversion() . ' might be too old, expecting at least 5.4</div></div>';
35 40
 } // if
36 41
 
37 42
 require 'tpl/nav.inc.php';
@@ -46,7 +51,8 @@ require 'tpl/nav.inc.php';
46 51
 <?php
47 52
 
48 53
 if (0 == count($aEvents)) {
49
-    echo '<div class="alert alert-danger" role="alert">' . _('empty result') . '</div>';
54
+    echo '<div class="alert alert-danger" role="alert">' . _('empty result') .
55
+         '</div>';
50 56
 } // if
51 57
 
52 58
 ?>
@@ -92,22 +98,26 @@ foreach ($aEvents as $event) {
92 98
             $label = '<span class="label label-success">Info</span>';
93 99
             break;
94 100
         default:
95
-            $label = '<span class="label label-default">' . $event->level . '</span>';
101
+            $label = '<span class="label label-default">' . $event->level .
102
+                 '</span>';
96 103
     } // switch
97 104
     
98 105
     switch ($event->archived) {
99 106
         case 'Y':
100
-            $archived = '<span id="arch' . $event->id . '" class="lggr-archived glyphicon glyphicon-warning-sign" aria-hidden="true" title="archived"></span>';
107
+            $archived = '<span id="arch' . $event->id .
108
+                 '" class="lggr-archived glyphicon glyphicon-warning-sign" aria-hidden="true" title="archived"></span>';
101 109
             break;
102 110
         case 'N':
103
-            $archived = '<span id="arch' . $event->id . '" class="lggr-notarchived glyphicon glyphicon-pushpin" aria-hidden="true" title=""></span>';
111
+            $archived = '<span id="arch' . $event->id .
112
+                 '" class="lggr-notarchived glyphicon glyphicon-pushpin" aria-hidden="true" title=""></span>';
104 113
             break;
105 114
         default:
106 115
             $archived = '?';
107 116
     } // switch
108 117
     
109 118
     $host = htmlentities($event->host, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
110
-    $program = htmlentities($event->program, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
119
+    $program = htmlentities($event->program,
120
+        ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
111 121
     $msg = htmlentities($event->message, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
112 122
     
113 123
     echo <<<EOL
@@ -135,5 +145,4 @@ if (! $isSearch) {
135 145
 
136 146
 <?php
137 147
 $aPerf = $l->getPerf();
138
-require 'tpl/foot.inc.php'
139
-?>
148
+require 'tpl/foot.inc.php'?>

+ 14
- 14
css/lggr.css View File

@@ -6,25 +6,25 @@ div.lggr-col-filter div.lggr-formelement {
6 6
     margin-bottom: 1em;
7 7
 }
8 8
 
9
-@-moz-keyframes spin {
10
-    100% {
11
-        -moz-transform: rotate(360deg);
12
-    }
9
+@
10
+-moz-keyframes spin { 100% {
11
+    -moz-transform: rotate(360deg);
13 12
 }
14 13
 
15
-@-webkit-keyframes spin {
16
-    100% {
17
-        -webkit-transform: rotate(360deg);
18
-    }
14
+}
15
+@
16
+-webkit-keyframes spin { 100% {
17
+    -webkit-transform: rotate(360deg);
19 18
 }
20 19
 
21
-@keyframes spin {
22
-    100% {
23
-        -webkit-transform: rotate(360deg);
24
-        transform: rotate(360deg);
25
-    }
20
+}
21
+@
22
+keyframes spin { 100% {
23
+    -webkit-transform: rotate(360deg);
24
+    transform: rotate(360deg);
26 25
 }
27 26
 
27
+}
28 28
 div#liveheader h2 span.glyphicon-refresh {
29 29
     -webkit-animation: spin 4s linear infinite;
30 30
     -moz-animation: spin 4s linear infinite;
@@ -99,4 +99,4 @@ p.debugfooter {
99 99
     float: right;
100 100
     color: #999999;
101 101
     font-size: 75%;
102
-}
102
+}

+ 1
- 1
css/lggr_print.css View File

@@ -33,4 +33,4 @@ div.col-md-1, div.col-md-2 {
33 33
 
34 34
 div.col-md-5 {
35 35
     clear: left;
36
-}
36
+}

+ 4
- 3
do.php View File

@@ -1,7 +1,8 @@
1 1
 <?php
2
-spl_autoload_register(function ($class) {
3
-    include 'inc/' . strtolower($class) . '_class.php';
4
-});
2
+spl_autoload_register(
3
+    function ($class) {
4
+        include 'inc/' . strtolower($class) . '_class.php';
5
+    });
5 6
 
6 7
 session_start();
7 8
 

+ 9
- 9
icos/browserconfig.xml View File

@@ -1,12 +1,12 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <browserconfig>
3
-  <msapplication>
4
-    <tile>
5
-      <square70x70logo src="/icos/mstile-70x70.png"/>
6
-      <square150x150logo src="/icos/mstile-150x150.png"/>
7
-      <square310x310logo src="/icos/mstile-310x310.png"/>
8
-      <wide310x150logo src="/icos/mstile-310x150.png"/>
9
-      <TileColor>#ffc40d</TileColor>
10
-    </tile>
11
-  </msapplication>
3
+	<msapplication>
4
+		<tile>
5
+			<square70x70logo src="/icos/mstile-70x70.png" />
6
+			<square150x150logo src="/icos/mstile-150x150.png" />
7
+			<square310x310logo src="/icos/mstile-310x310.png" />
8
+			<wide310x150logo src="/icos/mstile-310x150.png" />
9
+			<TileColor>#ffc40d</TileColor>
10
+		</tile>
11
+	</msapplication>
12 12
 </browserconfig>

+ 21
- 42
inc/abstractconfig_class.php View File

@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 
3
-abstract class AbstractConfig
4
-{
3
+abstract class AbstractConfig {
5 4
 
6 5
     protected $DBUSER;
7 6
 
@@ -23,103 +22,83 @@ abstract class AbstractConfig
23 22
 
24 23
     protected $LOCALE;
25 24
 
26
-    final public function getDbUser()
27
-    {
25
+    final public function getDbUser() {
28 26
         return $this->DBUSER;
29 27
     }
30 28
 
31
-    final public function getDbPwd()
32
-    {
29
+    final public function getDbPwd() {
33 30
         return $this->DBPWD;
34 31
     }
35 32
 
36
-    final public function getDbName()
37
-    {
33
+    final public function getDbName() {
38 34
         return $this->DBNAME;
39 35
     }
40 36
 
41
-    final public function getUrlBootstrap()
42
-    {
37
+    final public function getUrlBootstrap() {
43 38
         return $this->URLBOOTSTRAP;
44 39
     }
45 40
 
46
-    final public function getUrlJquery()
47
-    {
41
+    final public function getUrlJquery() {
48 42
         return $this->URLJQUERY;
49 43
     }
50 44
 
51
-    final public function getUrlJqueryui()
52
-    {
45
+    final public function getUrlJqueryui() {
53 46
         return $this->URLJQUERYUI;
54 47
     }
55 48
 
56
-    final public function getUrlJAtimepicker()
57
-    {
49
+    final public function getUrlJAtimepicker() {
58 50
         return $this->URLJATIMEPICKER;
59 51
     }
60 52
 
61
-    final public function getUrlChartjs()
62
-    {
53
+    final public function getUrlChartjs() {
63 54
         return $this->URLCHARTJS;
64 55
     }
65 56
 
66
-    final public function getUrlJQCloud()
67
-    {
57
+    final public function getUrlJQCloud() {
68 58
         return $this->URLJQCLOUD;
69 59
     }
70 60
 
71
-    final public function getLocale()
72
-    {
61
+    final public function getLocale() {
73 62
         return $this->LOCALE;
74 63
     }
75 64
 
76
-    protected function setDbUser($s)
77
-    {
65
+    protected function setDbUser($s) {
78 66
         $this->DBUSER = $s;
79 67
     }
80 68
 
81
-    protected function setDbPwd($s)
82
-    {
69
+    protected function setDbPwd($s) {
83 70
         $this->DBPWD = $s;
84 71
     }
85 72
 
86
-    protected function setDbname($s)
87
-    {
73
+    protected function setDbname($s) {
88 74
         $this->DBNAME = $s;
89 75
     }
90 76
 
91
-    protected function setUrlBootstrap($s)
92
-    {
77
+    protected function setUrlBootstrap($s) {
93 78
         $this->URLBOOTSTRAP = $s;
94 79
     }
95 80
 
96
-    protected function setUrlJquery($s)
97
-    {
81
+    protected function setUrlJquery($s) {
98 82
         $this->URLJQUERY = $s;
99 83
     }
100 84
 
101
-    protected function setUrlJqueryui($s)
102
-    {
85
+    protected function setUrlJqueryui($s) {
103 86
         $this->URLJQUERYUI = $s;
104 87
     }
105 88
 
106
-    protected function setUrlJAtimepicker($s)
107
-    {
89
+    protected function setUrlJAtimepicker($s) {
108 90
         $this->URLJATIMEPICKER = $s;
109 91
     }
110 92
 
111
-    protected function setUrlChartjs($s)
112
-    {
93
+    protected function setUrlChartjs($s) {
113 94
         $this->URLCHARTJS = $s;
114 95
     }
115 96
 
116
-    protected function setUrlJQCloud($s)
117
-    {
97
+    protected function setUrlJQCloud($s) {
118 98
         $this->URLJQCLOUD = $s;
119 99
     }
120 100
 
121
-    protected function setLocale($s)
122
-    {
101
+    protected function setLocale($s) {
123 102
         $this->LOCALE = $s;
124 103
     }
125 104
 } // class

+ 1
- 2
inc/abstractlggrcache_class.php View File

@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 
3
-abstract class AbstractLggrCache
4
-{
3
+abstract class AbstractLggrCache {
5 4
 
6 5
     abstract protected function store($key, $value);
7 6
 

+ 2
- 4
inc/adminconfig_class.php View File

@@ -1,10 +1,8 @@
1 1
 <?php
2 2
 
3
-class AdminConfig extends AbstractConfig
4
-{
3
+class AdminConfig extends AbstractConfig {
5 4
 
6
-    function __construct()
7
-    {
5
+    function __construct() {
8 6
         $this->setDbUser('loggeradmin');
9 7
         $this->setDbPwd('lggr');
10 8
         $this->setDbName('lggrdev');

+ 4
- 5
inc/config_class.php View File

@@ -1,10 +1,8 @@
1 1
 <?php
2 2
 
3
-class Config extends AbstractConfig
4
-{
3
+class Config extends AbstractConfig {
5 4
 
6
-    function __construct()
7
-    {
5
+    function __construct() {
8 6
         $this->setDbUser('lggr');
9 7
         $this->setDbPwd('lggr');
10 8
         $this->setDbName('lggr');
@@ -16,7 +14,8 @@ class Config extends AbstractConfig
16 14
         $this->setUrlBootstrap('//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/');
17 15
         $this->setUrlJquery('//code.jquery.com/');
18 16
         $this->setUrlJqueryui('//code.jquery.com/ui/1.11.4/');
19
-        $this->setUrlJAtimepicker('//cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.4.5/');
17
+        $this->setUrlJAtimepicker(
18
+            '//cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.4.5/');
20 19
         $this->setUrlChartjs('//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/');
21 20
         $this->setUrlJQCloud('//cdnjs.cloudflare.com/ajax/libs/jqcloud/1.0.4/');
22 21
         

+ 88
- 85
inc/lggr_class.php View File

@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 
3
-class Lggr
4
-{
3
+class Lggr {
5 4
 
6 5
     const LASTSTAT = 5000;
7 6
 
@@ -19,8 +18,7 @@ class Lggr
19 18
 
20 19
     private $aPerf = null;
21 20
 
22
-    function __construct(LggrState $state, AbstractConfig $config)
23
-    {
21
+    function __construct(LggrState $state, AbstractConfig $config) {
24 22
         $this->config = $config;
25 23
         $this->state = $state;
26 24
         $this->cache = new LggrCacheFile(); // or use LggrCacheRedis instead
@@ -30,30 +28,34 @@ class Lggr
30 28
             $this->checkSecurity();
31 29
         }
32 30
         
33
-        $this->db = new mysqli('localhost', $this->config->getDbUSer(), $this->config->getDbPwd(), $this->config->getDbName());
31
+        $this->db = new mysqli('localhost', $this->config->getDbUSer(),
32
+            $this->config->getDbPwd(), $this->config->getDbName());
34 33
         $this->db->set_charset('utf8');
35 34
     }
36
- // constructor
37
-    function __destruct()
38
-    {
35
+
36
+    // constructor
37
+    function __destruct() {
39 38
         if (null != $this->db) {
40 39
             $this->db->close();
41 40
         } // if
42 41
     }
43
- // destructor
44
-    private function checkSecurity()
45
-    {
42
+
43
+    // destructor
44
+    private function checkSecurity() {
46 45
         // local access allowed without login data
47 46
         if ($_SERVER["REMOTE_ADDR"] === "::1") {
48 47
             return;
49 48
         }
49
+        if ($_SERVER["REMOTE_ADDR"] === "127.0.0.1") {
50
+            return;
51
+        }
50 52
         if (! isset($_SERVER['REMOTE_USER'])) {
51 53
             throw new LggrException('You must enable basic authentication');
52 54
         } // if
53 55
     }
54
- // function
55
-    private function getViewName()
56
-    {
56
+
57
+    // function
58
+    private function getViewName() {
57 59
         $rcView = '';
58 60
         switch ($this->state->getRange()) {
59 61
             case 1:
@@ -75,14 +77,14 @@ class Lggr
75 77
         return $rcView;
76 78
     }
77 79
 
78
-    function getLevels()
79
-    {
80
+    function getLevels() {
80 81
         $perf = new LggrPerf();
81 82
         
82 83
         $v = $this->getViewName();
83 84
         $sql = "
84 85
 SELECT level, COUNT(*) AS c
85
-FROM (SELECT level FROM $v ORDER BY `date` DESC LIMIT " . self::LASTSTAT . ") AS sub
86
+FROM (SELECT level FROM $v ORDER BY `date` DESC LIMIT " .
87
+             self::LASTSTAT . ") AS sub
86 88
 GROUP BY level
87 89
 ORDER BY c DESC
88 90
 ";
@@ -119,9 +121,9 @@ ORDER BY c DESC
119 121
         $this->cache->store("levels$v", $a);
120 122
         return $a;
121 123
     }
122
- // function
123
-    function getAllServers()
124
-    {
124
+
125
+    // function
126
+    function getAllServers() {
125 127
         $perf = new LggrPerf();
126 128
         
127 129
         $sql = "
@@ -144,9 +146,9 @@ FROM servers";
144 146
         
145 147
         return $a;
146 148
     }
147
- // function
148
-    function getServersName($id)
149
-    {
149
+
150
+    // function
151
+    function getServersName($id) {
150 152
         $perf = new LggrPerf();
151 153
         
152 154
         $sql = "
@@ -171,16 +173,17 @@ WHERE id=$id";
171 173
         
172 174
         return $a->name;
173 175
     }
174
- // function
175
-    function getServers()
176
-    {
176
+
177
+    // function
178
+    function getServers() {
177 179
         $perf = new LggrPerf();
178 180
         
179 181
         $v = $this->getViewName();
180 182
         
181 183
         $sql = "
182
-SELECT host, COUNT(*) AS c 
183
-FROM (SELECT host FROM $v ORDER BY `date` DESC LIMIT " . self::LASTSTAT . ") AS sub
184
+SELECT host, COUNT(*) AS c
185
+FROM (SELECT host FROM $v ORDER BY `date` DESC LIMIT " .
186
+             self::LASTSTAT . ") AS sub
184 187
 GROUP BY host
185 188
 ORDER BY c DESC";
186 189
         
@@ -216,9 +219,9 @@ ORDER BY c DESC";
216 219
         $this->cache->store("servers$v", $a);
217 220
         return $a;
218 221
     }
219
- // function
220
-    function getArchived($from = 0, $count = LggrState::PAGELEN)
221
-    {
222
+
223
+    // function
224
+    function getArchived($from = 0, $count = LggrState::PAGELEN) {
222 225
         $iArchivedSize = $this->cache->retrieve(ARCHIVEDSIZE);
223 226
         $aArchivedData = $this->cache->retrieve(ARCHIVEDSIZE . intval($from));
224 227
         
@@ -252,9 +255,9 @@ LIMIT $from,$count";
252 255
         
253 256
         return $a;
254 257
     }
255
- // function
256
-    function getLatest($from = 0, $count = LggrState::PAGELEN)
257
-    {
258
+
259
+    // function
260
+    function getLatest($from = 0, $count = LggrState::PAGELEN) {
258 261
         $perfSize = new LggrPerf();
259 262
         $perfData = new LggrPerf();
260 263
         
@@ -279,9 +282,9 @@ LIMIT $from,$count";
279 282
         
280 283
         return $a;
281 284
     }
282
- // function
283
-    function getCloud()
284
-    {
285
+
286
+    // function
287
+    function getCloud() {
285 288
         $perf = new LggrPerf();
286 289
         
287 290
         $v = $this->getViewName();
@@ -302,9 +305,9 @@ LIMIT $from,$count";
302 305
         
303 306
         return $a;
304 307
     }
305
- // function
306
-    function getNewer($id)
307
-    {
308
+
309
+    // function
310
+    function getNewer($id) {
308 311
         $perf = new LggrPerf();
309 312
         
310 313
         $sqlData = "
@@ -321,9 +324,9 @@ LIMIT " . LggrState::PAGELEN;
321 324
         
322 325
         return $a;
323 326
     }
324
- // function
325
-    function getEntry($id)
326
-    {
327
+
328
+    // function
329
+    function getEntry($id) {
327 330
         $perf = new LggrPerf();
328 331
         
329 332
         $sqlData = "
@@ -337,9 +340,9 @@ WHERE id=$id";
337 340
         $this->aPerf[] = $perf;
338 341
         return $a;
339 342
     }
340
- // function
341
-    function getFromTo($from = 0, $count = LggrState::PAGELEN)
342
-    {
343
+
344
+    // function
345
+    function getFromTo($from = 0, $count = LggrState::PAGELEN) {
343 346
         $perfSize = new LggrPerf();
344 347
         $perfData = new LggrPerf();
345 348
         
@@ -369,9 +372,9 @@ LIMIT $from,$count";
369 372
         
370 373
         return $a;
371 374
     }
372
- // function
373
-    function getHostFromTo($from = 0, $count = LggrState::PAGELEN)
374
-    {
375
+
376
+    // function
377
+    function getHostFromTo($from = 0, $count = LggrState::PAGELEN) {
375 378
         $perfSize = new LggrPerf();
376 379
         $perfData = new LggrPerf();
377 380
         
@@ -404,9 +407,10 @@ LIMIT $from,$count";
404 407
         
405 408
         return $a;
406 409
     }
407
- // function
408
-    function getFiltered($host = null, $level = null, $from = 0, $count = LggrState::PAGELEN)
409
-    {
410
+
411
+    // function
412
+    function getFiltered($host = null, $level = null, $from = 0,
413
+        $count = LggrState::PAGELEN) {
410 414
         $perfSize = new LggrPerf();
411 415
         $perfData = new LggrPerf();
412 416
         
@@ -445,9 +449,9 @@ LIMIT $from,$count";
445 449
         
446 450
         return $a;
447 451
     }
448
- // function
449
-    function getText($msg = '', $prog = '', $from = 0, $count = LggrState::PAGELEN)
450
-    {
452
+
453
+    // function
454
+    function getText($msg = '', $prog = '', $from = 0, $count = LggrState::PAGELEN) {
451 455
         $perf = new LggrPerf();
452 456
         
453 457
         $v = $this->getViewName();
@@ -477,9 +481,9 @@ LIMIT $from,$count";
477 481
         
478 482
         return $a;
479 483
     }
480
- // function
481
-    function getMessagesPerHour()
482
-    {
484
+
485
+    // function
486
+    function getMessagesPerHour() {
483 487
         $perf = new LggrPerf();
484 488
         
485 489
         $sql = "
@@ -501,9 +505,9 @@ GROUP BY h";
501 505
         $this->cache->store('mph', $a);
502 506
         return $a;
503 507
     }
504
- // function
505
-    function getArchivedStatistic()
506
-    {
508
+
509
+    // function
510
+    function getArchivedStatistic() {
507 511
         $perf = new LggrPerf();
508 512
         
509 513
         $sql = "
@@ -525,9 +529,9 @@ FROM Archived
525 529
         $this->cache->store('archivedstats', $a);
526 530
         return $a;
527 531
     }
528
- // function
529
-    function getStatistic()
530
-    {
532
+
533
+    // function
534
+    function getStatistic() {
531 535
         $perf = new LggrPerf();
532 536
         
533 537
         $sql = "
@@ -549,11 +553,11 @@ FROM newlogs
549 553
         $this->cache->store('stats', $a);
550 554
         return $a;
551 555
     }
552
- // function
556
+
557
+    // function
553 558
     
554 559
     /* delete anything older than maxage hours, or 4 weeks */
555
-    function purgeOldMessages($maxage = 672)
556
-    {
560
+    function purgeOldMessages($maxage = 672) {
557 561
         $perf = new LggrPerf();
558 562
         
559 563
         $sql = "
@@ -572,9 +576,9 @@ AND archived='N'
572 576
         
573 577
         return $this->db->affected_rows;
574 578
     }
575
- // function
576
-    function updateServers()
577
-    {
579
+
580
+    // function
581
+    function updateServers() {
578 582
         $perf = new LggrPerf();
579 583
         $iCount = 0;
580 584
         
@@ -584,7 +588,7 @@ AND archived='N'
584 588
         $aServersKnownObj = $this->sendResult($sql);
585 589
         $perf->stop();
586 590
         $this->aPerf[] = $perf;
587
-
591
+        
588 592
         $aServersKnown = array();
589 593
         foreach ($aServersKnownObj as $obj) {
590 594
             $aServersKnown[$obj->name] = $obj->id;
@@ -628,8 +632,7 @@ AND archived='N'
628 632
         return $iCount;
629 633
     }
630 634
 
631
-    function setArchive($iID, $bIsArchived)
632
-    {
635
+    function setArchive($iID, $bIsArchived) {
633 636
         $iID = intval($iID);
634 637
         if ($bIsArchived) {
635 638
             $sArchive = 'Y';
@@ -646,9 +649,9 @@ AND archived='N'
646 649
         $this->cache->purge(ARCHIVEDSIZE);
647 650
         $this->cache->purge("archivedData0");
648 651
     }
649
- // function
650
-    function normalizeHosts()
651
-    {
652
+
653
+    // function
654
+    function normalizeHosts() {
652 655
         
653 656
         // Find any new hostnames
654 657
         $sql = "
@@ -703,9 +706,9 @@ AND host='$hostName'
703 706
             } // if
704 707
         } // foreach
705 708
     }
706
- // function
707
-    private function getResultSize($sql)
708
-    {
709
+
710
+    // function
711
+    private function getResultSize($sql) {
709 712
         $res = $this->db->query($sql);
710 713
         if (false === $res) {
711 714
             throw new LggrException($this->db->error);
@@ -716,9 +719,9 @@ AND host='$hostName'
716 719
         } // if
717 720
         $res->close();
718 721
     }
719
- // function
720
-    private function sendResult($sql)
721
-    {
722
+
723
+    // function
724
+    private function sendResult($sql) {
722 725
         $a = array();
723 726
         
724 727
         $res = $this->db->query($sql);
@@ -732,9 +735,9 @@ AND host='$hostName'
732 735
         $res->close();
733 736
         return $a;
734 737
     }
735
- // function
736
-    public function getPerf()
737
-    {
738
+
739
+    // function
740
+    public function getPerf() {
738 741
         return $this->aPerf;
739 742
     } // function
740 743
 } // class

+ 19
- 20
inc/lggrcachefile_class.php View File

@@ -1,26 +1,25 @@
1 1
 <?php
2 2
 
3
-class LggrCacheFile extends AbstractLggrCache
4
-{
3
+class LggrCacheFile extends AbstractLggrCache {
5 4
 
6 5
     const MAXAGE = 300;
7
- // 5 minutes
6
+
7
+    // 5 minutes
8 8
     private $cachepath = null;
9 9
 
10
-    function __construct()
11
-    {
10
+    function __construct() {
12 11
         $this->cachepath = __DIR__ . '/../cache/';
13 12
     }
14
- // constructor
15
-    public function store($key, $value)
16
-    {
13
+
14
+    // constructor
15
+    public function store($key, $value) {
17 16
         $fname = $this->getFilename($key);
18 17
         $s = serialize($value);
19 18
         file_put_contents($fname, $s);
20 19
     }
21
- // function
22
-    public function retrieve($key)
23
-    {
20
+
21
+    // function
22
+    public function retrieve($key) {
24 23
         $fname = $this->getFilename($key);
25 24
         if (file_exists($fname) && is_readable($fname)) {
26 25
             $ts = filemtime($fname);
@@ -35,21 +34,21 @@ class LggrCacheFile extends AbstractLggrCache
35 34
             return null;
36 35
         } // if
37 36
     }
38
- // function
39
-    public function purge($key)
40
-    {
37
+
38
+    // function
39
+    public function purge($key) {
41 40
         $fname = $this->getFilename($key);
42 41
         unlink($fname);
43 42
     }
44
- // function
45
-    private function filterKey($key)
46
-    {
43
+
44
+    // function
45
+    private function filterKey($key) {
47 46
         $sTmp = str_replace(' ', '-', $key);
48 47
         return preg_replace('/[^A-Za-z0-9\-]/', '', $sTmp);
49 48
     }
50
- // function
51
-    private function getFilename($key)
52
-    {
49
+
50
+    // function
51
+    private function getFilename($key) {
53 52
         return $this->cachepath . 'key_' . $this->filterKey($key) . '.data';
54 53
     } // function
55 54
 }

+ 16
- 17
inc/lggrcacheredis_class.php View File

@@ -1,10 +1,10 @@
1 1
 <?php
2 2
 
3
-class LggrCacheRedis extends AbstractLggrCache
4
-{
3
+class LggrCacheRedis extends AbstractLggrCache {
5 4
 
5
+    // 5 minutes
6 6
     const MAXAGE = 300;
7
- // 5 minutes
7
+
8 8
     const REDISHOST = 'localhost';
9 9
 
10 10
     const REDISDB = 0;
@@ -13,35 +13,34 @@ class LggrCacheRedis extends AbstractLggrCache
13 13
 
14 14
     private $r = null;
15 15
 
16
-    function __construct()
17
-    {
16
+    function __construct() {
18 17
         $this->r = new Redis();
19 18
         $this->r->connect(self::REDISHOST);
20 19
         $this->r->select(self::REDISDB);
21 20
     }
22
- // constructor
23
-    function __destruct()
24
-    {
21
+
22
+    // constructor
23
+    function __destruct() {
25 24
         $this->r->close();
26 25
     }
27
- // destructor
28
-    public function store($key, $value)
29
-    {
26
+
27
+    // destructor
28
+    public function store($key, $value) {
30 29
         $s = serialize($value);
31 30
         $this->r->setex(SELF::REDISPFX . $key, self::MAXAGE, $s);
32 31
     }
33
- // function
34
-    public function retrieve($key)
35
-    {
32
+
33
+    // function
34
+    public function retrieve($key) {
36 35
         $value = $this->r->get(SELF::REDISPFX . $key);
37 36
         if (false === $value) {
38 37
             return null;
39 38
         }
40 39
         return unserialize($value);
41 40
     }
42
- // function
43
-    public function purge($key)
44
-    {
41
+
42
+    // function
43
+    public function purge($key) {
45 44
         $this->r->delete(SELF::REDISPFX . $key);
46 45
     } // function
47 46
 } // class

+ 9
- 10
inc/lggrcsv_class.php View File

@@ -1,8 +1,7 @@
1 1
 <?php
2 2
 
3 3
 /* speichern als UTF8 ohne BOM */
4
-class LggrCsv
5
-{
4
+class LggrCsv {
6 5
 
7 6
     private $lggr = null;
8 7
 
@@ -17,20 +16,20 @@ class LggrCsv
17 16
         'message'
18 17
     ];
19 18
 
20
-    function __construct(Lggr &$oLggr)
21
-    {
19
+    function __construct(Lggr &$oLggr) {
22 20
         $this->lggr = & $oLggr;
23 21
     }
24
- // constructor
25
-    private function generiereDateiname()
26
-    {
22
+
23
+    // constructor
24
+    private function generiereDateiname() {
27 25
         return 'lggrarchive_' . date('Ymd') . '.csv';
28 26
     }
29 27
 
30
-    function generiere()
31
-    {
28
+    function generiere() {
32 29
         header('Content-Type: text/csv; charset=utf-8');
33
-        header('Content-Disposition: attachment; filename="' . $this->generiereDateiname() . '"');
30
+        header(
31
+            'Content-Disposition: attachment; filename="' .
32
+                 $this->generiereDateiname() . '"');
34 33
         
35 34
         $iCnt = 0;
36 35
         $aEntries = $this->lggr->getArchived(0, 9999);

+ 3
- 6
inc/lggrexception_class.php View File

@@ -3,12 +3,10 @@
3 3
 /**
4 4
  * Project specific exception class
5 5
  */
6
-class LggrException extends Exception
7
-{
6
+class LggrException extends Exception {
8 7
 
9 8
     // Die Exception neu definieren, damit die Mitteilung nicht optional ist
10
-    public function __construct($message, $code = 0, Exception $previous = null)
11
-    {
9
+    public function __construct($message, $code = 0, Exception $previous = null) {
12 10
         // etwas Code
13 11
         
14 12
         // sicherstellen, dass alles korrekt zugewiesen wird
@@ -16,8 +14,7 @@ class LggrException extends Exception
16 14
     }
17 15
 
18 16
     // maßgeschneiderte Stringdarstellung des Objektes
19
-    public function __toString()
20
-    {
17
+    public function __toString() {
21 18
         return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
22 19
     }
23 20
 }

+ 14
- 16
inc/lggrperf_class.php View File

@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 
3
-class LggrPerf
4
-{
3
+class LggrPerf {
5 4
 
6 5
     private $tsStart = null;
7 6
 
@@ -11,23 +10,22 @@ class LggrPerf
11 10
 
12 11
     private $sQuery = null;
13 12
 
14
-    function __construct()
15
-    {}
16
- // constructor
17
-    public function start($sql)
18
-    {
13
+    function __construct() {}
14
+
15
+    // constructor
16
+    public function start($sql) {
19 17
         $this->sQuery = $sql;
20 18
         $this->tsStart = microtime(true);
21 19
     }
22
- // function
23
-    public function stop()
24
-    {
20
+
21
+    // function
22
+    public function stop() {
25 23
         $this->tsEnd = microtime(true);
26 24
         $this->tsLen = $this->tsEnd - $this->tsStart;
27 25
     }
28
- // function
29
-    public function getPerf()
30
-    {
26
+
27
+    // function
28
+    public function getPerf() {
31 29
         $a = array();
32 30
         
33 31
         $a['time'] = $this->tsLen;
@@ -37,8 +35,8 @@ class LggrPerf
37 35
         
38 36
         return $a;
39 37
     }
40
- // function
41
-    private function logPerf()
42
-    {} // function
38
+
39
+    // function
40
+    private function logPerf() {} // function
43 41
 }
44 42
 

+ 35
- 61
inc/lggrstate_class.php View File

@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 
3
-class LggrState
4
-{
3
+class LggrState {
5 4
 
6 5
     const SESSIONNAME = 'LggrState';
7 6
 
@@ -24,7 +23,8 @@ class LggrState
24 23
     private $sLevel = null;
25 24
 
26 25
     private $iRange = 24;
27
- // default 24h = today, sort of
26
+
27
+    // default 24h = today, sort of
28 28
     private $bFromTo = false;
29 29
 
30 30
     private $tsFrom = null;
@@ -32,11 +32,11 @@ class LggrState
32 32
     private $tsTo = null;
33 33
 
34 34
     private $iResultSize = 0;
35
- // result size of last query
35
+
36
+    // result size of last query
36 37
     private $bPanelOpen = false;
37 38
 
38
-    function __construct()
39
-    {
39
+    function __construct() {
40 40
         $this->bLocalCall = false;
41 41
         $this->iPage = 0;
42 42
         $this->bSearch = false;
@@ -53,100 +53,83 @@ class LggrState
53 53
         $this->iResultSize = 0;
54 54
         $this->bPanelOpen = false;
55 55
     }
56
- // constructor
57
-    public function setSearch($s)
58
-    {
56
+
57
+    // constructor
58
+    public function setSearch($s) {
59 59
         if (null != $s) {
60 60
             $this->bSearch = true;
61 61
             $this->sSearch = $s;
62 62
         }
63 63
     }
64 64
 
65
-    public function isSearch()
66
-    {
65
+    public function isSearch() {
67 66
         return $this->bSearch;
68 67
     }
69 68
 
70
-    public function getSearch()
71
-    {
69
+    public function getSearch() {
72 70
         return $this->sSearch;
73 71
     }
74 72
 
75
-    public function setSearchProg($s)
76
-    {
73
+    public function setSearchProg($s) {
77 74
         if (null != $s) {
78 75
             $this->bSearch = true;
79 76
             $this->sSearchProg = $s;
80 77
         } // if
81 78
     }
82 79
 
83
-    public function getSearchProg()
84
-    {
80
+    public function getSearchProg() {
85 81
         return $this->sSearchProg;
86 82
     }
87 83
 
88
-    public function setPage($i)
89
-    {
84
+    public function setPage($i) {
90 85
         $this->iPage = $i;
91 86
     }
92 87
 
93
-    public function getPage()
94
-    {
88
+    public function getPage() {
95 89
         return $this->iPage;
96 90
     }
97 91
 
98
-    public function setHostName($s)
99
-    {
92
+    public function setHostName($s) {
100 93
         $this->sHostName = $s;
101 94
     }
102 95
 
103
-    public function getHostName()
104
-    {
96
+    public function getHostName() {
105 97
         return $this->sHostName;
106 98
     }
107 99
 
108
-    public function setHostId($id)
109
-    {
100
+    public function setHostId($id) {
110 101
         $this->iHost = $id;
111 102
     }
112 103
 
113
-    public function getHostId()
114
-    {
104
+    public function getHostId() {
115 105
         return $this->iHost;
116 106
     }
117 107
 
118
-    public function isHost()
119
-    {
108
+    public function isHost() {
120 109
         return 0 != $this->iHost;
121 110
     }
122 111
 
123
-    public function setLevel($s)
124
-    {
112
+    public function setLevel($s) {
125 113
         $this->sLevel = $s;
126 114
     }
127 115
 
128
-    public function getLevel()
129
-    {
116
+    public function getLevel() {
130 117
         return $this->sLevel;
131 118
     }
132 119
 
133
-    public function isLevel()
134
-    {
120
+    public function isLevel() {
135 121
         return null != $this->sLevel;
136 122
     }
137 123
 
138
-    public function setRange($i)
139
-    {
124
+    public function setRange($i) {
140 125
         $this->iRange = $i;
141 126
     }
142 127
 
143
-    public function getRange()
144
-    {
128
+    public function getRange() {
145 129
         return $this->iRange;
146 130
     }
147 131
 
148
-    public function setFromTo($tsFrom, $tsTo)
149
-    {
132
+    public function setFromTo($tsFrom, $tsTo) {
150 133
         if (null == $tsFrom && null == $tsTo) {
151 134
             $this->bFromTo = false;
152 135
         } else {
@@ -156,48 +139,39 @@ class LggrState
156 139
         $this->tsTo = $tsTo;
157 140
     }
158 141
 
159
-    public function isFromTo()
160
-    {
142
+    public function isFromTo() {
161 143
         return $this->bFromTo;
162 144
     }
163 145
 
164
-    public function getFrom()
165
-    {
146
+    public function getFrom() {
166 147
         return $this->tsFrom;
167 148
     }
168 149
 
169
-    public function getTo()
170
-    {
150
+    public function getTo() {
171 151
         return $this->tsTo;
172 152
     }
173 153
 
174
-    public function setResultSize($i)
175
-    {
154
+    public function setResultSize($i) {
176 155
         $this->iResultSize = $i;
177 156
     }
178 157
 
179
-    public function getResultSize()
180
-    {
158
+    public function getResultSize() {
181 159
         return $this->iResultSize;
182 160
     }
183 161
 
184
-    public function setLocalCall($b)
185
-    {
162
+    public function setLocalCall($b) {
186 163
         $this->bLocalCall = $b;
187 164
     }
188 165
 
189
-    public function isLocalCall()
190
-    {
166
+    public function isLocalCall() {
191 167
         return $this->bLocalCall;
192 168
     }
193 169
 
194
-    public function setPanelOpen($b)
195
-    {
170
+    public function setPanelOpen($b) {
196 171
         $this->bPanelOpen = $b;
197 172
     }
198 173
 
199
-    public function isPanelOpen()
200
-    {
174
+    public function isPanelOpen() {
201 175
         return $this->bPanelOpen;
202 176
     }
203 177
 } // class

+ 9
- 0
inc/messagelevel_class.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+abstract class MessageLevel {
3
+    const EMERG = 'emerg';
4
+    const CRIT = 'crit';
5
+    const ERR = 'err';
6
+    const WARNING = 'warning';
7
+    const NOTICE = 'notice';
8
+    const INFO = 'info';
9
+}

+ 9
- 7
inc/pre.inc.php View File

@@ -1,9 +1,10 @@
1 1
 <?php
2
-spl_autoload_register(function ($class) {
3
-    $class = strtolower($class);
4
-    $class = str_replace('\\', '/', $class);
5
-    include __DIR__ . '/' . $class . '_class.php';
6
-});
2
+spl_autoload_register(
3
+    function ($class) {
4
+        $class = strtolower($class);
5
+        $class = str_replace('\\', '/', $class);
6
+        include __DIR__ . '/' . $class . '_class.php';
7
+    });
7 8
 
8 9
 $config = new Config();
9 10
 
@@ -14,8 +15,9 @@ if (isset($_SESSION[LggrState::SESSIONNAME])) {
14 15
 } else {
15 16
     $state = new LggrState();
16 17
 }
17
- // if
18
-  
18
+
19
+// if
20
+
19 21
 // Uebersetzungen via gettext vorbereiten
20 22
 /*
21 23
  * Auf dem Server ausführen:

+ 93
- 49
index.php View File

@@ -11,8 +11,10 @@ try {
11 11
     $aLevels = $l->getLevels();
12 12
     $aServers = $l->getServers();
13 13
     $aAllServers = $l->getAllServers();
14
-} catch (LggrException $e) {
15
-    echo '<div class="container"><div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div></div>';
14
+}
15
+catch (LggrException $e) {
16
+    echo '<div class="container"><div class="alert alert-danger" role="alert">' .
17
+         $e->getMessage() . '</div></div>';
16 18
     
17 19
     require 'tpl/foot.inc.php';
18 20
     
@@ -31,9 +33,12 @@ $page = $state->getPage();
31 33
 try {
32 34
     if ($state->isSearch()) {
33 35
         
34
-        $aEvents = $l->getText($state->getSearch(), $state->getSearchProg(), $page * LggrState::PAGELEN, LggrState::PAGELEN);
35
-        $searchvalue = htmlentities($state->getSearch(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
36
-        $searchvalueprog = htmlentities($state->getSearchProg(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
36
+        $aEvents = $l->getText($state->getSearch(), $state->getSearchProg(),
37
+            $page * LggrState::PAGELEN, LggrState::PAGELEN);
38
+        $searchvalue = htmlentities($state->getSearch(),
39
+            ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
40
+        $searchvalueprog = htmlentities($state->getSearchProg(),
41
+            ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
37 42
         $isSearch = true;
38 43
         $sFilter = _('Text search for');
39 44
         if ('' != $state->getSearch()) {
@@ -46,10 +51,18 @@ try {
46 51
         
47 52
         $host = $state->getHostName();
48 53
         
49
-        $aEvents = $l->getHostFromTo($page * LggrState::PAGELEN, LggrState::PAGELEN);
54
+        $aEvents = $l->getHostFromTo($page * LggrState::PAGELEN,
55
+            LggrState::PAGELEN);
50 56
         
51
-        $sFilter = _('Filter by time range between') . ' <strong>' . htmlentities($state->getFrom(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong> ' . _('and') . ' <strong>' . htmlentities($state->getTo(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>, ';
52
-        $sFilter .= _('Filter by server') . ' <strong>' . htmlentities($state->getHostName(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
57
+        $sFilter = _('Filter by time range between') . ' <strong>' .
58
+             htmlentities($state->getFrom(),
59
+                ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong> ' .
60
+             _('and') . ' <strong>' .
61
+             htmlentities($state->getTo(),
62
+                ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>, ';
63
+        $sFilter .= _('Filter by server') . ' <strong>' .
64
+             htmlentities($state->getHostName(),
65
+                ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
53 66
         $searchvalue = '';
54 67
         $searchvalueprog = '';
55 68
         $isSearch = false;
@@ -58,21 +71,31 @@ try {
58 71
         $host = $state->getHostName();
59 72
         $level = $state->getLevel();
60 73
         
61
-        $aEvents = $l->getFiltered($host, $level, $page * LggrState::PAGELEN, LggrState::PAGELEN);
74
+        $aEvents = $l->getFiltered($host, $level, $page * LggrState::PAGELEN,
75
+            LggrState::PAGELEN);
62 76
         $searchvalue = '';
63 77
         $searchvalueprog = '';
64 78
         $isSearch = false;
65 79
         $sFilter = '';
66 80
         if ($state->isHost()) {
67
-            $sFilter .= _('Filter by server') . ' <strong>' . htmlentities($state->getHostName(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
81
+            $sFilter .= _('Filter by server') . ' <strong>' .
82
+                 htmlentities($state->getHostName(),
83
+                    ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
68 84
         }
69 85
         if ($state->isLevel()) {
70
-            $sFilter .= _('Filter by level') . ' <strong>' . htmlentities($state->getLevel(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
86
+            $sFilter .= _('Filter by level') . ' <strong>' .
87
+                 htmlentities($state->getLevel(),
88
+                    ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
71 89
         }
72 90
     } elseif ($state->isFromTo()) {
73 91
         
74 92
         $aEvents = $l->getFromTo($page * LggrState::PAGELEN, LggrState::PAGELEN);
75
-        $sFilter = _('Filter by time range between') . ' <strong>' . htmlentities($state->getFrom(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong> ' . _('and') . ' <strong>' . htmlentities($state->getTo(), ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
93
+        $sFilter = _('Filter by time range between') . ' <strong>' .
94
+             htmlentities($state->getFrom(),
95
+                ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong> ' .
96
+             _('and') . ' <strong>' .
97
+             htmlentities($state->getTo(),
98
+                ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES) . '</strong>';
76 99
         $searchvalue = '';
77 100
         $searchvalueprog = '';
78 101
         $isSearch = false;
@@ -85,8 +108,10 @@ try {
85 108
         $searchvalueprog = '';
86 109
         $isSearch = false;
87 110
     } // if search
88
-} catch (LggrException $e) {
89
-    echo '<div class="container"><div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div></div>';
111
+}
112
+catch (LggrException $e) {
113
+    echo '<div class="container"><div class="alert alert-danger" role="alert">' .
114
+         $e->getMessage() . '</div></div>';
90 115
     
91 116
     require 'tpl/foot.inc.php';
92 117
     
@@ -94,7 +119,8 @@ try {
94 119
 }
95 120
 
96 121
 if (version_compare(phpversion(), '5.4', '<')) {
97
-    echo '<div class="container"><div class="alert alert-danger" role="alert">Your PHP version ' . phpversion() . ' might be too old, expecting at least 5.4</div></div>';
122
+    echo '<div class="container"><div class="alert alert-danger" role="alert">Your PHP version ' .
123
+         phpversion() . ' might be too old, expecting at least 5.4</div></div>';
98 124
 } // if
99 125
 
100 126
 require 'tpl/nav.inc.php';
@@ -129,18 +155,18 @@ foreach ($aLevels as $level) {
129 155
     $aLevelCount[$level->level] = $level->c;
130 156
     $level->f = round($level->f);
131 157
     switch ($level->level) {
132
-        case 'emerg':
133
-        case 'crit':
134
-        case 'err':
158
+        case MessageLevel::EMERG:
159
+        case MessageLevel::CRIT:
160
+        case MessageLevel::ERR:
135 161
             $label = 'progress-bar-danger';
136 162
             break;
137
-        case 'warning':
163
+        case MessageLevel::WARNING:
138 164
             $label = 'progress-bar-warning';
139 165
             break;
140
-        case 'notice':
166
+        case MessageLevel::NOTICE:
141 167
             $label = 'progress-bar-primary';
142 168
             break;
143
-        case 'info':
169
+        case MessageLevel::INFO:
144 170
             $label = 'progress-bar-success';
145 171
             break;
146 172
         default:
@@ -158,20 +184,25 @@ EOL;
158 184
                             <p><?= _('Distribution of selected event levels.') ?></p>
159 185
                             <p class="lggr-level-buttons">
160 186
 <?php
161
-if (isset($aLevelCount['emerg'])) {
162
-    echo '<button class="btn btn-sm btn-danger" type="button">Emergency <span class="badge">' . $aLevelCount['emerg'] . '</span></button> ';
187
+if (isset($aLevelCount[MessageLevel::EMERG])) {
188
+    echo '<button class="btn btn-sm btn-danger" type="button">Emergency <span class="badge">' .
189
+        $aLevelCount[MessageLevel::EMERG] . '</span></button> ';
163 190
 }
164
-if (isset($aLevelCount['crit'])) {
165
-    echo '<button class="btn btn-sm btn-danger" type="button">Critical <span class="badge">' . $aLevelCount['crit'] . '</span></button> ';
191
+if (isset($aLevelCount[MessageLevel::CRIT])) {
192
+    echo '<button class="btn btn-sm btn-danger" type="button">Critical <span class="badge">' .
193
+        $aLevelCount[MessageLevel::CRIT] . '</span></button> ';
166 194
 }
167
-if (isset($aLevelCount['err'])) {
168
-    echo '<button class="btn btn-sm btn-danger" type="button">Error <span class="badge">' . $aLevelCount['err'] . '</span></button> ';
195
+if (isset($aLevelCount[MessageLevel::ERR])) {
196
+    echo '<button class="btn btn-sm btn-danger" type="button">Error <span class="badge">' .
197
+        $aLevelCount[MessageLevel::ERR] . '</span></button> ';
169 198
 }
170
-if (isset($aLevelCount['err'])) {
171
-    echo '<button class="btn btn-sm btn-warning" type="button">Warning <span class="badge">' . $aLevelCount['warning'] . '</span></button> ';
199
+if (isset($aLevelCount[MessageLevel::WARNING])) {
200
+    echo '<button class="btn btn-sm btn-warning" type="button">Warning <span class="badge">' .
201
+        $aLevelCount[MessageLevel::WARNING] . '</span></button> ';
172 202
 }
173
-if (isset($aLevelCount['notice'])) {
174
-    echo '<button class="btn btn-sm btn-primary" type="button">Notice <span class="badge">' . $aLevelCount['notice'] . '</span></button> ';
203
+if (isset($aLevelCount[MessageLevel::NOTICE])) {
204
+    echo '<button class="btn btn-sm btn-primary" type="button">Notice <span class="badge">' .
205
+        $aLevelCount[MessageLevel::NOTICE] . '</span></button> ';
175 206
 }
176 207
 ?>
177 208
     </p>
@@ -225,41 +256,49 @@ foreach ($aAllServers as $server) {
225 256
 } // foreach
226 257
 ksort($aServerList);
227 258
 foreach ($aServerList as $servername => $serverid) {
228
-    echo '<li role="presentation"><a role="menuitem" tabindex="-1" href="./do.php?a=host&hostid=' . $serverid . '">' . $servername . '</a></li>';
259
+    echo '<li role="presentation"><a role="menuitem" tabindex="-1" href="./do.php?a=host&hostid=' .
260
+         $serverid . '">' . $servername . '</a></li>';
229 261
 } // foreach
230 262
 ?>
231 263
   </ul>
232 264
                             </div>
233
-                            <!-- dropdown -->                            
234
-                            
235
-                            <div class="btn-group btn-group-xs lggr-formelement"
265
+                            <!-- dropdown -->
266
+
267
+                            <div
268
+                                class="btn-group btn-group-xs lggr-formelement"
236 269
                                 role="group" aria-label="level">
237 270
 <?php
238 271
 foreach ($aLevels as $level) {
239 272
     if ($state->isLevel() && ($level->level == $state->getLevel())) {
240
-        echo '<button type="button" class="btn btn-primary newlog-level">' . $level->level . '</button>';
273
+        echo '<button type="button" class="btn btn-primary newlog-level">' .
274
+             $level->level . '</button>';
241 275
     } else {
242
-        echo '<button type="button" class="btn btn-default newlog-level">' . $level->level . '</button>';
276
+        echo '<button type="button" class="btn btn-default newlog-level">' .
277
+             $level->level . '</button>';
243 278
     }
244 279
 } // foreach
245 280
 ?>
246 281
 </div>
247
-                            
248
-                            <div class="btn-group lggr-formelement" role="group"
249
-                                aria-label="range">
282
+
283
+                            <div class="btn-group lggr-formelement"
284
+                                role="group" aria-label="range">
250 285
 <?php
251 286
 foreach ($aRanges as $rangeValue => $rangeText) {
252 287
     if ($state->getRange() == $rangeValue) {
253
-        echo '<button type="button" class="btn btn-primary newlog-range" data-range="' . $rangeValue . '">' . $rangeText . '</button>';
288
+        echo '<button type="button" class="btn btn-primary newlog-range" data-range="' .
289
+             $rangeValue . '">' . $rangeText . '</button>';
254 290
     } else {
255
-        echo '<button type="button" class="btn btn-default newlog-range" data-range="' . $rangeValue . '">' . $rangeText . '</button>';
291
+        echo '<button type="button" class="btn btn-default newlog-range" data-range="' .
292
+             $rangeValue . '">' . $rangeText . '</button>';
256 293
     }
257 294
 } // foreach
258 295
 
259 296
 if ($state->isFromTo()) {
260
-    echo '<button type="button" class="btn btn-primary newlog-range" id="btnspecialrange">' . _('Special') . '</button>';
297
+    echo '<button type="button" class="btn btn-primary newlog-range" id="btnspecialrange">' .
298
+         _('Special') . '</button>';
261 299
 } else {
262
-    echo '<button type="button" class="btn btn-default newlog-range" id="btnspecialrange">' . _('Special') . '</button>';
300
+    echo '<button type="button" class="btn btn-default newlog-range" id="btnspecialrange">' .
301
+         _('Special') . '</button>';
263 302
 } // if
264 303
 
265 304
 ?>
@@ -309,7 +348,8 @@ if (null != $sFilter) {
309 348
 } // if
310 349
 
311 350
 if (0 == count($aEvents)) {
312
-    echo '<div class="alert alert-danger" role="alert">' . _('empty result') . '</div>';
351
+    echo '<div class="alert alert-danger" role="alert">' . _('empty result') .
352
+         '</div>';
313 353
 } // if
314 354
 
315 355
 ?>
@@ -357,22 +397,26 @@ foreach ($aEvents as $event) {
357 397
             $label = '<span class="label label-success">Info</span>';
358 398
             break;
359 399
         default:
360
-            $label = '<span class="label label-default">' . $event->level . '</span>';
400
+            $label = '<span class="label label-default">' . $event->level .
401
+                 '</span>';
361 402
     } // switch
362 403
     
363 404
     switch ($event->archived) {
364 405
         case 'Y':
365
-            $archived = '<span id="arch' . $event->id . '" class="lggr-archived glyphicon glyphicon-warning-sign" aria-hidden="true" title="archived"></span>';
406
+            $archived = '<span id="arch' . $event->id .
407
+                 '" class="lggr-archived glyphicon glyphicon-warning-sign" aria-hidden="true" title="archived"></span>';
366 408
             break;
367 409
         case 'N':
368
-            $archived = '<span id="arch' . $event->id . '" class="lggr-notarchived glyphicon glyphicon-pushpin" aria-hidden="true" title=""></span>';
410
+            $archived = '<span id="arch' . $event->id .
411
+                 '" class="lggr-notarchived glyphicon glyphicon-pushpin" aria-hidden="true" title=""></span>';
369 412
             break;
370 413
         default:
371 414
             $archived = '?';
372 415
     } // switch
373 416
     
374 417
     $host = htmlentities($event->host, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
375
-    $program = htmlentities($event->program, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
418
+    $program = htmlentities($event->program,
419
+        ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
376 420
     $msg = htmlentities($event->message, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
377 421
     
378 422
     echo <<<EOL

+ 6
- 4
js/lggr_stat_data.php View File

@@ -1,9 +1,10 @@
1 1
 <?php
2 2
 header('Content-Type: text/javascript');
3 3
 
4
-spl_autoload_register(function ($class) {
5
-    include '../inc/' . strtolower($class) . '_class.php';
6
-});
4
+spl_autoload_register(
5
+    function ($class) {
6
+        include '../inc/' . strtolower($class) . '_class.php';
7
+    });
7 8
 
8 9
 $searchvalue = '';
9 10
 
@@ -40,7 +41,8 @@ try {
40 41
     $aMsgPerHour = $l->getMessagesPerHour();
41 42
     
42 43
     $aCloud = $l->getCloud();
43
-} catch (LggrException $e) {
44
+}
45
+catch (LggrException $e) {
44 46
     
45 47
     exit();
46 48
 }

+ 10
- 5
live.php View File

@@ -9,8 +9,10 @@ try {
9 9
     $l = new Lggr($state, $config);
10 10
     
11 11
     $aEvents = $l->getLatest(0, LggrState::PAGELEN);
12
-} catch (LggrException $e) {
13
-    echo '<div class="container"><div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div></div>';
12
+}
13
+catch (LggrException $e) {
14
+    echo '<div class="container"><div class="alert alert-danger" role="alert">' .
15
+         $e->getMessage() . '</div></div>';
14 16
     
15 17
     require 'tpl/foot.inc.php';
16 18
     
@@ -27,7 +29,8 @@ require 'tpl/nav.inc.php';
27 29
 <?php
28 30
 
29 31
 if (0 == count($aEvents)) {
30
-    echo '<div class="alert alert-danger" role="alert">' . _('empty result') . '</div>';
32
+    echo '<div class="alert alert-danger" role="alert">' . _('empty result') .
33
+         '</div>';
31 34
 } // if
32 35
 
33 36
 ?>
@@ -80,11 +83,13 @@ foreach ($aEvents as $event) {
80 83
             $label = '<span class="label label-success">Info</span>';
81 84
             break;
82 85
         default:
83
-            $label = '<span class="label label-default">' . $event->level . '</span>';
86
+            $label = '<span class="label label-default">' . $event->level .
87
+                 '</span>';
84 88
     } // switch
85 89
     
86 90
     $host = htmlentities($event->host, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
87
-    $program = htmlentities($event->program, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
91
+    $program = htmlentities($event->program,
92
+        ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
88 93
     $msg = htmlentities($event->message, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES);
89 94
     
90 95
     echo <<<EOL

+ 1
- 1
sonar-project.properties View File

@@ -2,7 +2,7 @@
2 2
 sonar.projectKey=lggr
3 3
 # this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
4 4
 sonar.projectName=Lggr
5
-sonar.projectVersion=1.0
5
+sonar.projectVersion=1.1
6 6
  
7 7
 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
8 8
 # This property is optional if sonar.modules is set. 

+ 6
- 5
stats.php View File

@@ -21,8 +21,10 @@ try {
21 21
     $aArchivedStatistic = $aArchivedStatistic[0];
22 22
     
23 23
     $aMsgPerHour = $l->getMessagesPerHour();
24
-} catch (LggrException $e) {
25
-    echo '<div class="container"><div class="alert alert-danger" role="alert">' . $e->getMessage() . '</div></div>';
24
+}
25
+catch (LggrException $e) {
26
+    echo '<div class="container"><div class="alert alert-danger" role="alert">' .
27
+         $e->getMessage() . '</div></div>';
26 28
     
27 29
     require 'tpl/foot.inc.php';
28 30
     
@@ -76,6 +78,5 @@ require 'tpl/nav.inc.php';
76 78
 <!-- container -->
77 79
 
78 80
 <?php
79
-$aPerf = $l->getPerf();
80
-require 'tpl/foot.inc.php'
81
-?>
81
+$aPerf = $l->getPerf();
82
+require 'tpl/foot.inc.php'?>

+ 10
- 5
tpl/foot.inc.php View File

@@ -18,9 +18,14 @@ if (isset($_COOKIE['PHPSESSID'])) {
18 18
 } else {
19 19
     $dbgsession = '-';
20 20
 } // if
21
+if (isset($_SERVER['REMOTE_USER'])) {
22
+    $remoteUser = $_SERVER['REMOTE_USER'];
23
+} else {
24
+    $remoteUser = 'ANONYMOUS';
25
+} // if
21 26
 
22 27
 ?>
23
-        <p class="debugfooter"><?= $pCount ?> <?= _('queries in') ?> <?= $pTime ?> <?= _('seconds') ?>. <?= _('Session') ?>: <?= $dbgsession ?> <?= _('by') ?> <?= htmlentities($_SERVER['REMOTE_USER']) ?></p>
28
+        <p class="debugfooter"><?=$pCount?> <?=_('queries in')?> <?=$pTime?> <?=_('seconds')?>. <?=_('Session')?>: <?=$dbgsession?> <?=_('by')?> <?=htmlentities($remoteUser)?></p>
24 29
         <p>
25 30
             &copy; <a href="http://lggr.io" target="_blank">lggr.io</a>
26 31
             2018
@@ -30,12 +35,12 @@ if (isset($_COOKIE['PHPSESSID'])) {
30 35
 <!-- /container -->
31 36
 
32 37
 <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
33
-<script src="<?= $config->getUrlJquery() ?>jquery-1.11.3.min.js"></script>
34
-<script src="<?= $config->getUrlJqueryui() ?>jquery-ui.min.js"></script>
38
+<script src="<?=$config->getUrlJquery()?>jquery-1.11.3.min.js"></script>
39
+<script src="<?=$config->getUrlJqueryui()?>jquery-ui.min.js"></script>
35 40
 <script
36
-    src="<?= $config->getUrlJAtimepicker() ?>jquery-ui-timepicker-addon.min.js"></script>
41
+    src="<?=$config->getUrlJAtimepicker()?>jquery-ui-timepicker-addon.min.js"></script>
37 42
 <!-- Include all compiled plugins (below), or include individual files as needed -->
38
-<script src="<?= $config->getUrlBootstrap() ?>js/bootstrap.min.js"></script>
43
+<script src="<?=$config->getUrlBootstrap()?>js/bootstrap.min.js"></script>
39 44
 <?php
40 45
 switch (basename($_SERVER['SCRIPT_NAME'], '.php')) {
41 46
     case 'stats':

+ 26
- 10
tpl/paginate.inc.php View File

@@ -4,15 +4,21 @@
4 4
 $maxPages = ceil($state->getResultSize() / LggrState::PAGELEN); // maximum pages
5 5
 
6 6
 if ($page > 9) {
7
-    echo '<li><a class="" href="./do.php?a=paginate&page=' . ($page - 10) . '" aria-label="' . _('Ten left') . '"><span aria-hidden="true">&lArr;</span></a></li>';
7
+    echo '<li><a class="" href="./do.php?a=paginate&page=' . ($page - 10) .
8
+         '" aria-label="' . _('Ten left') .
9
+         '"><span aria-hidden="true">&lArr;</span></a></li>';
8 10
 } else {
9
-    echo '<li class="disabled"><a href="#" aria-label="' . _('Ten left') . '"><span aria-hidden="true">&lArr;</span></a></li>';
11
+    echo '<li class="disabled"><a href="#" aria-label="' . _('Ten left') .
12
+         '"><span aria-hidden="true">&lArr;</span></a></li>';
10 13
 } // if
11 14
 
12 15
 if ($page > 0) {
13
-    echo '<li><a class="pageleft" href="./do.php?a=paginate&page=' . ($page - 1) . '" aria-label="' . _('Previous') . '"><span aria-hidden="true">&laquo;</span></a></li>';
16
+    echo '<li><a class="pageleft" href="./do.php?a=paginate&page=' . ($page - 1) .
17
+         '" aria-label="' . _('Previous') .
18
+         '"><span aria-hidden="true">&laquo;</span></a></li>';
14 19
 } else {
15
-    echo '<li class="disabled"><a href="#" aria-label="' . _('Previous') . '"><span aria-hidden="true">&laquo;</span></a></li>';
20
+    echo '<li class="disabled"><a href="#" aria-label="' . _('Previous') .
21
+         '"><span aria-hidden="true">&laquo;</span></a></li>';
16 22
 } // if
17 23
 
18 24
 if ($page - 4 > 1) {
@@ -26,24 +32,34 @@ for ($i = $page - 4; $i < $page + 4; $i ++) {
26 32
         $class = '';
27 33
     } // if
28 34
     if (($i >= 0) && ($i < $maxPages)) {
29
-        echo '<li  class="' . $class . '"><a href="./do.php?a=paginate&page=' . $i . '">' . ($i + 1) . '</a></li>';
35
+        echo '<li  class="' . $class . '"><a href="./do.php?a=paginate&page=' .
36
+             $i . '">' . ($i + 1) . '</a></li>';
30 37
     } // if
31 38
 } // for i
32 39
 
33 40
 if ($page + 4 < $maxPages) {
34
-    echo '<li><a href="./do.php?a=paginate&page=' . ($maxPages - 1) . '">' . $maxPages . '</a></li>';
41
+    echo '<li><a href="./do.php?a=paginate&page=' . ($maxPages - 1) . '">' .
42
+         $maxPages . '</a></li>';
35 43
 } // if
36 44
 
37 45
 if ($page + 1 >= $maxPages) {
38
-    echo '<li class="disabled"><a href="./do.php?a=paginate&page=' . ($page + 1) . '" aria-label="' . _('Next') . '"><span aria-hidden="true">&raquo;</span></a></li>';
46
+    echo '<li class="disabled"><a href="./do.php?a=paginate&page=' . ($page + 1) .
47
+         '" aria-label="' . _('Next') .
48
+         '"><span aria-hidden="true">&raquo;</span></a></li>';
39 49
 } else {
40
-    echo '<li><a class="pageright" href="./do.php?a=paginate&page=' . ($page + 1) . '" aria-label="' . _('Next') . '"><span aria-hidden="true">&raquo;</span></a></li>';
50
+    echo '<li><a class="pageright" href="./do.php?a=paginate&page=' . ($page + 1) .
51
+         '" aria-label="' . _('Next') .
52
+         '"><span aria-hidden="true">&raquo;</span></a></li>';
41 53
 } // if
42 54
 
43 55
 if ($page + 10 >= $maxPages) {
44
-    echo '<li class="disabled"><a href="./do.php?a=paginate&page=' . ($page + 10) . '" aria-label="' . _('Ten right') . '"><span aria-hidden="true">&rArr;</span></a></li>';
56
+    echo '<li class="disabled"><a href="./do.php?a=paginate&page=' . ($page + 10) .
57
+         '" aria-label="' . _('Ten right') .
58
+         '"><span aria-hidden="true">&rArr;</span></a></li>';
45 59
 } else {
46
-    echo '<li><a class="pageright" href="./do.php?a=paginate&page=' . ($page + 10) . '" aria-label="' . _('Ten right') . '"><span aria-hidden="true">&rArr;</span></a></li>';
60
+    echo '<li><a class="pageright" href="./do.php?a=paginate&page=' .
61
+         ($page + 10) . '" aria-label="' . _('Ten right') .
62
+         '"><span aria-hidden="true">&rArr;</span></a></li>';
47 63
 } // if
48 64
 
49 65
 ?>

Loading…
Cancel
Save
Social stuff:
Mastodon