Passed
Push — 1.10.x ( 2674ce...55c17b )
by Angel Fernando Quiroz
365:02 queued 317:33
created
main/inc/lib/pear/Text/Diff/Engine/native.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -147,6 +147,7 @@  discard block
 block discarded – undo
147 147
      * the two files do not match, and likewise that the last lines do not
148 148
      * match.  The caller must trim matching lines from the beginning and end
149 149
      * of the portions it is going to specify.
150
+     * @param double $nchunks
150 151
      */
151 152
     function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
152 153
     {
@@ -267,6 +268,10 @@  discard block
 block discarded – undo
267 268
      *
268 269
      * Note that XLIM, YLIM are exclusive bounds.  All line numbers are
269 270
      * origin-0 and discarded lines are not counted.
271
+     * @param integer $xoff
272
+     * @param integer $xlim
273
+     * @param integer $yoff
274
+     * @param integer $ylim
270 275
      */
271 276
     function _compareseq ($xoff, $xlim, $yoff, $ylim)
272 277
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      * match.  The caller must trim matching lines from the beginning and end
149 149
      * of the portions it is going to specify.
150 150
      */
151
-    function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
151
+    function _diag($xoff, $xlim, $yoff, $ylim, $nchunks)
152 152
     {
153 153
         $flip = false;
154 154
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         }
172 172
 
173 173
         $this->lcs = 0;
174
-        $this->seq[0]= $yoff - 1;
174
+        $this->seq[0] = $yoff - 1;
175 175
         $this->in_seq = array();
176 176
         $ymids[0] = array();
177 177
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 }
185 185
             }
186 186
 
187
-            $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks);
187
+            $x1 = $xoff + (int) (($numer + ($xlim - $xoff) * $chunk) / $nchunks);
188 188
             for (; $x < $x1; $x++) {
189 189
                 $line = $flip ? $this->yv[$x] : $this->xv[$x];
190 190
                 if (empty($ymatches[$line])) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff);
221 221
         $ymid = $ymids[$this->lcs];
222 222
         for ($n = 0; $n < $nchunks - 1; $n++) {
223
-            $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks);
223
+            $x1 = $xoff + (int) (($numer + ($xlim - $xoff) * $n) / $nchunks);
224 224
             $y1 = $ymid[$n] + 1;
225 225
             $seps[] = $flip ? array($y1, $x1) : array($x1, $y1);
226 226
         }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
         $beg = 1;
242 242
         while ($beg < $end) {
243
-            $mid = (int)(($beg + $end) / 2);
243
+            $mid = (int) (($beg + $end) / 2);
244 244
             if ($ypos > $this->seq[$mid]) {
245 245
                 $beg = $mid + 1;
246 246
             } else {
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      * Note that XLIM, YLIM are exclusive bounds.  All line numbers are
269 269
      * origin-0 and discarded lines are not counted.
270 270
      */
271
-    function _compareseq ($xoff, $xlim, $yoff, $ylim)
271
+    function _compareseq($xoff, $xlim, $yoff, $ylim)
272 272
     {
273 273
         /* Slide down the bottom initial diagonal. */
274 274
         while ($xoff < $xlim && $yoff < $ylim
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             reset($seps);
310 310
             $pt1 = $seps[0];
311 311
             while ($pt2 = next($seps)) {
312
-                $this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]);
312
+                $this->_compareseq($pt1[0], $pt2[0], $pt1[1], $pt2[1]);
313 313
                 $pt1 = $pt2;
314 314
             }
315 315
         }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                 $j++;
353 353
             }
354 354
 
355
-            while ($i < $len && ! $changed[$i]) {
355
+            while ($i < $len && !$changed[$i]) {
356 356
                 assert('$j < $other_len && ! $other_changed[$j]');
357 357
                 $i++; $j++;
358 358
                 while ($j < $other_len && $other_changed[$j]) {
Please login to merge, or discard this patch.
main/inc/lib/pear/Text/Diff/Renderer.php 4 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -143,6 +143,12 @@  discard block
 block discarded – undo
143 143
         return $output . $this->_endDiff();
144 144
     }
145 145
 
146
+    /**
147
+     * @param integer $xbeg
148
+     * @param integer $xlen
149
+     * @param integer $ybeg
150
+     * @param integer $ylen
151
+     */
146 152
     function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
147 153
     {
148 154
         $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));
@@ -199,6 +205,9 @@  discard block
 block discarded – undo
199 205
         return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
200 206
     }
201 207
 
208
+    /**
209
+     * @param string $header
210
+     */
202 211
     function _startBlock($header)
203 212
     {
204 213
         return $header . "\n";
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -149,21 +149,21 @@
 block discarded – undo
149 149
 
150 150
         foreach ($edits as $edit) {
151 151
             switch (strtolower(get_class($edit))) {
152
-            case 'text_diff_op_copy':
153
-                $output .= $this->_context($edit->orig);
154
-                break;
152
+                case 'text_diff_op_copy':
153
+                    $output .= $this->_context($edit->orig);
154
+                    break;
155 155
 
156
-            case 'text_diff_op_add':
157
-                $output .= $this->_added($edit->final);
158
-                break;
156
+                case 'text_diff_op_add':
157
+                    $output .= $this->_added($edit->final);
158
+                    break;
159 159
 
160
-            case 'text_diff_op_delete':
161
-                $output .= $this->_deleted($edit->orig);
162
-                break;
160
+                case 'text_diff_op_delete':
161
+                    $output .= $this->_deleted($edit->orig);
162
+                    break;
163 163
 
164
-            case 'text_diff_op_change':
165
-                $output .= $this->_changed($edit->orig, $edit->final);
166
-                break;
164
+                case 'text_diff_op_change':
165
+                    $output .= $this->_changed($edit->orig, $edit->final);
166
+                    break;
167 167
             }
168 168
         }
169 169
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     function Text_Diff_Renderer($params = array())
39 39
     {
40 40
         foreach ($params as $param => $value) {
41
-            $v = '_' . $param;
41
+            $v = '_'.$param;
42 42
             if (isset($this->$v)) {
43 43
                 $this->$v = $value;
44 44
             }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                                      $block);
141 141
         }
142 142
 
143
-        return $output . $this->_endDiff();
143
+        return $output.$this->_endDiff();
144 144
     }
145 145
 
146 146
     function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             }
168 168
         }
169 169
 
170
-        return $output . $this->_endBlock();
170
+        return $output.$this->_endBlock();
171 171
     }
172 172
 
173 173
     function _startDiff()
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
     function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
184 184
     {
185 185
         if ($xlen > 1) {
186
-            $xbeg .= ',' . ($xbeg + $xlen - 1);
186
+            $xbeg .= ','.($xbeg + $xlen - 1);
187 187
         }
188 188
         if ($ylen > 1) {
189
-            $ybeg .= ',' . ($ybeg + $ylen - 1);
189
+            $ybeg .= ','.($ybeg + $ylen - 1);
190 190
         }
191 191
 
192 192
         // this matches the GNU Diff behaviour
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
             $xbeg--;
197 197
         }
198 198
 
199
-        return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
199
+        return $xbeg.($xlen ? ($ylen ? 'c' : 'd') : 'a').$ybeg;
200 200
     }
201 201
 
202 202
     function _startBlock($header)
203 203
     {
204
-        return $header . "\n";
204
+        return $header."\n";
205 205
     }
206 206
 
207 207
     function _endBlock()
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
     function _lines($lines, $prefix = ' ')
213 213
     {
214
-        return $prefix . implode("\n$prefix", $lines) . "\n";
214
+        return $prefix.implode("\n$prefix", $lines)."\n";
215 215
     }
216 216
 
217 217
     function _context($lines)
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
     function _changed($orig, $final)
233 233
     {
234
-        return $this->_deleted($orig) . "---\n" . $this->_added($final);
234
+        return $this->_deleted($orig)."---\n".$this->_added($final);
235 235
     }
236 236
 
237 237
 }
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * A class to render Diffs in different formats.
4
- *
5
- * This class renders the diff in classic diff format. It is intended that
6
- * this class be customized via inheritance, to obtain fancier outputs.
7
- *
8
- * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.12 2009/07/24 13:26:40 jan Exp $
9
- *
10
- * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
11
- *
12
- * See the enclosed file COPYING for license information (LGPL). If you did
13
- * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
14
- *
15
- * @package Text_Diff
16
- */
3
+     * A class to render Diffs in different formats.
4
+     *
5
+     * This class renders the diff in classic diff format. It is intended that
6
+     * this class be customized via inheritance, to obtain fancier outputs.
7
+     *
8
+     * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.12 2009/07/24 13:26:40 jan Exp $
9
+     *
10
+     * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
11
+     *
12
+     * See the enclosed file COPYING for license information (LGPL). If you did
13
+     * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
14
+     *
15
+     * @package Text_Diff
16
+     */
17 17
 class Text_Diff_Renderer {
18 18
 
19 19
     /**
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
                         }
105 105
                         /* @todo */
106 106
                         $output .= $this->_block($x0, $ntrail + $xi - $x0,
107
-                                                 $y0, $ntrail + $yi - $y0,
108
-                                                 $block);
107
+                                                    $y0, $ntrail + $yi - $y0,
108
+                                                    $block);
109 109
                         $block = false;
110 110
                     }
111 111
                 }
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 
137 137
         if (is_array($block)) {
138 138
             $output .= $this->_block($x0, $xi - $x0,
139
-                                     $y0, $yi - $y0,
140
-                                     $block);
139
+                                        $y0, $yi - $y0,
140
+                                        $block);
141 141
         }
142 142
 
143 143
         return $output . $this->_endDiff();
Please login to merge, or discard this patch.
main/inc/lib/pear/Text/Diff/Renderer/inline.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -74,6 +74,9 @@  discard block
 block discarded – undo
74 74
         return $header;
75 75
     }
76 76
 
77
+    /**
78
+     * @param string[] $lines
79
+     */
77 80
     function _lines($lines, $prefix = ' ', $encode = true)
78 81
     {
79 82
         if ($encode) {
@@ -141,6 +144,9 @@  discard block
 block discarded – undo
141 144
         return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
142 145
     }
143 146
 
147
+    /**
148
+     * @param string $string
149
+     */
144 150
     function _splitOnWords($string, $newlineEscape = "\n")
145 151
     {
146 152
         // Ignore \0; otherwise the while loop will never finish.
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,13 +129,13 @@
 block discarded – undo
129 129
          * preserve whitespace as well. Therefore we split on words,
130 130
          * but include all blocks of whitespace in the wordlist. */
131 131
         $diff = new Text_Diff('native',
132
-                              array($this->_splitOnWords($text1, $nl),
132
+                                array($this->_splitOnWords($text1, $nl),
133 133
                                     $this->_splitOnWords($text2, $nl)));
134 134
 
135 135
         /* Get the diff in inline format. */
136 136
         $renderer = new Text_Diff_Renderer_inline
137 137
             (array_merge($this->getParams(),
138
-                         array('split_level' => 'words')));
138
+                            array('split_level' => 'words')));
139 139
 
140 140
         /* Run the diff and get the output. */
141 141
         return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
Please login to merge, or discard this patch.
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
         if ($this->_split_level == 'words') {
84 84
             return implode('', $lines);
85 85
         } else {
86
-            return implode("\n", $lines) . "\n";
86
+            return implode("\n", $lines)."\n";
87 87
         }
88 88
     }
89 89
 
90 90
     function _added($lines)
91 91
     {
92 92
         array_walk($lines, array(&$this, '_encode'));
93
-        $lines[0] = $this->_ins_prefix . $lines[0];
93
+        $lines[0] = $this->_ins_prefix.$lines[0];
94 94
         $lines[count($lines) - 1] .= $this->_ins_suffix;
95 95
         return $this->_lines($lines, ' ', false);
96 96
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     function _deleted($lines, $words = false)
99 99
     {
100 100
         array_walk($lines, array(&$this, '_encode'));
101
-        $lines[0] = $this->_del_prefix . $lines[0];
101
+        $lines[0] = $this->_del_prefix.$lines[0];
102 102
         $lines[count($lines) - 1] .= $this->_del_suffix;
103 103
         return $this->_lines($lines, ' ', false);
104 104
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                 $orig[0] = substr($orig[0], 1);
117 117
                 $final[0] = substr($final[0], 1);
118 118
             }
119
-            return $prefix . $this->_deleted($orig) . $this->_added($final);
119
+            return $prefix.$this->_deleted($orig).$this->_added($final);
120 120
         }
121 121
 
122 122
         $text1 = implode("\n", $orig);
@@ -133,12 +133,11 @@  discard block
 block discarded – undo
133 133
                                     $this->_splitOnWords($text2, $nl)));
134 134
 
135 135
         /* Get the diff in inline format. */
136
-        $renderer = new Text_Diff_Renderer_inline
137
-            (array_merge($this->getParams(),
136
+        $renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(),
138 137
                          array('split_level' => 'words')));
139 138
 
140 139
         /* Run the diff and get the output. */
141
-        return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
140
+        return str_replace($nl, "\n", $renderer->render($diff))."\n";
142 141
     }
143 142
 
144 143
     function _splitOnWords($string, $newlineEscape = "\n")
Please login to merge, or discard this patch.
main/inc/lib/pear/Text/Password.php 4 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -180,6 +180,7 @@  discard block
 block discarded – undo
180 180
      * @access private
181 181
      * @param  string  Login
182 182
      * @param  integer Key
183
+     * @param integer $key
183 184
      * @return string
184 185
      */
185 186
     function _xor($login, $key)
@@ -208,6 +209,7 @@  discard block
 block discarded – undo
208 209
      * @access private
209 210
      * @param  string  Login
210 211
      * @param  integer Key
212
+     * @param integer $key
211 213
      * @return string
212 214
      */
213 215
     function _rotx($login, $key)
@@ -241,6 +243,7 @@  discard block
 block discarded – undo
241 243
      * @access private
242 244
      * @param  string  Login
243 245
      * @param  integer Key
246
+     * @param integer $key
244 247
      * @return string
245 248
      */
246 249
     function _rotxpp($login, $key)
@@ -274,6 +277,7 @@  discard block
 block discarded – undo
274 277
      * @access private
275 278
      * @param  string  Login
276 279
      * @param  integer Key
280
+     * @param integer $key
277 281
      * @return string
278 282
      */
279 283
     function _rotxmm($login, $key)
@@ -306,6 +310,7 @@  discard block
 block discarded – undo
306 310
      * @access private
307 311
      * @param  string  Login
308 312
      * @param  integer Key
313
+     * @param integer $key
309 314
      * @return string
310 315
      */
311 316
     function _asciiRotx($login, $key)
@@ -340,6 +345,7 @@  discard block
 block discarded – undo
340 345
      * @access private
341 346
      * @param  string  Login
342 347
      * @param  integer Key
348
+     * @param integer $key
343 349
      * @return string
344 350
      */
345 351
     function _asciiRotxpp($login, $key)
@@ -374,6 +380,7 @@  discard block
 block discarded – undo
374 380
      * @access private
375 381
      * @param  string  Login
376 382
      * @param  integer Key
383
+     * @param integer $key
377 384
      * @return string
378 385
      */
379 386
     function _asciiRotxmm($login, $key)
@@ -430,6 +437,7 @@  discard block
 block discarded – undo
430 437
      *
431 438
      * @access private
432 439
      * @param  integer Length of the password
440
+     * @param integer $length
433 441
      * @return string  Returns the password
434 442
      */
435 443
     function _createPronounceable($length)
@@ -475,6 +483,8 @@  discard block
 block discarded – undo
475 483
      * @param  string  Character which could be use in the
476 484
      *                 unpronounceable password ex : 'ABCDEFG'
477 485
      *                 or numeric, alphabetical or alphanumeric.
486
+     * @param integer $length
487
+     * @param string $chars
478 488
      * @return string  Returns the password
479 489
      */
480 490
     function _createUnpronounceable($length, $chars)
Please login to merge, or discard this patch.
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -441,17 +441,17 @@  discard block
 block discarded – undo
441 441
          * List of vowels and vowel sounds
442 442
          */
443 443
         $v = array('a', 'e', 'i', 'o', 'u', 'ae', 'ou', 'io',
444
-                   'ea', 'ou', 'ia', 'ai'
445
-                   );
444
+                    'ea', 'ou', 'ia', 'ai'
445
+                    );
446 446
 
447 447
         /**
448 448
          * List of consonants and consonant sounds
449 449
          */
450 450
         $c = array('b', 'c', 'd', 'g', 'h', 'j', 'k', 'l', 'm',
451
-                   'n', 'p', 'r', 's', 't', 'u', 'v', 'w',
452
-                   'tr', 'cr', 'fr', 'dr', 'wr', 'pr', 'th',
453
-                   'ch', 'ph', 'st', 'sl', 'cl'
454
-                   );
451
+                    'n', 'p', 'r', 's', 't', 'u', 'v', 'w',
452
+                    'tr', 'cr', 'fr', 'dr', 'wr', 'pr', 'th',
453
+                    'ch', 'ph', 'st', 'sl', 'cl'
454
+                    );
455 455
 
456 456
         $v_count = 12;
457 457
         $c_count = 29;
@@ -484,50 +484,50 @@  discard block
 block discarded – undo
484 484
         /**
485 485
          * List of character which could be use in the password
486 486
          */
487
-         switch($chars) {
487
+            switch($chars) {
488 488
 
489
-         case 'alphanumeric':
489
+            case 'alphanumeric':
490 490
              $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
491
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 62;
492
-             break;
491
+                $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 62;
492
+                break;
493 493
 
494
-         case 'alphabetical':
494
+            case 'alphabetical':
495 495
              $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
496
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 52;
497
-             break;
496
+                $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 52;
497
+                break;
498 498
 
499
-         case 'numeric':
499
+            case 'numeric':
500 500
              $chars = '0123456789';
501
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 10;
502
-             break;
501
+                $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 10;
502
+                break;
503 503
 
504
-         case '':
504
+            case '':
505 505
              $chars = '_#@%&ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
506
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 67;
507
-             break;
506
+                $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 67;
507
+                break;
508 508
 
509
-         default:
509
+            default:
510 510
              /**
511 511
               * Some characters shouldn't be used
512 512
               */
513 513
              $chars = trim($chars);
514
-             $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars);
515
-
516
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = strlen($chars);
517
-         }
518
-
519
-         /**
520
-          * Generate password
521
-          */
522
-         for ($i = 0; $i < $length; $i++) {
523
-             $num = mt_rand(0, $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] - 1);
524
-             $password .= $chars{$num};
525
-         }
526
-
527
-         /**
528
-          * Return password
529
-          */
530
-         return $password;
514
+                $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars);
515
+
516
+                $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = strlen($chars);
517
+            }
518
+
519
+            /**
520
+             * Generate password
521
+             */
522
+            for ($i = 0; $i < $length; $i++) {
523
+                $num = mt_rand(0, $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] - 1);
524
+                $password .= $chars{$num};
525
+            }
526
+
527
+            /**
528
+             * Return password
529
+             */
530
+            return $password;
531 531
     }
532 532
 }
533 533
 ?>
Please login to merge, or discard this patch.
Switch Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
     function create($length = 10, $type = 'pronounceable', $chars = '')
56 56
     {
57 57
         switch ($type) {
58
-        case 'unpronounceable' :
59
-            return Text_Password::_createUnpronounceable($length, $chars);
58
+            case 'unpronounceable' :
59
+                return Text_Password::_createUnpronounceable($length, $chars);
60 60
 
61
-        case 'pronounceable' :
62
-        default :
63
-            return Text_Password::_createPronounceable($length);
61
+            case 'pronounceable' :
62
+            default :
63
+                return Text_Password::_createPronounceable($length);
64 64
         }
65 65
     }
66 66
 
@@ -110,35 +110,35 @@  discard block
 block discarded – undo
110 110
     function createFromLogin($login, $type, $key = 0)
111 111
     {
112 112
         switch ($type) {
113
-        case 'reverse':
114
-            return strrev($login);
113
+            case 'reverse':
114
+                return strrev($login);
115 115
 
116
-        case 'shuffle':
117
-            return Text_Password::_shuffle($login);
116
+            case 'shuffle':
117
+                return Text_Password::_shuffle($login);
118 118
 
119
-        case 'xor':
120
-            return Text_Password::_xor($login, $key);
119
+            case 'xor':
120
+                return Text_Password::_xor($login, $key);
121 121
 
122
-        case 'rot13':
123
-            return str_rot13($login);
122
+            case 'rot13':
123
+                return str_rot13($login);
124 124
 
125
-        case 'rotx':
126
-            return Text_Password::_rotx($login, $key);
125
+            case 'rotx':
126
+                return Text_Password::_rotx($login, $key);
127 127
 
128
-        case 'rotx++':
129
-            return Text_Password::_rotxpp($login, $key);
128
+            case 'rotx++':
129
+                return Text_Password::_rotxpp($login, $key);
130 130
 
131
-        case 'rotx--':
132
-            return Text_Password::_rotxmm($login, $key);
131
+            case 'rotx--':
132
+                return Text_Password::_rotxmm($login, $key);
133 133
 
134
-        case 'ascii_rotx':
135
-            return Text_Password::_asciiRotx($login, $key);
134
+            case 'ascii_rotx':
135
+                return Text_Password::_asciiRotx($login, $key);
136 136
 
137
-        case 'ascii_rotx++':
138
-            return Text_Password::_asciiRotxpp($login, $key);
137
+            case 'ascii_rotx++':
138
+                return Text_Password::_asciiRotxpp($login, $key);
139 139
 
140
-        case 'ascii_rotx--':
141
-            return Text_Password::_asciiRotxmm($login, $key);
140
+            case 'ascii_rotx--':
141
+                return Text_Password::_asciiRotxmm($login, $key);
142 142
         }
143 143
     }
144 144
 
@@ -320,11 +320,11 @@  discard block
 block discarded – undo
320 320
                 $next += 255;
321 321
             }
322 322
             switch ($next) { // delete white space
323
-            case 0x09:
324
-            case 0x20:
325
-            case 0x0A:
326
-            case 0x0D:
327
-                $next++;
323
+                case 0x09:
324
+                case 0x20:
325
+                case 0x0A:
326
+                case 0x0D:
327
+                    $next++;
328 328
             }
329 329
             $tmp .= chr($next);
330 330
         }
@@ -354,11 +354,11 @@  discard block
 block discarded – undo
354 354
                 $next += 255;
355 355
             }
356 356
             switch ($next) { // delete white space
357
-            case 0x09:
358
-            case 0x20:
359
-            case 0x0A:
360
-            case 0x0D:
361
-                $next++;
357
+                case 0x09:
358
+                case 0x20:
359
+                case 0x0A:
360
+                case 0x0D:
361
+                    $next++;
362 362
             }
363 363
             $tmp .= chr($next);
364 364
         }
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
                 $next += 255;
389 389
             }
390 390
             switch ($next) { // delete white space
391
-            case 0x09:
392
-            case 0x20:
393
-            case 0x0A:
394
-            case 0x0D:
395
-                $next++;
391
+                case 0x09:
392
+                case 0x20:
393
+                case 0x0A:
394
+                case 0x0D:
395
+                    $next++;
396 396
             }
397 397
             $tmp .= chr($next);
398 398
         }
@@ -486,34 +486,34 @@  discard block
 block discarded – undo
486 486
          */
487 487
          switch($chars) {
488 488
 
489
-         case 'alphanumeric':
490
-             $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
491
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 62;
492
-             break;
489
+             case 'alphanumeric':
490
+                 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
491
+                 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 62;
492
+                 break;
493 493
 
494
-         case 'alphabetical':
495
-             $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
496
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 52;
497
-             break;
494
+             case 'alphabetical':
495
+                 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
496
+                 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 52;
497
+                 break;
498 498
 
499
-         case 'numeric':
500
-             $chars = '0123456789';
501
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 10;
502
-             break;
499
+             case 'numeric':
500
+                 $chars = '0123456789';
501
+                 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 10;
502
+                 break;
503 503
 
504
-         case '':
505
-             $chars = '_#@%&ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
506
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 67;
507
-             break;
504
+             case '':
505
+                 $chars = '_#@%&ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
506
+                 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 67;
507
+                 break;
508 508
 
509
-         default:
510
-             /**
509
+             default:
510
+                 /**
511 511
               * Some characters shouldn't be used
512 512
               */
513
-             $chars = trim($chars);
514
-             $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars);
513
+                 $chars = trim($chars);
514
+                 $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars);
515 515
 
516
-             $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = strlen($chars);
516
+                 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = strlen($chars);
517 517
          }
518 518
 
519 519
          /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = $v_count + $c_count;
460 460
 
461 461
         for ($i = 0; $i < $length; $i++) {
462
-            $retVal .= $c[mt_rand(0, $c_count-1)] . $v[mt_rand(0, $v_count-1)];
462
+            $retVal .= $c[mt_rand(0, $c_count - 1)].$v[mt_rand(0, $v_count - 1)];
463 463
         }
464 464
 
465 465
         return substr($retVal, 0, $length);
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         /**
485 485
          * List of character which could be use in the password
486 486
          */
487
-         switch($chars) {
487
+         switch ($chars) {
488 488
 
489 489
          case 'alphanumeric':
490 490
              $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderAdodb.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
      * Setup db connection.
116 116
      * Based on defined options, this method connects to db defined in {@link $dsn}
117 117
      * and creates a {@link $table} table if {@link $createTable} is true.
118
-     * @return boolean true if all ok.
118
+     * @return boolean|null true if all ok.
119 119
      */
120 120
     function activateOptions()
121 121
     {        
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -121,10 +121,10 @@
 block discarded – undo
121 121
     {        
122 122
         $this->db = &ADONewConnection($this->type);
123 123
         if (! $this->db->PConnect($this->host, $this->user, $this->password, $this->database)) {
124
-          $this->db = null;
125
-          $this->closed = true;
126
-          $this->canAppend = false;
127
-          return;
124
+            $this->db = null;
125
+            $this->closed = true;
126
+            $this->canAppend = false;
127
+            return;
128 128
         }
129 129
         
130 130
         $this->layout = LoggerReflectionUtils::createObject('LoggerLayoutPattern');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 
21 21
 /** A docblok to make phpdoc happy */
22
-require_once(ADODB_DIR . '/adodb.inc.php');
22
+require_once(ADODB_DIR.'/adodb.inc.php');
23 23
 
24 24
 /**
25 25
  * Appends log events to a db table using adodb class.
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     function activateOptions()
121 121
     {        
122 122
         $this->db = &ADONewConnection($this->type);
123
-        if (! $this->db->PConnect($this->host, $this->user, $this->password, $this->database)) {
123
+        if (!$this->db->PConnect($this->host, $this->user, $this->password, $this->database)) {
124 124
           $this->db = null;
125 125
           $this->closed = true;
126 126
           $this->canAppend = false;
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
         $this->layout->setConversionPattern($this->getSql());
132 132
     
133 133
         // test if log table exists
134
-        $sql = 'select * from ' . $this->table . ' where 1 = 0';
134
+        $sql = 'select * from '.$this->table.' where 1 = 0';
135 135
         $dbrs = $this->db->Execute($sql);
136 136
         if ($dbrs == false and $this->getCreateTable()) {
137 137
             $query = "CREATE TABLE {$this->table} (timestamp varchar(32),logger varchar(32),level varchar(32),message varchar(64),thread varchar(32),file varchar(64),line varchar(4) );";
138 138
 
139 139
                      
140 140
             $result = $this->db->Execute($query);
141
-            if (! $result) {
141
+            if (!$result) {
142 142
                 $this->canAppend = false;
143 143
                 return;
144 144
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,8 +155,9 @@
 block discarded – undo
155 155
     
156 156
     function close()
157 157
     {
158
-        if ($this->db !== null)
159
-            $this->db->Close();
158
+        if ($this->db !== null) {
159
+                    $this->db->Close();
160
+        }
160 161
         $this->closed = true;
161 162
     }
162 163
     
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderFile.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -151,10 +151,16 @@
 block discarded – undo
151 151
 		return $this->append;
152 152
 	}
153 153
 
154
+	/**
155
+	 * @param boolean $flag
156
+	 */
154 157
 	public function setAppend($flag) {
155 158
 		$this->append = LoggerOptionConverter::toBoolean($flag, true);		  
156 159
 	}
157 160
 
161
+	/**
162
+	 * @param string $fileName
163
+	 */
158 164
 	public function setFileName($fileName) {
159 165
 		$this->fileName = $fileName;
160 166
 	}
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -67,17 +67,17 @@  discard block
 block discarded – undo
67 67
 	public function activateOptions() {
68 68
 		$fileName = $this->getFile();
69 69
 
70
-		if(!is_file($fileName)) {
70
+		if (!is_file($fileName)) {
71 71
 			$dir = dirname($fileName);
72
-			if(!is_dir($dir)) {
72
+			if (!is_dir($dir)) {
73 73
 				mkdir($dir, 0777, true);
74 74
 			}
75 75
 		}
76 76
 
77
-		$this->fp = fopen($fileName, ($this->getAppend()? 'a':'w'));
78
-		if($this->fp) {
79
-			if(flock($this->fp, LOCK_EX)) {
80
-				if($this->getAppend()) {
77
+		$this->fp = fopen($fileName, ($this->getAppend() ? 'a' : 'w'));
78
+		if ($this->fp) {
79
+			if (flock($this->fp, LOCK_EX)) {
80
+				if ($this->getAppend()) {
81 81
 					fseek($this->fp, 0, SEEK_END);
82 82
 				}
83 83
 				fwrite($this->fp, $this->layout->getHeader());
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 	
95 95
 	public function close() {
96
-		if($this->closed != true) {
97
-			if($this->fp and $this->layout !== null) {
98
-				if(flock($this->fp, LOCK_EX)) {
96
+		if ($this->closed != true) {
97
+			if ($this->fp and $this->layout !== null) {
98
+				if (flock($this->fp, LOCK_EX)) {
99 99
 					fwrite($this->fp, $this->layout->getFooter());
100 100
 					flock($this->fp, LOCK_UN);
101 101
 				}
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 	}
107 107
 
108 108
 	public function append(LoggerLoggingEvent $event) {
109
-		if($this->fp and $this->layout !== null) {
110
-			if(flock($this->fp, LOCK_EX)) {
109
+		if ($this->fp and $this->layout !== null) {
110
+			if (flock($this->fp, LOCK_EX)) {
111 111
 				fwrite($this->fp, $this->layout->format($event));
112 112
 				flock($this->fp, LOCK_UN);
113 113
 			} else {
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function setFile() {
129 129
 		$numargs = func_num_args();
130
-		$args	 = func_get_args();
130
+		$args = func_get_args();
131 131
 
132
-		if($numargs == 1 and is_string($args[0])) {
132
+		if ($numargs == 1 and is_string($args[0])) {
133 133
 			$this->setFileName($args[0]);
134
-		} else if ($numargs >=2 and is_string($args[0]) and is_bool($args[1])) {
134
+		} else if ($numargs >= 2 and is_string($args[0]) and is_bool($args[1])) {
135 135
 			$this->setFile($args[0]);
136 136
 			$this->setAppend($args[1]);
137 137
 		}
Please login to merge, or discard this patch.
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -42,129 +42,129 @@
 block discarded – undo
42 42
  */
43 43
 class LoggerAppenderFile extends LoggerAppender {
44 44
 
45
-	/**
46
-	 * @var boolean if {@link $file} exists, appends events.
47
-	 */
48
-	private $append = true;
49
-	/**
50
-	 * @var string the file name used to append events
51
-	 */
52
-	protected $fileName;
53
-	/**
54
-	 * @var mixed file resource
55
-	 */
56
-	protected $fp = false;
45
+    /**
46
+     * @var boolean if {@link $file} exists, appends events.
47
+     */
48
+    private $append = true;
49
+    /**
50
+     * @var string the file name used to append events
51
+     */
52
+    protected $fileName;
53
+    /**
54
+     * @var mixed file resource
55
+     */
56
+    protected $fp = false;
57 57
 	
58
-	public function __construct($name = '') {
59
-		parent::__construct($name);
60
-		$this->requiresLayout = true;
61
-	}
58
+    public function __construct($name = '') {
59
+        parent::__construct($name);
60
+        $this->requiresLayout = true;
61
+    }
62 62
 
63
-	public function __destruct() {
64
-       $this->close();
65
-   	}
63
+    public function __destruct() {
64
+        $this->close();
65
+        }
66 66
    	
67
-	public function activateOptions() {
68
-		$fileName = $this->getFile();
67
+    public function activateOptions() {
68
+        $fileName = $this->getFile();
69 69
 
70
-		if(!is_file($fileName)) {
71
-			$dir = dirname($fileName);
72
-			if(!is_dir($dir)) {
73
-				mkdir($dir, 0777, true);
74
-			}
75
-		}
70
+        if(!is_file($fileName)) {
71
+            $dir = dirname($fileName);
72
+            if(!is_dir($dir)) {
73
+                mkdir($dir, 0777, true);
74
+            }
75
+        }
76 76
 
77
-		$this->fp = fopen($fileName, ($this->getAppend()? 'a':'w'));
78
-		if($this->fp) {
79
-			if(flock($this->fp, LOCK_EX)) {
80
-				if($this->getAppend()) {
81
-					fseek($this->fp, 0, SEEK_END);
82
-				}
83
-				fwrite($this->fp, $this->layout->getHeader());
84
-				flock($this->fp, LOCK_UN);
85
-				$this->closed = false;
86
-			} else {
87
-				// TODO: should we take some action in this case?
88
-				$this->closed = true;
89
-			}		 
90
-		} else {
91
-			$this->closed = true;
92
-		}
93
-	}
77
+        $this->fp = fopen($fileName, ($this->getAppend()? 'a':'w'));
78
+        if($this->fp) {
79
+            if(flock($this->fp, LOCK_EX)) {
80
+                if($this->getAppend()) {
81
+                    fseek($this->fp, 0, SEEK_END);
82
+                }
83
+                fwrite($this->fp, $this->layout->getHeader());
84
+                flock($this->fp, LOCK_UN);
85
+                $this->closed = false;
86
+            } else {
87
+                // TODO: should we take some action in this case?
88
+                $this->closed = true;
89
+            }		 
90
+        } else {
91
+            $this->closed = true;
92
+        }
93
+    }
94 94
 	
95
-	public function close() {
96
-		if($this->closed != true) {
97
-			if($this->fp and $this->layout !== null) {
98
-				if(flock($this->fp, LOCK_EX)) {
99
-					fwrite($this->fp, $this->layout->getFooter());
100
-					flock($this->fp, LOCK_UN);
101
-				}
102
-				fclose($this->fp);
103
-			}
104
-			$this->closed = true;
105
-		}
106
-	}
95
+    public function close() {
96
+        if($this->closed != true) {
97
+            if($this->fp and $this->layout !== null) {
98
+                if(flock($this->fp, LOCK_EX)) {
99
+                    fwrite($this->fp, $this->layout->getFooter());
100
+                    flock($this->fp, LOCK_UN);
101
+                }
102
+                fclose($this->fp);
103
+            }
104
+            $this->closed = true;
105
+        }
106
+    }
107 107
 
108
-	public function append(LoggerLoggingEvent $event) {
109
-		if($this->fp and $this->layout !== null) {
110
-			if(flock($this->fp, LOCK_EX)) {
111
-				fwrite($this->fp, $this->layout->format($event));
112
-				flock($this->fp, LOCK_UN);
113
-			} else {
114
-				$this->closed = true;
115
-			}
116
-		} 
117
-	}
108
+    public function append(LoggerLoggingEvent $event) {
109
+        if($this->fp and $this->layout !== null) {
110
+            if(flock($this->fp, LOCK_EX)) {
111
+                fwrite($this->fp, $this->layout->format($event));
112
+                flock($this->fp, LOCK_UN);
113
+            } else {
114
+                $this->closed = true;
115
+            }
116
+        } 
117
+    }
118 118
 	
119
-	/**
120
-	 * Sets and opens the file where the log output will go.
121
-	 *
122
-	 * This is an overloaded method. It can be called with:
123
-	 * - setFile(string $fileName) to set filename.
124
-	 * - setFile(string $fileName, boolean $append) to set filename and append.
125
-	 * 
126
-	 * TODO: remove overloading. Use only file as alias to filename
127
-	 */
128
-	public function setFile() {
129
-		$numargs = func_num_args();
130
-		$args	 = func_get_args();
119
+    /**
120
+     * Sets and opens the file where the log output will go.
121
+     *
122
+     * This is an overloaded method. It can be called with:
123
+     * - setFile(string $fileName) to set filename.
124
+     * - setFile(string $fileName, boolean $append) to set filename and append.
125
+     * 
126
+     * TODO: remove overloading. Use only file as alias to filename
127
+     */
128
+    public function setFile() {
129
+        $numargs = func_num_args();
130
+        $args	 = func_get_args();
131 131
 
132
-		if($numargs == 1 and is_string($args[0])) {
133
-			$this->setFileName($args[0]);
134
-		} else if ($numargs >=2 and is_string($args[0]) and is_bool($args[1])) {
135
-			$this->setFile($args[0]);
136
-			$this->setAppend($args[1]);
137
-		}
138
-	}
132
+        if($numargs == 1 and is_string($args[0])) {
133
+            $this->setFileName($args[0]);
134
+        } else if ($numargs >=2 and is_string($args[0]) and is_bool($args[1])) {
135
+            $this->setFile($args[0]);
136
+            $this->setAppend($args[1]);
137
+        }
138
+    }
139 139
 	
140
-	/**
141
-	 * @return string
142
-	 */
143
-	public function getFile() {
144
-		return $this->getFileName();
145
-	}
140
+    /**
141
+     * @return string
142
+     */
143
+    public function getFile() {
144
+        return $this->getFileName();
145
+    }
146 146
 	
147
-	/**
148
-	 * @return boolean
149
-	 */
150
-	public function getAppend() {
151
-		return $this->append;
152
-	}
147
+    /**
148
+     * @return boolean
149
+     */
150
+    public function getAppend() {
151
+        return $this->append;
152
+    }
153 153
 
154
-	public function setAppend($flag) {
155
-		$this->append = LoggerOptionConverter::toBoolean($flag, true);		  
156
-	}
154
+    public function setAppend($flag) {
155
+        $this->append = LoggerOptionConverter::toBoolean($flag, true);		  
156
+    }
157 157
 
158
-	public function setFileName($fileName) {
159
-		$this->fileName = $fileName;
160
-	}
158
+    public function setFileName($fileName) {
159
+        $this->fileName = $fileName;
160
+    }
161 161
 	
162
-	/**
163
-	 * @return string
164
-	 */
165
-	public function getFileName() {
166
-		return $this->fileName;
167
-	}
162
+    /**
163
+     * @return string
164
+     */
165
+    public function getFileName() {
166
+        return $this->fileName;
167
+    }
168 168
 	
169 169
 	 
170 170
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderRollingFile.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
    	
93 93
 	/**
94 94
 	 * Returns the value of the MaxBackupIndex option.
95
-	 * @return integer 
95
+	 * @return string 
96 96
 	 */
97 97
 	private function getExpandedFileName() {
98 98
 		return $this->expandedFileName;
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @var integer 
80 80
 	 */
81
-	private $maxBackupIndex	 = 1;
81
+	private $maxBackupIndex = 1;
82 82
 	
83 83
 	/**
84 84
 	 * @var string the filename expanded
@@ -117,17 +117,17 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	private function rollOver() {
119 119
 		// If maxBackups <= 0, then there is no file renaming to be done.
120
-		if($this->maxBackupIndex > 0) {
120
+		if ($this->maxBackupIndex > 0) {
121 121
 			$fileName = $this->getExpandedFileName();
122 122
 			// Delete the oldest file, to keep Windows happy.
123
-			$file = $fileName . '.' . $this->maxBackupIndex;
124
-			if(is_writable($file))
123
+			$file = $fileName.'.'.$this->maxBackupIndex;
124
+			if (is_writable($file))
125 125
 				unlink($file);
126 126
 			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
127
-			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
128
-				$file = $fileName . "." . $i;
129
-				if(is_readable($file)) {
130
-					$target = $fileName . '.' . ($i + 1);
127
+			for ($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
128
+				$file = $fileName.".".$i;
129
+				if (is_readable($file)) {
130
+					$target = $fileName.'.'.($i + 1);
131 131
 					rename($file, $target);
132 132
 				}
133 133
 			}
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 			$this->close();
136 136
 	
137 137
 			// Rename fileName to fileName.1
138
-			$target = $fileName . ".1";
138
+			$target = $fileName.".1";
139 139
 			$file = $fileName;
140 140
 			rename($file, $target);
141 141
 		}
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	 * @param mixed $maxBackups
168 168
 	 */
169 169
 	public function setMaxBackupIndex($maxBackups) {
170
-		if(is_numeric($maxBackups)) {
171
-			$this->maxBackupIndex = abs((int)$maxBackups);
170
+		if (is_numeric($maxBackups)) {
171
+			$this->maxBackupIndex = abs((int) $maxBackups);
172 172
 		}
173 173
 	}
174 174
 
@@ -199,20 +199,20 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	public function setMaxFileSize($value) {
201 201
 		$maxFileSize = null;
202
-		$numpart = substr($value,0, strlen($value) -2);
202
+		$numpart = substr($value, 0, strlen($value) - 2);
203 203
 		$suffix = strtoupper(substr($value, -2));
204 204
 
205
-		switch($suffix) {
206
-			case 'KB': $maxFileSize = (int)((int)$numpart * 1024); break;
207
-			case 'MB': $maxFileSize = (int)((int)$numpart * 1024 * 1024); break;
208
-			case 'GB': $maxFileSize = (int)((int)$numpart * 1024 * 1024 * 1024); break;
205
+		switch ($suffix) {
206
+			case 'KB': $maxFileSize = (int) ((int) $numpart * 1024); break;
207
+			case 'MB': $maxFileSize = (int) ((int) $numpart * 1024 * 1024); break;
208
+			case 'GB': $maxFileSize = (int) ((int) $numpart * 1024 * 1024 * 1024); break;
209 209
 			default:
210
-				if(is_numeric($value)) {
211
-					$maxFileSize = (int)$value;
210
+				if (is_numeric($value)) {
211
+					$maxFileSize = (int) $value;
212 212
 				}
213 213
 		}
214 214
 		
215
-		if($maxFileSize !== null) {
215
+		if ($maxFileSize !== null) {
216 216
 			$this->maxFileSize = abs($maxFileSize);
217 217
 		}
218 218
 		return $this->maxFileSize;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	public function append(LoggerLoggingEvent $event) {
225 225
 		parent::append($event);
226
-		if(ftell($this->fp) > $this->getMaximumFileSize()) {
226
+		if (ftell($this->fp) > $this->getMaximumFileSize()) {
227 227
 			$this->rollOver();
228 228
 		}
229 229
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,8 +121,9 @@  discard block
 block discarded – undo
121 121
 			$fileName = $this->getExpandedFileName();
122 122
 			// Delete the oldest file, to keep Windows happy.
123 123
 			$file = $fileName . '.' . $this->maxBackupIndex;
124
-			if(is_writable($file))
125
-				unlink($file);
124
+			if(is_writable($file)) {
125
+							unlink($file);
126
+			}
126 127
 			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
127 128
 			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
128 129
 				$file = $fileName . "." . $i;
@@ -150,7 +151,9 @@  discard block
 block discarded – undo
150 151
 		// As LoggerAppenderFile does not create the directory, it has to exist.
151 152
 		// realpath() fails if the argument does not exist so the filename is separated.
152 153
 		$this->expandedFileName = realpath(dirname($fileName));
153
-		if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
154
+		if ($this->expandedFileName === false) {
155
+		    throw new Exception("Directory of $fileName does not exist!");
156
+		}
154 157
 		$this->expandedFileName .= '/'.basename($fileName);
155 158
 	}
156 159
 
Please login to merge, or discard this patch.
Indentation   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Licensed to the Apache Software Foundation (ASF) under one or more
4
- * contributor license agreements. See the NOTICE file distributed with
5
- * this work for additional information regarding copyright ownership.
6
- * The ASF licenses this file to You under the Apache License, Version 2.0
7
- * (the "License"); you may not use this file except in compliance with
8
- * the License. You may obtain a copy of the License at
9
- *
10
- *	   http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- * @package log4php
19
- */
3
+     * Licensed to the Apache Software Foundation (ASF) under one or more
4
+     * contributor license agreements. See the NOTICE file distributed with
5
+     * this work for additional information regarding copyright ownership.
6
+     * The ASF licenses this file to You under the Apache License, Version 2.0
7
+     * (the "License"); you may not use this file except in compliance with
8
+     * the License. You may obtain a copy of the License at
9
+     *
10
+     *	   http://www.apache.org/licenses/LICENSE-2.0
11
+     *
12
+     * Unless required by applicable law or agreed to in writing, software
13
+     * distributed under the License is distributed on an "AS IS" BASIS,
14
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+     * See the License for the specific language governing permissions and
16
+     * limitations under the License.
17
+     *
18
+     * @package log4php
19
+     */
20 20
 
21 21
 /**
22 22
  * LoggerAppenderRollingFile extends LoggerAppenderFile to backup the log files 
@@ -48,183 +48,183 @@  discard block
 block discarded – undo
48 48
  */
49 49
 class LoggerAppenderRollingFile extends LoggerAppenderFile {
50 50
 
51
-	/**
52
-	 * Set the maximum size that the output file is allowed to reach
53
-	 * before being rolled over to backup files.
54
-	 *
55
-	 * <p>In configuration files, the <var>MaxFileSize</var> option takes a
56
-	 * long integer in the range 0 - 2^63. You can specify the value
57
-	 * with the suffixes "KB", "MB" or "GB" so that the integer is
58
-	 * interpreted being expressed respectively in kilobytes, megabytes
59
-	 * or gigabytes. For example, the value "10KB" will be interpreted
60
-	 * as 10240.</p>
61
-	 * <p>The default maximum file size is 10MB.</p>
62
-	 *
63
-	 * <p>Note that MaxFileSize cannot exceed <b>2 GB</b>.</p>
64
-	 *
65
-	 * @var integer
66
-	 */
67
-	private $maxFileSize = 10485760;
51
+    /**
52
+     * Set the maximum size that the output file is allowed to reach
53
+     * before being rolled over to backup files.
54
+     *
55
+     * <p>In configuration files, the <var>MaxFileSize</var> option takes a
56
+     * long integer in the range 0 - 2^63. You can specify the value
57
+     * with the suffixes "KB", "MB" or "GB" so that the integer is
58
+     * interpreted being expressed respectively in kilobytes, megabytes
59
+     * or gigabytes. For example, the value "10KB" will be interpreted
60
+     * as 10240.</p>
61
+     * <p>The default maximum file size is 10MB.</p>
62
+     *
63
+     * <p>Note that MaxFileSize cannot exceed <b>2 GB</b>.</p>
64
+     *
65
+     * @var integer
66
+     */
67
+    private $maxFileSize = 10485760;
68 68
 	
69
-	/**
70
-	 * Set the maximum number of backup files to keep around.
71
-	 * 
72
-	 * <p>The <var>MaxBackupIndex</var> option determines how many backup
73
-	 * files are kept before the oldest is erased. This option takes
74
-	 * a positive integer value. If set to zero, then there will be no
75
-	 * backup files and the log file will be truncated when it reaches
76
-	 * MaxFileSize.</p>
77
-	 * <p>There is one backup file by default.</p>
78
-	 *
79
-	 * @var integer 
80
-	 */
81
-	private $maxBackupIndex	 = 1;
69
+    /**
70
+     * Set the maximum number of backup files to keep around.
71
+     * 
72
+     * <p>The <var>MaxBackupIndex</var> option determines how many backup
73
+     * files are kept before the oldest is erased. This option takes
74
+     * a positive integer value. If set to zero, then there will be no
75
+     * backup files and the log file will be truncated when it reaches
76
+     * MaxFileSize.</p>
77
+     * <p>There is one backup file by default.</p>
78
+     *
79
+     * @var integer 
80
+     */
81
+    private $maxBackupIndex	 = 1;
82 82
 	
83
-	/**
84
-	 * @var string the filename expanded
85
-	 * @access private
86
-	 */
87
-	private $expandedFileName = null;
83
+    /**
84
+     * @var string the filename expanded
85
+     * @access private
86
+     */
87
+    private $expandedFileName = null;
88 88
 
89
-	public function __destruct() {
90
-       parent::__destruct();
91
-   	}
89
+    public function __destruct() {
90
+        parent::__destruct();
91
+        }
92 92
    	
93
-	/**
94
-	 * Returns the value of the MaxBackupIndex option.
95
-	 * @return integer 
96
-	 */
97
-	private function getExpandedFileName() {
98
-		return $this->expandedFileName;
99
-	}
93
+    /**
94
+     * Returns the value of the MaxBackupIndex option.
95
+     * @return integer 
96
+     */
97
+    private function getExpandedFileName() {
98
+        return $this->expandedFileName;
99
+    }
100 100
 
101
-	/**
102
-	 * Get the maximum size that the output file is allowed to reach
103
-	 * before being rolled over to backup files.
104
-	 * @return integer
105
-	 */
106
-	private function getMaximumFileSize() {
107
-		return $this->maxFileSize;
108
-	}
101
+    /**
102
+     * Get the maximum size that the output file is allowed to reach
103
+     * before being rolled over to backup files.
104
+     * @return integer
105
+     */
106
+    private function getMaximumFileSize() {
107
+        return $this->maxFileSize;
108
+    }
109 109
 
110
-	/**
111
-	 * Implements the usual roll over behaviour.
112
-	 *
113
-	 * <p>If MaxBackupIndex is positive, then files File.1, ..., File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex. 
114
-	 * Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
115
-	 * 
116
-	 * <p>If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.
117
-	 */
118
-	private function rollOver() {
119
-		// If maxBackups <= 0, then there is no file renaming to be done.
120
-		if($this->maxBackupIndex > 0) {
121
-			$fileName = $this->getExpandedFileName();
122
-			// Delete the oldest file, to keep Windows happy.
123
-			$file = $fileName . '.' . $this->maxBackupIndex;
124
-			if(is_writable($file))
125
-				unlink($file);
126
-			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
127
-			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
128
-				$file = $fileName . "." . $i;
129
-				if(is_readable($file)) {
130
-					$target = $fileName . '.' . ($i + 1);
131
-					rename($file, $target);
132
-				}
133
-			}
110
+    /**
111
+     * Implements the usual roll over behaviour.
112
+     *
113
+     * <p>If MaxBackupIndex is positive, then files File.1, ..., File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex. 
114
+     * Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
115
+     * 
116
+     * <p>If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.
117
+     */
118
+    private function rollOver() {
119
+        // If maxBackups <= 0, then there is no file renaming to be done.
120
+        if($this->maxBackupIndex > 0) {
121
+            $fileName = $this->getExpandedFileName();
122
+            // Delete the oldest file, to keep Windows happy.
123
+            $file = $fileName . '.' . $this->maxBackupIndex;
124
+            if(is_writable($file))
125
+                unlink($file);
126
+            // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
127
+            for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
128
+                $file = $fileName . "." . $i;
129
+                if(is_readable($file)) {
130
+                    $target = $fileName . '.' . ($i + 1);
131
+                    rename($file, $target);
132
+                }
133
+            }
134 134
 	
135
-			$this->close();
135
+            $this->close();
136 136
 	
137
-			// Rename fileName to fileName.1
138
-			$target = $fileName . ".1";
139
-			$file = $fileName;
140
-			rename($file, $target);
141
-		}
137
+            // Rename fileName to fileName.1
138
+            $target = $fileName . ".1";
139
+            $file = $fileName;
140
+            rename($file, $target);
141
+        }
142 142
 		
143
-		//unset($this->fp);
144
-		$this->activateOptions();
145
-		$this->setFile($fileName, false);
146
-	}
143
+        //unset($this->fp);
144
+        $this->activateOptions();
145
+        $this->setFile($fileName, false);
146
+    }
147 147
 	
148
-	public function setFileName($fileName) {
149
-		$this->fileName = $fileName;
150
-		// As LoggerAppenderFile does not create the directory, it has to exist.
151
-		// realpath() fails if the argument does not exist so the filename is separated.
152
-		$this->expandedFileName = realpath(dirname($fileName));
153
-		if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
154
-		$this->expandedFileName .= '/'.basename($fileName);
155
-	}
148
+    public function setFileName($fileName) {
149
+        $this->fileName = $fileName;
150
+        // As LoggerAppenderFile does not create the directory, it has to exist.
151
+        // realpath() fails if the argument does not exist so the filename is separated.
152
+        $this->expandedFileName = realpath(dirname($fileName));
153
+        if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
154
+        $this->expandedFileName .= '/'.basename($fileName);
155
+    }
156 156
 
157 157
 
158
-	/**
159
-	 * Set the maximum number of backup files to keep around.
160
-	 * 
161
-	 * <p>The <b>MaxBackupIndex</b> option determines how many backup
162
-	 * files are kept before the oldest is erased. This option takes
163
-	 * a positive integer value. If set to zero, then there will be no
164
-	 * backup files and the log file will be truncated when it reaches
165
-	 * MaxFileSize.
166
-	 *
167
-	 * @param mixed $maxBackups
168
-	 */
169
-	public function setMaxBackupIndex($maxBackups) {
170
-		if(is_numeric($maxBackups)) {
171
-			$this->maxBackupIndex = abs((int)$maxBackups);
172
-		}
173
-	}
158
+    /**
159
+     * Set the maximum number of backup files to keep around.
160
+     * 
161
+     * <p>The <b>MaxBackupIndex</b> option determines how many backup
162
+     * files are kept before the oldest is erased. This option takes
163
+     * a positive integer value. If set to zero, then there will be no
164
+     * backup files and the log file will be truncated when it reaches
165
+     * MaxFileSize.
166
+     *
167
+     * @param mixed $maxBackups
168
+     */
169
+    public function setMaxBackupIndex($maxBackups) {
170
+        if(is_numeric($maxBackups)) {
171
+            $this->maxBackupIndex = abs((int)$maxBackups);
172
+        }
173
+    }
174 174
 
175
-	/**
176
-	 * Set the maximum size that the output file is allowed to reach
177
-	 * before being rolled over to backup files.
178
-	 *
179
-	 * @param mixed $maxFileSize
180
-	 * @see setMaxFileSize()
181
-	 * @deprecated
182
-	 */
183
-	public function setMaximumFileSize($maxFileSize) {
184
-		return $this->setMaxFileSize($maxFileSize);
185
-	}
175
+    /**
176
+     * Set the maximum size that the output file is allowed to reach
177
+     * before being rolled over to backup files.
178
+     *
179
+     * @param mixed $maxFileSize
180
+     * @see setMaxFileSize()
181
+     * @deprecated
182
+     */
183
+    public function setMaximumFileSize($maxFileSize) {
184
+        return $this->setMaxFileSize($maxFileSize);
185
+    }
186 186
 
187
-	/**
188
-	 * Set the maximum size that the output file is allowed to reach
189
-	 * before being rolled over to backup files.
190
-	 * <p>In configuration files, the <b>MaxFileSize</b> option takes an
191
-	 * long integer in the range 0 - 2^63. You can specify the value
192
-	 * with the suffixes "KB", "MB" or "GB" so that the integer is
193
-	 * interpreted being expressed respectively in kilobytes, megabytes
194
-	 * or gigabytes. For example, the value "10KB" will be interpreted
195
-	 * as 10240.
196
-	 *
197
-	 * @param mixed $value
198
-	 * @return the actual file size set
199
-	 */
200
-	public function setMaxFileSize($value) {
201
-		$maxFileSize = null;
202
-		$numpart = substr($value,0, strlen($value) -2);
203
-		$suffix = strtoupper(substr($value, -2));
187
+    /**
188
+     * Set the maximum size that the output file is allowed to reach
189
+     * before being rolled over to backup files.
190
+     * <p>In configuration files, the <b>MaxFileSize</b> option takes an
191
+     * long integer in the range 0 - 2^63. You can specify the value
192
+     * with the suffixes "KB", "MB" or "GB" so that the integer is
193
+     * interpreted being expressed respectively in kilobytes, megabytes
194
+     * or gigabytes. For example, the value "10KB" will be interpreted
195
+     * as 10240.
196
+     *
197
+     * @param mixed $value
198
+     * @return the actual file size set
199
+     */
200
+    public function setMaxFileSize($value) {
201
+        $maxFileSize = null;
202
+        $numpart = substr($value,0, strlen($value) -2);
203
+        $suffix = strtoupper(substr($value, -2));
204 204
 
205
-		switch($suffix) {
206
-			case 'KB': $maxFileSize = (int)((int)$numpart * 1024); break;
207
-			case 'MB': $maxFileSize = (int)((int)$numpart * 1024 * 1024); break;
208
-			case 'GB': $maxFileSize = (int)((int)$numpart * 1024 * 1024 * 1024); break;
209
-			default:
210
-				if(is_numeric($value)) {
211
-					$maxFileSize = (int)$value;
212
-				}
213
-		}
205
+        switch($suffix) {
206
+            case 'KB': $maxFileSize = (int)((int)$numpart * 1024); break;
207
+            case 'MB': $maxFileSize = (int)((int)$numpart * 1024 * 1024); break;
208
+            case 'GB': $maxFileSize = (int)((int)$numpart * 1024 * 1024 * 1024); break;
209
+            default:
210
+                if(is_numeric($value)) {
211
+                    $maxFileSize = (int)$value;
212
+                }
213
+        }
214 214
 		
215
-		if($maxFileSize !== null) {
216
-			$this->maxFileSize = abs($maxFileSize);
217
-		}
218
-		return $this->maxFileSize;
219
-	}
215
+        if($maxFileSize !== null) {
216
+            $this->maxFileSize = abs($maxFileSize);
217
+        }
218
+        return $this->maxFileSize;
219
+    }
220 220
 
221
-	/**
222
-	 * @param LoggerLoggingEvent $event
223
-	 */
224
-	public function append(LoggerLoggingEvent $event) {
225
-		parent::append($event);
226
-		if(ftell($this->fp) > $this->getMaximumFileSize()) {
227
-			$this->rollOver();
228
-		}
229
-	}
221
+    /**
222
+     * @param LoggerLoggingEvent $event
223
+     */
224
+    public function append(LoggerLoggingEvent $event) {
225
+        parent::append($event);
226
+        if(ftell($this->fp) > $this->getMaximumFileSize()) {
227
+            $this->rollOver();
228
+        }
229
+    }
230 230
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSocket.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -225,6 +225,7 @@
 block discarded – undo
225 225
 	
226 226
 	/**
227 227
 	 * @param mixed
228
+	 * @param boolean $flag
228 229
 	 */
229 230
 	public function setUseXml($flag) {
230 231
 		$this->useXml = LoggerOptionConverter::toBoolean($flag, $this->getUseXml());
Please login to merge, or discard this patch.
Indentation   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -46,215 +46,215 @@
 block discarded – undo
46 46
  */ 
47 47
 class LoggerAppenderSocket extends LoggerAppender {
48 48
 
49
-	/**
50
-	 * @var mixed socket connection resource
51
-	 * @access private
52
-	 */
53
-	private $sp = false;
49
+    /**
50
+     * @var mixed socket connection resource
51
+     * @access private
52
+     */
53
+    private $sp = false;
54 54
 	
55
-	/**
56
-	 * Target host. On how to define remote hostaname see 
57
-	 * {@link PHP_MANUAL#fsockopen}
58
-	 * @var string 
59
-	 */
60
-	private $remoteHost = '';
55
+    /**
56
+     * Target host. On how to define remote hostaname see 
57
+     * {@link PHP_MANUAL#fsockopen}
58
+     * @var string 
59
+     */
60
+    private $remoteHost = '';
61 61
 	
62
-	/**
63
-	 * @var integer the network port.
64
-	 */
65
-	private $port = 4446;
62
+    /**
63
+     * @var integer the network port.
64
+     */
65
+    private $port = 4446;
66 66
 	
67
-	/**
68
-	 * @var boolean get event's location info.
69
-	 */
70
-	private $locationInfo = false;
67
+    /**
68
+     * @var boolean get event's location info.
69
+     */
70
+    private $locationInfo = false;
71 71
 	
72
-	/**
73
-	 * @var integer connection timeout
74
-	 */
75
-	private $timeout = 30;
72
+    /**
73
+     * @var integer connection timeout
74
+     */
75
+    private $timeout = 30;
76 76
 	
77
-	/**
78
-	 * @var boolean output events via {@link LoggerXmlLayout}
79
-	 */
80
-	private $useXml = false;
77
+    /**
78
+     * @var boolean output events via {@link LoggerXmlLayout}
79
+     */
80
+    private $useXml = false;
81 81
 	
82
-	/**
83
-	 * @var boolean forward this option to {@link LoggerXmlLayout}. 
84
-	 *				Ignored if {@link $useXml} is <i>false</i>.
85
-	 */
86
-	private $log4jNamespace = false;
82
+    /**
83
+     * @var boolean forward this option to {@link LoggerXmlLayout}. 
84
+     *				Ignored if {@link $useXml} is <i>false</i>.
85
+     */
86
+    private $log4jNamespace = false;
87 87
 
88
-	/**
89
-	 * @var LoggerXmlLayout
90
-	 * @access private
91
-	 */
92
-	private $xmlLayout = null;
88
+    /**
89
+     * @var LoggerXmlLayout
90
+     * @access private
91
+     */
92
+    private $xmlLayout = null;
93 93
 	
94
-	/** @var indiciates if this appender should run in dry mode */
95
-	private $dry = false;
94
+    /** @var indiciates if this appender should run in dry mode */
95
+    private $dry = false;
96 96
 	
97
-	public function __destruct() {
98
-       $this->close();
99
-   	}
97
+    public function __destruct() {
98
+        $this->close();
99
+        }
100 100
    	
101
-	/**
102
-	 * Create a socket connection using defined parameters
103
-	 */
104
-	public function activateOptions() {
105
-		if(!$this->dry) {
106
-			$this->sp = @fsockopen($this->getRemoteHost(), $this->getPort(), $errno, $errstr, $this->getTimeout());
107
-			if ($this->sp === false) {
108
-			    throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
109
-			}
110
-		}
111
-		if($this->getUseXml()) {
112
-			$this->xmlLayout = LoggerReflectionUtils::createObject('LoggerLayoutXml');
113
-			if($this->xmlLayout === null) {
114
-				$this->setUseXml(false);
115
-			} else {
116
-				$this->xmlLayout->setLocationInfo($this->getLocationInfo());
117
-				$this->xmlLayout->setLog4jNamespace($this->getLog4jNamespace());
118
-				$this->xmlLayout->activateOptions();
119
-			}			 
120
-		}
101
+    /**
102
+     * Create a socket connection using defined parameters
103
+     */
104
+    public function activateOptions() {
105
+        if(!$this->dry) {
106
+            $this->sp = @fsockopen($this->getRemoteHost(), $this->getPort(), $errno, $errstr, $this->getTimeout());
107
+            if ($this->sp === false) {
108
+                throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
109
+            }
110
+        }
111
+        if($this->getUseXml()) {
112
+            $this->xmlLayout = LoggerReflectionUtils::createObject('LoggerLayoutXml');
113
+            if($this->xmlLayout === null) {
114
+                $this->setUseXml(false);
115
+            } else {
116
+                $this->xmlLayout->setLocationInfo($this->getLocationInfo());
117
+                $this->xmlLayout->setLog4jNamespace($this->getLog4jNamespace());
118
+                $this->xmlLayout->activateOptions();
119
+            }			 
120
+        }
121 121
         $this->closed = false;
122
-	}
122
+    }
123 123
 	
124
-	public function close() {
125
-		if($this->closed != true) {
126
-			if(!$this->dry and $this->sp !== false) {
127
-				fclose($this->sp);
128
-			}
129
-			$this->closed = true;
130
-		}
131
-	}
124
+    public function close() {
125
+        if($this->closed != true) {
126
+            if(!$this->dry and $this->sp !== false) {
127
+                fclose($this->sp);
128
+            }
129
+            $this->closed = true;
130
+        }
131
+    }
132 132
 
133
-	public function setDry($dry) {
134
-		$this->dry = $dry;
135
-	}
133
+    public function setDry($dry) {
134
+        $this->dry = $dry;
135
+    }
136 136
 	
137
-	/**
138
-	 * @return string
139
-	 */
140
-	public function getHostname() {
141
-		return $this->getRemoteHost();
142
-	}
137
+    /**
138
+     * @return string
139
+     */
140
+    public function getHostname() {
141
+        return $this->getRemoteHost();
142
+    }
143 143
 	
144
-	/**
145
-	 * @return boolean
146
-	 */
147
-	public function getLocationInfo() {
148
-		return $this->locationInfo;
149
-	} 
144
+    /**
145
+     * @return boolean
146
+     */
147
+    public function getLocationInfo() {
148
+        return $this->locationInfo;
149
+    } 
150 150
 	 
151
-	/**
152
-	 * @return boolean
153
-	 */
154
-	public function getLog4jNamespace() {
155
-		return $this->log4jNamespace;
156
-	}
151
+    /**
152
+     * @return boolean
153
+     */
154
+    public function getLog4jNamespace() {
155
+        return $this->log4jNamespace;
156
+    }
157 157
 
158
-	/**
159
-	 * @return integer
160
-	 */
161
-	public function getPort() {
162
-		return $this->port;
163
-	}
158
+    /**
159
+     * @return integer
160
+     */
161
+    public function getPort() {
162
+        return $this->port;
163
+    }
164 164
 	
165
-	public function getRemoteHost() {
166
-		return $this->remoteHost;
167
-	}
165
+    public function getRemoteHost() {
166
+        return $this->remoteHost;
167
+    }
168 168
 	
169
-	/**
170
-	 * @return integer
171
-	 */
172
-	public function getTimeout() {
173
-		return $this->timeout;
174
-	}
169
+    /**
170
+     * @return integer
171
+     */
172
+    public function getTimeout() {
173
+        return $this->timeout;
174
+    }
175 175
 	
176
-	/**
177
-	 * @var boolean
178
-	 */
179
-	public function getUseXml() {
180
-		return $this->useXml;
181
-	} 
176
+    /**
177
+     * @var boolean
178
+     */
179
+    public function getUseXml() {
180
+        return $this->useXml;
181
+    } 
182 182
 	 
183
-	public function reset() {
184
-		$this->close();
185
-		parent::reset();
186
-	}
183
+    public function reset() {
184
+        $this->close();
185
+        parent::reset();
186
+    }
187 187
 
188
-	/**
189
-	 * @param mixed
190
-	 */
191
-	public function setLocationInfo($flag) {
192
-		$this->locationInfo = LoggerOptionConverter::toBoolean($flag, $this->getLocationInfo());
193
-	} 
188
+    /**
189
+     * @param mixed
190
+     */
191
+    public function setLocationInfo($flag) {
192
+        $this->locationInfo = LoggerOptionConverter::toBoolean($flag, $this->getLocationInfo());
193
+    } 
194 194
 
195
-	/**
196
-	 * @param mixed
197
-	 */
198
-	public function setLog4jNamespace($flag) {
199
-		$this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, $this->getLog4jNamespace());
200
-	} 
195
+    /**
196
+     * @param mixed
197
+     */
198
+    public function setLog4jNamespace($flag) {
199
+        $this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, $this->getLog4jNamespace());
200
+    } 
201 201
 			
202
-	/**
203
-	 * @param integer
204
-	 */
205
-	public function setPort($port) {
206
-		$port = LoggerOptionConverter::toInt($port, 0);
207
-		if($port > 0 and $port < 65535) {
208
-			$this->port = $port;	
209
-		}
210
-	}
202
+    /**
203
+     * @param integer
204
+     */
205
+    public function setPort($port) {
206
+        $port = LoggerOptionConverter::toInt($port, 0);
207
+        if($port > 0 and $port < 65535) {
208
+            $this->port = $port;	
209
+        }
210
+    }
211 211
 	
212
-	/**
213
-	 * @param string
214
-	 */
215
-	public function setRemoteHost($hostname) {
216
-		$this->remoteHost = $hostname;
217
-	}
212
+    /**
213
+     * @param string
214
+     */
215
+    public function setRemoteHost($hostname) {
216
+        $this->remoteHost = $hostname;
217
+    }
218 218
 	
219
-	/**
220
-	 * @param integer
221
-	 */
222
-	public function setTimeout($timeout) {
223
-		$this->timeout = LoggerOptionConverter::toInt($timeout, $this->getTimeout());
224
-	}
219
+    /**
220
+     * @param integer
221
+     */
222
+    public function setTimeout($timeout) {
223
+        $this->timeout = LoggerOptionConverter::toInt($timeout, $this->getTimeout());
224
+    }
225 225
 	
226
-	/**
227
-	 * @param mixed
228
-	 */
229
-	public function setUseXml($flag) {
230
-		$this->useXml = LoggerOptionConverter::toBoolean($flag, $this->getUseXml());
231
-	} 
226
+    /**
227
+     * @param mixed
228
+     */
229
+    public function setUseXml($flag) {
230
+        $this->useXml = LoggerOptionConverter::toBoolean($flag, $this->getUseXml());
231
+    } 
232 232
  
233
-	public function append(LoggerLoggingEvent $event) {
234
-		if($this->sp || $this->dry) {
235
-			if($this->getLocationInfo()) {
236
-				$event->getLocationInformation();
237
-			}
233
+    public function append(LoggerLoggingEvent $event) {
234
+        if($this->sp || $this->dry) {
235
+            if($this->getLocationInfo()) {
236
+                $event->getLocationInformation();
237
+            }
238 238
 		
239
-			if(!$this->getUseXml()) {
240
-				$sEvent = serialize($event);
241
-				if(!$this->dry) {
242
-					fwrite($this->sp, $sEvent, strlen($sEvent));
243
-				} else {
244
-				    echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
245
-				}
246
-			} else {
247
-				if(!$this->dry) {
248
-					fwrite($this->sp, $this->xmlLayout->format($event));
249
-				} else {
250
-				    echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
251
-				}
252
-			}			 
239
+            if(!$this->getUseXml()) {
240
+                $sEvent = serialize($event);
241
+                if(!$this->dry) {
242
+                    fwrite($this->sp, $sEvent, strlen($sEvent));
243
+                } else {
244
+                    echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
245
+                }
246
+            } else {
247
+                if(!$this->dry) {
248
+                    fwrite($this->sp, $this->xmlLayout->format($event));
249
+                } else {
250
+                    echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
251
+                }
252
+            }			 
253 253
 
254
-			// not sure about it...
255
-			if(!$this->dry) {
256
-				fflush($this->sp);
257
-			}
258
-		} 
259
-	}
254
+            // not sure about it...
255
+            if(!$this->dry) {
256
+                fflush($this->sp);
257
+            }
258
+        } 
259
+    }
260 260
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -102,15 +102,15 @@  discard block
 block discarded – undo
102 102
 	 * Create a socket connection using defined parameters
103 103
 	 */
104 104
 	public function activateOptions() {
105
-		if(!$this->dry) {
105
+		if (!$this->dry) {
106 106
 			$this->sp = @fsockopen($this->getRemoteHost(), $this->getPort(), $errno, $errstr, $this->getTimeout());
107 107
 			if ($this->sp === false) {
108 108
 			    throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
109 109
 			}
110 110
 		}
111
-		if($this->getUseXml()) {
111
+		if ($this->getUseXml()) {
112 112
 			$this->xmlLayout = LoggerReflectionUtils::createObject('LoggerLayoutXml');
113
-			if($this->xmlLayout === null) {
113
+			if ($this->xmlLayout === null) {
114 114
 				$this->setUseXml(false);
115 115
 			} else {
116 116
 				$this->xmlLayout->setLocationInfo($this->getLocationInfo());
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	}
123 123
 	
124 124
 	public function close() {
125
-		if($this->closed != true) {
126
-			if(!$this->dry and $this->sp !== false) {
125
+		if ($this->closed != true) {
126
+			if (!$this->dry and $this->sp !== false) {
127 127
 				fclose($this->sp);
128 128
 			}
129 129
 			$this->closed = true;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 */
205 205
 	public function setPort($port) {
206 206
 		$port = LoggerOptionConverter::toInt($port, 0);
207
-		if($port > 0 and $port < 65535) {
207
+		if ($port > 0 and $port < 65535) {
208 208
 			$this->port = $port;	
209 209
 		}
210 210
 	}
@@ -231,20 +231,20 @@  discard block
 block discarded – undo
231 231
 	} 
232 232
  
233 233
 	public function append(LoggerLoggingEvent $event) {
234
-		if($this->sp || $this->dry) {
235
-			if($this->getLocationInfo()) {
234
+		if ($this->sp || $this->dry) {
235
+			if ($this->getLocationInfo()) {
236 236
 				$event->getLocationInformation();
237 237
 			}
238 238
 		
239
-			if(!$this->getUseXml()) {
239
+			if (!$this->getUseXml()) {
240 240
 				$sEvent = serialize($event);
241
-				if(!$this->dry) {
241
+				if (!$this->dry) {
242 242
 					fwrite($this->sp, $sEvent, strlen($sEvent));
243 243
 				} else {
244 244
 				    echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
245 245
 				}
246 246
 			} else {
247
-				if(!$this->dry) {
247
+				if (!$this->dry) {
248 248
 					fwrite($this->sp, $this->xmlLayout->format($event));
249 249
 				} else {
250 250
 				    echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 			}			 
253 253
 
254 254
 			// not sure about it...
255
-			if(!$this->dry) {
255
+			if (!$this->dry) {
256 256
 				fflush($this->sp);
257 257
 			}
258 258
 		} 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorIni.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -279,7 +279,6 @@
 block discarded – undo
279 279
 	 * 
280 280
 	 * @param string $url The name of the configuration file where the
281 281
 	 *					  configuration information is stored.
282
-	 * @param LoggerHierarchy $repository the repository to apply the configuration
283 282
 	 */
284 283
 	public function configure(LoggerHierarchy $hierarchy, $url = '') {
285 284
 		$properties = @parse_ini_file($url);
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -313,16 +313,16 @@  discard block
 block discarded – undo
313 313
 		$effectivePrefix = self::ROOT_LOGGER_PREFIX;
314 314
 		$value = @$props[self::ROOT_LOGGER_PREFIX];
315 315
 
316
-		if(empty($value)) {
316
+		if (empty($value)) {
317 317
 			$value = @$props[self::ROOT_CATEGORY_PREFIX];
318 318
 			$effectivePrefix = self::ROOT_CATEGORY_PREFIX;
319 319
 		}
320 320
 
321
-		if(empty($value)) {
321
+		if (empty($value)) {
322 322
 			// TODO "Could not find root logger information. Is this OK?"
323 323
 		} else {
324 324
 			$root = $hierarchy->getRootLogger();
325
-			$this->parseCategory($props, $root, $effectivePrefix, self::INTERNAL_ROOT_NAME,	$value);
325
+			$this->parseCategory($props, $root, $effectivePrefix, self::INTERNAL_ROOT_NAME, $value);
326 326
 		}
327 327
 	}
328 328
 
@@ -333,19 +333,19 @@  discard block
 block discarded – undo
333 333
 	 * @param LoggerHierarchy $hierarchy
334 334
 	 */
335 335
 	private function parseCatsAndRenderers($props, LoggerHierarchy $hierarchy) {
336
-		while(list($key,$value) = each($props)) {
337
-			if(strpos($key, self::CATEGORY_PREFIX) === 0 or 
336
+		while (list($key, $value) = each($props)) {
337
+			if (strpos($key, self::CATEGORY_PREFIX) === 0 or 
338 338
 				strpos($key, self::LOGGER_PREFIX) === 0) {
339
-				if(strpos($key, self::CATEGORY_PREFIX) === 0) {
339
+				if (strpos($key, self::CATEGORY_PREFIX) === 0) {
340 340
 					$loggerName = substr($key, strlen(self::CATEGORY_PREFIX));
341
-				} else if(strpos($key, self::LOGGER_PREFIX) === 0) {
341
+				} else if (strpos($key, self::LOGGER_PREFIX) === 0) {
342 342
 					$loggerName = substr($key, strlen(self::LOGGER_PREFIX));
343 343
 				}
344 344
 				
345 345
 				$logger = $hierarchy->getLogger($loggerName);
346 346
 				$this->parseCategory($props, $logger, $key, $loggerName, $value);
347 347
 				$this->parseAdditivityForLogger($props, $logger, $loggerName);
348
-			} else if(strpos($key, self::RENDERER_PREFIX) === 0) {
348
+			} else if (strpos($key, self::RENDERER_PREFIX) === 0) {
349 349
 				$renderedClass = substr($key, strlen(self::RENDERER_PREFIX));
350 350
 				$renderingClass = $value;
351 351
 				$hierarchy->getRendererMap()->addRenderer($renderedClass, $renderingClass);
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 	 * @param string $loggerName
362 362
 	 */
363 363
 	private function parseAdditivityForLogger($props, Logger $cat, $loggerName) {
364
-		$value = LoggerOptionConverter::findAndSubst(self::ADDITIVITY_PREFIX . $loggerName, $props);
364
+		$value = LoggerOptionConverter::findAndSubst(self::ADDITIVITY_PREFIX.$loggerName, $props);
365 365
 		
366 366
 		// touch additivity only if necessary
367
-		if(!empty($value)) {
367
+		if (!empty($value)) {
368 368
 			$additivity = LoggerOptionConverter::toBoolean($value, true);
369 369
 			$cat->setAdditivity($additivity);
370 370
 		}
@@ -387,9 +387,9 @@  discard block
 block discarded – undo
387 387
 		// If value is not in the form ", appender.." or "", then we should set
388 388
 		// the level of the loggeregory.
389 389
 
390
-		if(!(empty($value) || @$value[0] == ',')) {
390
+		if (!(empty($value) || @$value[0] == ',')) {
391 391
 			// just to be on the safe side...
392
-			if(count($st) == 0) {
392
+			if (count($st) == 0) {
393 393
 				return;
394 394
 			}
395 395
 			$levelStr = current($st);
@@ -397,8 +397,8 @@  discard block
 block discarded – undo
397 397
 			// If the level value is inherited, set category level value to
398 398
 			// null. We also check that the user has not specified inherited for the
399 399
 			// root category.
400
-			if('INHERITED' == strtoupper($levelStr) || 'NULL' == strtoupper($levelStr)) {
401
-				if($loggerName == self::INTERNAL_ROOT_NAME) {
400
+			if ('INHERITED' == strtoupper($levelStr) || 'NULL' == strtoupper($levelStr)) {
401
+				if ($loggerName == self::INTERNAL_ROOT_NAME) {
402 402
 					// TODO: throw exception?	"The root logger cannot be set to null."
403 403
 				} else {
404 404
 					$logger->setLevel(null);
@@ -410,14 +410,14 @@  discard block
 block discarded – undo
410 410
 
411 411
 		// TODO: removing should be done by the logger, if necessary and wanted 
412 412
 		// $logger->removeAllAppenders();
413
-		while($appenderName = next($st)) {
413
+		while ($appenderName = next($st)) {
414 414
 			$appenderName = trim($appenderName);
415
-			if(empty($appenderName)) {
415
+			if (empty($appenderName)) {
416 416
 				continue;
417 417
 			}
418 418
 			
419 419
 			$appender = $this->parseAppender($props, $appenderName);
420
-			if($appender !== null) {
420
+			if ($appender !== null) {
421 421
 					$logger->addAppender($appender);
422 422
 			}
423 423
 		}
@@ -430,34 +430,34 @@  discard block
 block discarded – undo
430 430
 	 */
431 431
 	private function parseAppender($props, $appenderName) {
432 432
 		$appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
433
-		$prefix = self::APPENDER_PREFIX . $appenderName;
434
-		if($appender === null) {
433
+		$prefix = self::APPENDER_PREFIX.$appenderName;
434
+		if ($appender === null) {
435 435
 			// Appender was not previously initialized.
436 436
 			$appenderClass = @$props[$prefix];
437 437
 			$appender = LoggerAppenderPool::getAppenderFromPool($appenderName, $appenderClass);
438
-			if($appender === null) {
438
+			if ($appender === null) {
439 439
 				return null;
440 440
 			}
441 441
 		}
442 442
 		
443
-		if($appender->requiresLayout() ) {
444
-			$layoutPrefix = $prefix . ".layout";
443
+		if ($appender->requiresLayout()) {
444
+			$layoutPrefix = $prefix.".layout";
445 445
 			$layoutClass = @$props[$layoutPrefix];
446 446
 			$layoutClass = LoggerOptionConverter::substVars($layoutClass, $props);
447
-			if(empty($layoutClass)) {
447
+			if (empty($layoutClass)) {
448 448
 				$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
449 449
 			} else {
450 450
 				$layout = LoggerReflectionUtils::createObject($layoutClass);
451
-				if($layout === null) {
451
+				if ($layout === null) {
452 452
 					$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
453 453
 				}
454 454
 			}
455 455
 			
456
-			LoggerReflectionUtils::setPropertiesByObject($layout, $props, $layoutPrefix . ".");				  
456
+			LoggerReflectionUtils::setPropertiesByObject($layout, $props, $layoutPrefix.".");				  
457 457
 			$appender->setLayout($layout);
458 458
 			
459 459
 		}
460
-		LoggerReflectionUtils::setPropertiesByObject($appender, $props, $prefix . ".");
460
+		LoggerReflectionUtils::setPropertiesByObject($appender, $props, $prefix.".");
461 461
 		return $appender;		 
462 462
 	}
463 463
 }
Please login to merge, or discard this patch.
Indentation   +376 added lines, -376 removed lines patch added patch discarded remove patch
@@ -63,401 +63,401 @@
 block discarded – undo
63 63
  * @since 0.5
64 64
  */
65 65
 class LoggerConfiguratorIni implements LoggerConfigurator {
66
- 	const CATEGORY_PREFIX = "log4php.category.";
67
- 	const LOGGER_PREFIX = "log4php.logger.";
68
-	const FACTORY_PREFIX = "log4php.factory";
69
-	const ADDITIVITY_PREFIX = "log4php.additivity.";
70
-	const ROOT_CATEGORY_PREFIX = "log4php.rootCategory";
71
-	const ROOT_LOGGER_PREFIX = "log4php.rootLogger";
72
-	const APPENDER_PREFIX = "log4php.appender.";
73
-	const RENDERER_PREFIX = "log4php.renderer.";
74
-	const THRESHOLD_PREFIX = "log4php.threshold";
66
+        const CATEGORY_PREFIX = "log4php.category.";
67
+        const LOGGER_PREFIX = "log4php.logger.";
68
+    const FACTORY_PREFIX = "log4php.factory";
69
+    const ADDITIVITY_PREFIX = "log4php.additivity.";
70
+    const ROOT_CATEGORY_PREFIX = "log4php.rootCategory";
71
+    const ROOT_LOGGER_PREFIX = "log4php.rootLogger";
72
+    const APPENDER_PREFIX = "log4php.appender.";
73
+    const RENDERER_PREFIX = "log4php.renderer.";
74
+    const THRESHOLD_PREFIX = "log4php.threshold";
75 75
 	
76
-	/** 
77
-	 * Key for specifying the {@link LoggerFactory}.  
78
-	 */
79
-	const LOGGER_FACTORY_KEY = "log4php.loggerFactory";
80
-	const LOGGER_DEBUG_KEY = "log4php.debug";
81
-	const INTERNAL_ROOT_NAME = "root";
76
+    /** 
77
+     * Key for specifying the {@link LoggerFactory}.  
78
+     */
79
+    const LOGGER_FACTORY_KEY = "log4php.loggerFactory";
80
+    const LOGGER_DEBUG_KEY = "log4php.debug";
81
+    const INTERNAL_ROOT_NAME = "root";
82 82
 	
83
-	/**
84
-	 * Constructor
85
-	 */
86
-	public function __construct() {
87
-	}
83
+    /**
84
+     * Constructor
85
+     */
86
+    public function __construct() {
87
+    }
88 88
 
89
-	/**
90
-	 * Read configuration from a file.
91
-	 *
92
-	 * <p>The function {@link PHP_MANUAL#parse_ini_file} is used to read the
93
-	 * file.</p>
94
-	 *
95
-	 * <b>The existing configuration is not cleared nor reset.</b> 
96
-	 * If you require a different behavior, then call 
97
-	 * {@link  Logger::resetConfiguration()} 
98
-	 * method before calling {@link doConfigure()}.
99
-	 * 
100
-	 * <p>The configuration file consists of statements in the format
101
-	 * <b>key=value</b>. The syntax of different configuration
102
-	 * elements are discussed below.
103
-	 * 
104
-	 * <p><b>Repository-wide threshold</b></p>
105
-	 * 
106
-	 * <p>The repository-wide threshold filters logging requests by level
107
-	 * regardless of logger. The syntax is:
108
-	 * 
109
-	 * <pre>
110
-	 * log4php.threshold=[level]
111
-	 * </pre>
112
-	 * 
113
-	 * <p>The level value can consist of the string values OFF, FATAL,
114
-	 * ERROR, WARN, INFO, DEBUG, ALL or a <i>custom level</i> value. A
115
-	 * custom level value can be specified in the form
116
-	 * <samp>level#classname</samp>. By default the repository-wide threshold is set
117
-	 * to the lowest possible value, namely the level <b>ALL</b>.
118
-	 * </p>
119
-	 * 
120
-	 * 
121
-	 * <p><b>Appender configuration</b></p>
122
-	 * 
123
-	 * <p>Appender configuration syntax is:</p>
124
-	 * <pre>
125
-	 * ; For appender named <i>appenderName</i>, set its class.
126
-	 * ; Note: The appender name can contain dots.
127
-	 * log4php.appender.appenderName=name_of_appender_class
128
-	 * 
129
-	 * ; Set appender specific options.
130
-	 * 
131
-	 * log4php.appender.appenderName.option1=value1
132
-	 * log4php.appender.appenderName.optionN=valueN
133
-	 * </pre>
134
-	 * 
135
-	 * For each named appender you can configure its {@link LoggerLayout}. The
136
-	 * syntax for configuring an appender's layout is:
137
-	 * <pre>
138
-	 * log4php.appender.appenderName.layout=name_of_layout_class
139
-	 * log4php.appender.appenderName.layout.option1=value1
140
-	 *	....
141
-	 * log4php.appender.appenderName.layout.optionN=valueN
142
-	 * </pre>
143
-	 * 
144
-	 * <p><b>Configuring loggers</b></p>
145
-	 * 
146
-	 * <p>The syntax for configuring the root logger is:
147
-	 * <pre>
148
-	 * log4php.rootLogger=[level], appenderName, appenderName, ...
149
-	 * </pre>
150
-	 * 
151
-	 * <p>This syntax means that an optional <i>level</i> can be
152
-	 * supplied followed by appender names separated by commas.
153
-	 * 
154
-	 * <p>The level value can consist of the string values OFF, FATAL,
155
-	 * ERROR, WARN, INFO, DEBUG, ALL or a <i>custom level</i> value. A
156
-	 * custom level value can be specified in the form</p>
157
-	 *
158
-	 * <pre>level#classname</pre>
159
-	 * 
160
-	 * <p>If a level value is specified, then the root level is set
161
-	 * to the corresponding level.	If no level value is specified,
162
-	 * then the root level remains untouched.
163
-	 * 
164
-	 * <p>The root logger can be assigned multiple appenders.
165
-	 * 
166
-	 * <p>Each <i>appenderName</i> (separated by commas) will be added to
167
-	 * the root logger. The named appender is defined using the
168
-	 * appender syntax defined above.
169
-	 * 
170
-	 * <p>For non-root categories the syntax is almost the same:
171
-	 * <pre>
172
-	 * log4php.logger.logger_name=[level|INHERITED|NULL], appenderName, appenderName, ...
173
-	 * </pre>
174
-	 * 
175
-	 * <p>The meaning of the optional level value is discussed above
176
-	 * in relation to the root logger. In addition however, the value
177
-	 * INHERITED can be specified meaning that the named logger should
178
-	 * inherit its level from the logger hierarchy.</p>
179
-	 * 
180
-	 * <p>If no level value is supplied, then the level of the
181
-	 * named logger remains untouched.</p>
182
-	 * 
183
-	 * <p>By default categories inherit their level from the
184
-	 * hierarchy. However, if you set the level of a logger and later
185
-	 * decide that that logger should inherit its level, then you should
186
-	 * specify INHERITED as the value for the level value. NULL is a
187
-	 * synonym for INHERITED.</p>
188
-	 * 
189
-	 * <p>Similar to the root logger syntax, each <i>appenderName</i>
190
-	 * (separated by commas) will be attached to the named logger.</p>
191
-	 * 
192
-	 * <p>See the <i>appender additivity rule</i> in the user manual for 
193
-	 * the meaning of the <b>additivity</b> flag.
194
-	 * 
195
-	 * <p><b>ObjectRenderers</b></p>
196
-	 * 
197
-	 * <p>You can customize the way message objects of a given type are
198
-	 * converted to String before being logged. This is done by
199
-	 * specifying a {@link LoggerRendererObject}
200
-	 * for the object type would like to customize.</p>
201
-	 * 
202
-	 * <p>The syntax is:
203
-	 * 
204
-	 * <pre>
205
-	 * log4php.renderer.name_of_rendered_class=name_of_rendering.class
206
-	 * </pre>
207
-	 * 
208
-	 * As in,
209
-	 * <pre>
210
-	 * log4php.renderer.myFruit=myFruitRenderer
211
-	 * </pre>
212
-	 * 
213
-	 * <p><b>Logger Factories</b></p>
214
-	 * 
215
-	 * The usage of custom logger factories is discouraged and no longer
216
-	 * documented.
217
-	 * 
218
-	 * <p><b>Example</b></p>
219
-	 * 
220
-	 * <p>An example configuration is given below. Other configuration
221
-	 * file examples are given in the <b>tests</b> folder.
222
-	 * 
223
-	 * <pre>
224
-	 * ; Set options for appender named "A1".
225
-	 * ; Appender "A1" will be a LoggerAppenderSyslog
226
-	 * log4php.appender.A1=LoggerAppenderSyslog
227
-	 * 
228
-	 * ; The syslog daemon resides on www.abc.net
229
-	 * log4php.appender.A1.ident=log4php-test
230
-	 * 
231
-	 * ; A1's layout is a LoggerPatternLayout, using the conversion pattern
232
-	 * ; <b>%r %-5p %c{2} %M.%L %x - %m%n</b>. Thus, the log output will
233
-	 * ; include the relative time since the start of the application in
234
-	 * ; milliseconds, followed by the level of the log request,
235
-	 * ; followed by the two rightmost components of the logger name,
236
-	 * ; followed by the callers method name, followed by the line number,
237
-	 * ; the nested disgnostic context and finally the message itself.
238
-	 * ; Refer to the documentation of LoggerPatternLayout} for further information
239
-	 * ; on the syntax of the ConversionPattern key.
240
-	 * log4php.appender.A1.layout=LoggerPatternLayout
241
-	 * log4php.appender.A1.layout.ConversionPattern="%-4r %-5p %c{2} %M.%L %x - %m%n"
242
-	 * 
243
-	 * ; Set options for appender named "A2"
244
-	 * ; A2 should be a LoggerAppenderRollingFile, with maximum file size of 10 MB
245
-	 * ; using at most one backup file. A2's layout is TTCC, using the
246
-	 * ; ISO8061 date format with context printing enabled.
247
-	 * log4php.appender.A2=LoggerAppenderRollingFile
248
-	 * log4php.appender.A2.MaxFileSize=10MB
249
-	 * log4php.appender.A2.MaxBackupIndex=1
250
-	 * log4php.appender.A2.layout=LoggerLayoutTTCC
251
-	 * log4php.appender.A2.layout.ContextPrinting="true"
252
-	 * log4php.appender.A2.layout.DateFormat="%c"
253
-	 * 
254
-	 * ; Root logger set to DEBUG using the A2 appender defined above.
255
-	 * log4php.rootLogger=DEBUG, A2
256
-	 * 
257
-	 * ; Logger definitions:
258
-	 * ; The SECURITY logger inherits is level from root. However, it's output
259
-	 * ; will go to A1 appender defined above. It's additivity is non-cumulative.
260
-	 * log4php.logger.SECURITY=INHERIT, A1
261
-	 * log4php.additivity.SECURITY=false
262
-	 * 
263
-	 * ; Only warnings or above will be logged for the logger "SECURITY.access".
264
-	 * ; Output will go to A1.
265
-	 * log4php.logger.SECURITY.access=WARN
266
-	 * 
267
-	 * 
268
-	 * ; The logger "class.of.the.day" inherits its level from the
269
-	 * ; logger hierarchy.	Output will go to the appender's of the root
270
-	 * ; logger, A2 in this case.
271
-	 * log4php.logger.class.of.the.day=INHERIT
272
-	 * </pre>
273
-	 * 
274
-	 * <p>Refer to the <b>setOption</b> method in each Appender and
275
-	 * Layout for class specific options.</p>
276
-	 * 
277
-	 * <p>Use the <b>&quot;;&quot;</b> character at the
278
-	 * beginning of a line for comments.</p>
279
-	 * 
280
-	 * @param string $url The name of the configuration file where the
281
-	 *					  configuration information is stored.
282
-	 * @param LoggerHierarchy $repository the repository to apply the configuration
283
-	 */
284
-	public function configure(LoggerHierarchy $hierarchy, $url = '') {
285
-		$properties = @parse_ini_file($url);
286
-		if ($properties === false || count($properties) == 0) {
287
-			$error = error_get_last();
288
-		    throw new LoggerException("LoggerConfiguratorIni: ".$error['message']);
289
-		}
290
-		return $this->doConfigureProperties($properties, $hierarchy);
291
-	}
89
+    /**
90
+     * Read configuration from a file.
91
+     *
92
+     * <p>The function {@link PHP_MANUAL#parse_ini_file} is used to read the
93
+     * file.</p>
94
+     *
95
+     * <b>The existing configuration is not cleared nor reset.</b> 
96
+     * If you require a different behavior, then call 
97
+     * {@link  Logger::resetConfiguration()} 
98
+     * method before calling {@link doConfigure()}.
99
+     * 
100
+     * <p>The configuration file consists of statements in the format
101
+     * <b>key=value</b>. The syntax of different configuration
102
+     * elements are discussed below.
103
+     * 
104
+     * <p><b>Repository-wide threshold</b></p>
105
+     * 
106
+     * <p>The repository-wide threshold filters logging requests by level
107
+     * regardless of logger. The syntax is:
108
+     * 
109
+     * <pre>
110
+     * log4php.threshold=[level]
111
+     * </pre>
112
+     * 
113
+     * <p>The level value can consist of the string values OFF, FATAL,
114
+     * ERROR, WARN, INFO, DEBUG, ALL or a <i>custom level</i> value. A
115
+     * custom level value can be specified in the form
116
+     * <samp>level#classname</samp>. By default the repository-wide threshold is set
117
+     * to the lowest possible value, namely the level <b>ALL</b>.
118
+     * </p>
119
+     * 
120
+     * 
121
+     * <p><b>Appender configuration</b></p>
122
+     * 
123
+     * <p>Appender configuration syntax is:</p>
124
+     * <pre>
125
+     * ; For appender named <i>appenderName</i>, set its class.
126
+     * ; Note: The appender name can contain dots.
127
+     * log4php.appender.appenderName=name_of_appender_class
128
+     * 
129
+     * ; Set appender specific options.
130
+     * 
131
+     * log4php.appender.appenderName.option1=value1
132
+     * log4php.appender.appenderName.optionN=valueN
133
+     * </pre>
134
+     * 
135
+     * For each named appender you can configure its {@link LoggerLayout}. The
136
+     * syntax for configuring an appender's layout is:
137
+     * <pre>
138
+     * log4php.appender.appenderName.layout=name_of_layout_class
139
+     * log4php.appender.appenderName.layout.option1=value1
140
+     *	....
141
+     * log4php.appender.appenderName.layout.optionN=valueN
142
+     * </pre>
143
+     * 
144
+     * <p><b>Configuring loggers</b></p>
145
+     * 
146
+     * <p>The syntax for configuring the root logger is:
147
+     * <pre>
148
+     * log4php.rootLogger=[level], appenderName, appenderName, ...
149
+     * </pre>
150
+     * 
151
+     * <p>This syntax means that an optional <i>level</i> can be
152
+     * supplied followed by appender names separated by commas.
153
+     * 
154
+     * <p>The level value can consist of the string values OFF, FATAL,
155
+     * ERROR, WARN, INFO, DEBUG, ALL or a <i>custom level</i> value. A
156
+     * custom level value can be specified in the form</p>
157
+     *
158
+     * <pre>level#classname</pre>
159
+     * 
160
+     * <p>If a level value is specified, then the root level is set
161
+     * to the corresponding level.	If no level value is specified,
162
+     * then the root level remains untouched.
163
+     * 
164
+     * <p>The root logger can be assigned multiple appenders.
165
+     * 
166
+     * <p>Each <i>appenderName</i> (separated by commas) will be added to
167
+     * the root logger. The named appender is defined using the
168
+     * appender syntax defined above.
169
+     * 
170
+     * <p>For non-root categories the syntax is almost the same:
171
+     * <pre>
172
+     * log4php.logger.logger_name=[level|INHERITED|NULL], appenderName, appenderName, ...
173
+     * </pre>
174
+     * 
175
+     * <p>The meaning of the optional level value is discussed above
176
+     * in relation to the root logger. In addition however, the value
177
+     * INHERITED can be specified meaning that the named logger should
178
+     * inherit its level from the logger hierarchy.</p>
179
+     * 
180
+     * <p>If no level value is supplied, then the level of the
181
+     * named logger remains untouched.</p>
182
+     * 
183
+     * <p>By default categories inherit their level from the
184
+     * hierarchy. However, if you set the level of a logger and later
185
+     * decide that that logger should inherit its level, then you should
186
+     * specify INHERITED as the value for the level value. NULL is a
187
+     * synonym for INHERITED.</p>
188
+     * 
189
+     * <p>Similar to the root logger syntax, each <i>appenderName</i>
190
+     * (separated by commas) will be attached to the named logger.</p>
191
+     * 
192
+     * <p>See the <i>appender additivity rule</i> in the user manual for 
193
+     * the meaning of the <b>additivity</b> flag.
194
+     * 
195
+     * <p><b>ObjectRenderers</b></p>
196
+     * 
197
+     * <p>You can customize the way message objects of a given type are
198
+     * converted to String before being logged. This is done by
199
+     * specifying a {@link LoggerRendererObject}
200
+     * for the object type would like to customize.</p>
201
+     * 
202
+     * <p>The syntax is:
203
+     * 
204
+     * <pre>
205
+     * log4php.renderer.name_of_rendered_class=name_of_rendering.class
206
+     * </pre>
207
+     * 
208
+     * As in,
209
+     * <pre>
210
+     * log4php.renderer.myFruit=myFruitRenderer
211
+     * </pre>
212
+     * 
213
+     * <p><b>Logger Factories</b></p>
214
+     * 
215
+     * The usage of custom logger factories is discouraged and no longer
216
+     * documented.
217
+     * 
218
+     * <p><b>Example</b></p>
219
+     * 
220
+     * <p>An example configuration is given below. Other configuration
221
+     * file examples are given in the <b>tests</b> folder.
222
+     * 
223
+     * <pre>
224
+     * ; Set options for appender named "A1".
225
+     * ; Appender "A1" will be a LoggerAppenderSyslog
226
+     * log4php.appender.A1=LoggerAppenderSyslog
227
+     * 
228
+     * ; The syslog daemon resides on www.abc.net
229
+     * log4php.appender.A1.ident=log4php-test
230
+     * 
231
+     * ; A1's layout is a LoggerPatternLayout, using the conversion pattern
232
+     * ; <b>%r %-5p %c{2} %M.%L %x - %m%n</b>. Thus, the log output will
233
+     * ; include the relative time since the start of the application in
234
+     * ; milliseconds, followed by the level of the log request,
235
+     * ; followed by the two rightmost components of the logger name,
236
+     * ; followed by the callers method name, followed by the line number,
237
+     * ; the nested disgnostic context and finally the message itself.
238
+     * ; Refer to the documentation of LoggerPatternLayout} for further information
239
+     * ; on the syntax of the ConversionPattern key.
240
+     * log4php.appender.A1.layout=LoggerPatternLayout
241
+     * log4php.appender.A1.layout.ConversionPattern="%-4r %-5p %c{2} %M.%L %x - %m%n"
242
+     * 
243
+     * ; Set options for appender named "A2"
244
+     * ; A2 should be a LoggerAppenderRollingFile, with maximum file size of 10 MB
245
+     * ; using at most one backup file. A2's layout is TTCC, using the
246
+     * ; ISO8061 date format with context printing enabled.
247
+     * log4php.appender.A2=LoggerAppenderRollingFile
248
+     * log4php.appender.A2.MaxFileSize=10MB
249
+     * log4php.appender.A2.MaxBackupIndex=1
250
+     * log4php.appender.A2.layout=LoggerLayoutTTCC
251
+     * log4php.appender.A2.layout.ContextPrinting="true"
252
+     * log4php.appender.A2.layout.DateFormat="%c"
253
+     * 
254
+     * ; Root logger set to DEBUG using the A2 appender defined above.
255
+     * log4php.rootLogger=DEBUG, A2
256
+     * 
257
+     * ; Logger definitions:
258
+     * ; The SECURITY logger inherits is level from root. However, it's output
259
+     * ; will go to A1 appender defined above. It's additivity is non-cumulative.
260
+     * log4php.logger.SECURITY=INHERIT, A1
261
+     * log4php.additivity.SECURITY=false
262
+     * 
263
+     * ; Only warnings or above will be logged for the logger "SECURITY.access".
264
+     * ; Output will go to A1.
265
+     * log4php.logger.SECURITY.access=WARN
266
+     * 
267
+     * 
268
+     * ; The logger "class.of.the.day" inherits its level from the
269
+     * ; logger hierarchy.	Output will go to the appender's of the root
270
+     * ; logger, A2 in this case.
271
+     * log4php.logger.class.of.the.day=INHERIT
272
+     * </pre>
273
+     * 
274
+     * <p>Refer to the <b>setOption</b> method in each Appender and
275
+     * Layout for class specific options.</p>
276
+     * 
277
+     * <p>Use the <b>&quot;;&quot;</b> character at the
278
+     * beginning of a line for comments.</p>
279
+     * 
280
+     * @param string $url The name of the configuration file where the
281
+     *					  configuration information is stored.
282
+     * @param LoggerHierarchy $repository the repository to apply the configuration
283
+     */
284
+    public function configure(LoggerHierarchy $hierarchy, $url = '') {
285
+        $properties = @parse_ini_file($url);
286
+        if ($properties === false || count($properties) == 0) {
287
+            $error = error_get_last();
288
+            throw new LoggerException("LoggerConfiguratorIni: ".$error['message']);
289
+        }
290
+        return $this->doConfigureProperties($properties, $hierarchy);
291
+    }
292 292
 
293
-	/**
294
-	 * Read configuration options from <b>properties</b>.
295
-	 *
296
-	 * @see doConfigure().
297
-	 * @param array $properties
298
-	 * @param LoggerHierarchy $hierarchy
299
-	 */
300
-	private function doConfigureProperties($properties, LoggerHierarchy $hierarchy) {
301
-		$thresholdStr = @$properties[self::THRESHOLD_PREFIX];
302
-		$hierarchy->setThreshold(LoggerOptionConverter::toLevel($thresholdStr, LoggerLevel::getLevelAll()));
303
-		$this->configureRootCategory($properties, $hierarchy);
304
-		$this->parseCatsAndRenderers($properties, $hierarchy);
305
-		return true;
306
-	}
293
+    /**
294
+     * Read configuration options from <b>properties</b>.
295
+     *
296
+     * @see doConfigure().
297
+     * @param array $properties
298
+     * @param LoggerHierarchy $hierarchy
299
+     */
300
+    private function doConfigureProperties($properties, LoggerHierarchy $hierarchy) {
301
+        $thresholdStr = @$properties[self::THRESHOLD_PREFIX];
302
+        $hierarchy->setThreshold(LoggerOptionConverter::toLevel($thresholdStr, LoggerLevel::getLevelAll()));
303
+        $this->configureRootCategory($properties, $hierarchy);
304
+        $this->parseCatsAndRenderers($properties, $hierarchy);
305
+        return true;
306
+    }
307 307
 
308
-	/**
309
-	 * @param array $props array of properties
310
-	 * @param LoggerHierarchy $hierarchy
311
-	 */
312
-	private function configureRootCategory($props, LoggerHierarchy $hierarchy) {
313
-		$effectivePrefix = self::ROOT_LOGGER_PREFIX;
314
-		$value = @$props[self::ROOT_LOGGER_PREFIX];
308
+    /**
309
+     * @param array $props array of properties
310
+     * @param LoggerHierarchy $hierarchy
311
+     */
312
+    private function configureRootCategory($props, LoggerHierarchy $hierarchy) {
313
+        $effectivePrefix = self::ROOT_LOGGER_PREFIX;
314
+        $value = @$props[self::ROOT_LOGGER_PREFIX];
315 315
 
316
-		if(empty($value)) {
317
-			$value = @$props[self::ROOT_CATEGORY_PREFIX];
318
-			$effectivePrefix = self::ROOT_CATEGORY_PREFIX;
319
-		}
316
+        if(empty($value)) {
317
+            $value = @$props[self::ROOT_CATEGORY_PREFIX];
318
+            $effectivePrefix = self::ROOT_CATEGORY_PREFIX;
319
+        }
320 320
 
321
-		if(empty($value)) {
322
-			// TODO "Could not find root logger information. Is this OK?"
323
-		} else {
324
-			$root = $hierarchy->getRootLogger();
325
-			$this->parseCategory($props, $root, $effectivePrefix, self::INTERNAL_ROOT_NAME,	$value);
326
-		}
327
-	}
321
+        if(empty($value)) {
322
+            // TODO "Could not find root logger information. Is this OK?"
323
+        } else {
324
+            $root = $hierarchy->getRootLogger();
325
+            $this->parseCategory($props, $root, $effectivePrefix, self::INTERNAL_ROOT_NAME,	$value);
326
+        }
327
+    }
328 328
 
329
-	/**
330
-	 * Parse non-root elements, such non-root categories and renderers.
331
-	 *
332
-	 * @param array $props array of properties
333
-	 * @param LoggerHierarchy $hierarchy
334
-	 */
335
-	private function parseCatsAndRenderers($props, LoggerHierarchy $hierarchy) {
336
-		while(list($key,$value) = each($props)) {
337
-			if(strpos($key, self::CATEGORY_PREFIX) === 0 or 
338
-				strpos($key, self::LOGGER_PREFIX) === 0) {
339
-				if(strpos($key, self::CATEGORY_PREFIX) === 0) {
340
-					$loggerName = substr($key, strlen(self::CATEGORY_PREFIX));
341
-				} else if(strpos($key, self::LOGGER_PREFIX) === 0) {
342
-					$loggerName = substr($key, strlen(self::LOGGER_PREFIX));
343
-				}
329
+    /**
330
+     * Parse non-root elements, such non-root categories and renderers.
331
+     *
332
+     * @param array $props array of properties
333
+     * @param LoggerHierarchy $hierarchy
334
+     */
335
+    private function parseCatsAndRenderers($props, LoggerHierarchy $hierarchy) {
336
+        while(list($key,$value) = each($props)) {
337
+            if(strpos($key, self::CATEGORY_PREFIX) === 0 or 
338
+                strpos($key, self::LOGGER_PREFIX) === 0) {
339
+                if(strpos($key, self::CATEGORY_PREFIX) === 0) {
340
+                    $loggerName = substr($key, strlen(self::CATEGORY_PREFIX));
341
+                } else if(strpos($key, self::LOGGER_PREFIX) === 0) {
342
+                    $loggerName = substr($key, strlen(self::LOGGER_PREFIX));
343
+                }
344 344
 				
345
-				$logger = $hierarchy->getLogger($loggerName);
346
-				$this->parseCategory($props, $logger, $key, $loggerName, $value);
347
-				$this->parseAdditivityForLogger($props, $logger, $loggerName);
348
-			} else if(strpos($key, self::RENDERER_PREFIX) === 0) {
349
-				$renderedClass = substr($key, strlen(self::RENDERER_PREFIX));
350
-				$renderingClass = $value;
351
-				$hierarchy->getRendererMap()->addRenderer($renderedClass, $renderingClass);
352
-			}
353
-		}
354
-	}
345
+                $logger = $hierarchy->getLogger($loggerName);
346
+                $this->parseCategory($props, $logger, $key, $loggerName, $value);
347
+                $this->parseAdditivityForLogger($props, $logger, $loggerName);
348
+            } else if(strpos($key, self::RENDERER_PREFIX) === 0) {
349
+                $renderedClass = substr($key, strlen(self::RENDERER_PREFIX));
350
+                $renderingClass = $value;
351
+                $hierarchy->getRendererMap()->addRenderer($renderedClass, $renderingClass);
352
+            }
353
+        }
354
+    }
355 355
 
356
-	/**
357
-	 * Parse the additivity option for a non-root category.
358
-	 *
359
-	 * @param array $props array of properties
360
-	 * @param Logger $cat
361
-	 * @param string $loggerName
362
-	 */
363
-	private function parseAdditivityForLogger($props, Logger $cat, $loggerName) {
364
-		$value = LoggerOptionConverter::findAndSubst(self::ADDITIVITY_PREFIX . $loggerName, $props);
356
+    /**
357
+     * Parse the additivity option for a non-root category.
358
+     *
359
+     * @param array $props array of properties
360
+     * @param Logger $cat
361
+     * @param string $loggerName
362
+     */
363
+    private function parseAdditivityForLogger($props, Logger $cat, $loggerName) {
364
+        $value = LoggerOptionConverter::findAndSubst(self::ADDITIVITY_PREFIX . $loggerName, $props);
365 365
 		
366
-		// touch additivity only if necessary
367
-		if(!empty($value)) {
368
-			$additivity = LoggerOptionConverter::toBoolean($value, true);
369
-			$cat->setAdditivity($additivity);
370
-		}
371
-	}
366
+        // touch additivity only if necessary
367
+        if(!empty($value)) {
368
+            $additivity = LoggerOptionConverter::toBoolean($value, true);
369
+            $cat->setAdditivity($additivity);
370
+        }
371
+    }
372 372
 
373
-	/**
374
-	 * This method must work for the root category as well.
375
-	 *
376
-	 * @param array $props array of properties
377
-	 * @param Logger $logger
378
-	 * @param string $optionKey
379
-	 * @param string $loggerName
380
-	 * @param string $value
381
-	 * @return Logger
382
-	 */
383
-	private function parseCategory($props, Logger $logger, $optionKey, $loggerName, $value) {
384
-		// We must skip over ',' but not white space
385
-		$st = explode(',', $value);
373
+    /**
374
+     * This method must work for the root category as well.
375
+     *
376
+     * @param array $props array of properties
377
+     * @param Logger $logger
378
+     * @param string $optionKey
379
+     * @param string $loggerName
380
+     * @param string $value
381
+     * @return Logger
382
+     */
383
+    private function parseCategory($props, Logger $logger, $optionKey, $loggerName, $value) {
384
+        // We must skip over ',' but not white space
385
+        $st = explode(',', $value);
386 386
 
387
-		// If value is not in the form ", appender.." or "", then we should set
388
-		// the level of the loggeregory.
387
+        // If value is not in the form ", appender.." or "", then we should set
388
+        // the level of the loggeregory.
389 389
 
390
-		if(!(empty($value) || @$value[0] == ',')) {
391
-			// just to be on the safe side...
392
-			if(count($st) == 0) {
393
-				return;
394
-			}
395
-			$levelStr = current($st);
390
+        if(!(empty($value) || @$value[0] == ',')) {
391
+            // just to be on the safe side...
392
+            if(count($st) == 0) {
393
+                return;
394
+            }
395
+            $levelStr = current($st);
396 396
 			
397
-			// If the level value is inherited, set category level value to
398
-			// null. We also check that the user has not specified inherited for the
399
-			// root category.
400
-			if('INHERITED' == strtoupper($levelStr) || 'NULL' == strtoupper($levelStr)) {
401
-				if($loggerName == self::INTERNAL_ROOT_NAME) {
402
-					// TODO: throw exception?	"The root logger cannot be set to null."
403
-				} else {
404
-					$logger->setLevel(null);
405
-				}
406
-			} else {
407
-				$logger->setLevel(LoggerOptionConverter::toLevel($levelStr, LoggerLevel::getLevelDebug()));
408
-			}
409
-		}
397
+            // If the level value is inherited, set category level value to
398
+            // null. We also check that the user has not specified inherited for the
399
+            // root category.
400
+            if('INHERITED' == strtoupper($levelStr) || 'NULL' == strtoupper($levelStr)) {
401
+                if($loggerName == self::INTERNAL_ROOT_NAME) {
402
+                    // TODO: throw exception?	"The root logger cannot be set to null."
403
+                } else {
404
+                    $logger->setLevel(null);
405
+                }
406
+            } else {
407
+                $logger->setLevel(LoggerOptionConverter::toLevel($levelStr, LoggerLevel::getLevelDebug()));
408
+            }
409
+        }
410 410
 
411
-		// TODO: removing should be done by the logger, if necessary and wanted 
412
-		// $logger->removeAllAppenders();
413
-		while($appenderName = next($st)) {
414
-			$appenderName = trim($appenderName);
415
-			if(empty($appenderName)) {
416
-				continue;
417
-			}
411
+        // TODO: removing should be done by the logger, if necessary and wanted 
412
+        // $logger->removeAllAppenders();
413
+        while($appenderName = next($st)) {
414
+            $appenderName = trim($appenderName);
415
+            if(empty($appenderName)) {
416
+                continue;
417
+            }
418 418
 			
419
-			$appender = $this->parseAppender($props, $appenderName);
420
-			if($appender !== null) {
421
-					$logger->addAppender($appender);
422
-			}
423
-		}
424
-	}
419
+            $appender = $this->parseAppender($props, $appenderName);
420
+            if($appender !== null) {
421
+                    $logger->addAppender($appender);
422
+            }
423
+        }
424
+    }
425 425
 
426
-	/**
427
-	 * @param array $props array of properties
428
-	 * @param string $appenderName
429
-	 * @return LoggerAppender
430
-	 */
431
-	private function parseAppender($props, $appenderName) {
432
-		$appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
433
-		$prefix = self::APPENDER_PREFIX . $appenderName;
434
-		if($appender === null) {
435
-			// Appender was not previously initialized.
436
-			$appenderClass = @$props[$prefix];
437
-			$appender = LoggerAppenderPool::getAppenderFromPool($appenderName, $appenderClass);
438
-			if($appender === null) {
439
-				return null;
440
-			}
441
-		}
426
+    /**
427
+     * @param array $props array of properties
428
+     * @param string $appenderName
429
+     * @return LoggerAppender
430
+     */
431
+    private function parseAppender($props, $appenderName) {
432
+        $appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
433
+        $prefix = self::APPENDER_PREFIX . $appenderName;
434
+        if($appender === null) {
435
+            // Appender was not previously initialized.
436
+            $appenderClass = @$props[$prefix];
437
+            $appender = LoggerAppenderPool::getAppenderFromPool($appenderName, $appenderClass);
438
+            if($appender === null) {
439
+                return null;
440
+            }
441
+        }
442 442
 		
443
-		if($appender->requiresLayout() ) {
444
-			$layoutPrefix = $prefix . ".layout";
445
-			$layoutClass = @$props[$layoutPrefix];
446
-			$layoutClass = LoggerOptionConverter::substVars($layoutClass, $props);
447
-			if(empty($layoutClass)) {
448
-				$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
449
-			} else {
450
-				$layout = LoggerReflectionUtils::createObject($layoutClass);
451
-				if($layout === null) {
452
-					$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
453
-				}
454
-			}
443
+        if($appender->requiresLayout() ) {
444
+            $layoutPrefix = $prefix . ".layout";
445
+            $layoutClass = @$props[$layoutPrefix];
446
+            $layoutClass = LoggerOptionConverter::substVars($layoutClass, $props);
447
+            if(empty($layoutClass)) {
448
+                $layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
449
+            } else {
450
+                $layout = LoggerReflectionUtils::createObject($layoutClass);
451
+                if($layout === null) {
452
+                    $layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
453
+                }
454
+            }
455 455
 			
456
-			LoggerReflectionUtils::setPropertiesByObject($layout, $props, $layoutPrefix . ".");				  
457
-			$appender->setLayout($layout);
456
+            LoggerReflectionUtils::setPropertiesByObject($layout, $props, $layoutPrefix . ".");				  
457
+            $appender->setLayout($layout);
458 458
 			
459
-		}
460
-		LoggerReflectionUtils::setPropertiesByObject($appender, $props, $prefix . ".");
461
-		return $appender;		 
462
-	}
459
+        }
460
+        LoggerReflectionUtils::setPropertiesByObject($appender, $props, $prefix . ".");
461
+        return $appender;		 
462
+    }
463 463
 }
Please login to merge, or discard this patch.