@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | if ($type != '') |
193 | 193 | $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
194 | - ':type="' . $type . '"'; |
|
194 | + ':type="' . $type . '"'; |
|
195 | 195 | |
196 | 196 | $this->_xml = $xmlAux . ' ' . CreateElement::NAMESPACEWORD . |
197 | 197 | ':id="' . (self::$_id - 2) . |
@@ -208,11 +208,11 @@ discard block |
||
208 | 208 | * @access protected |
209 | 209 | */ |
210 | 210 | protected function generateP($rsidR = '005F02E5', |
211 | - $rsidRDefault = '005F02E5', |
|
212 | - $rsidP = '005F02E5') |
|
211 | + $rsidRDefault = '005F02E5', |
|
212 | + $rsidP = '005F02E5') |
|
213 | 213 | { |
214 | 214 | $xml = '<' . CreateElement::NAMESPACEWORD . |
215 | - ':p>__GENERATEP__</' . CreateElement::NAMESPACEWORD . ':p>'; |
|
215 | + ':p>__GENERATEP__</' . CreateElement::NAMESPACEWORD . ':p>'; |
|
216 | 216 | |
217 | 217 | $this->_xml = str_replace('__GENERATEFOOTNOTE__', $xml, $this->_xml); |
218 | 218 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @access protected |
253 | 253 | */ |
254 | 254 | protected function generateSPACING($after = '0', |
255 | - $line = '240', $lineRule = 'auto') |
|
255 | + $line = '240', $lineRule = 'auto') |
|
256 | 256 | { |
257 | 257 | $xml = '<' . CreateElement::NAMESPACEWORD . |
258 | 258 | ':spacing w:after="' . $after . |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | protected function generateFONT($name = 'Calibri') |
128 | 128 | { |
129 | 129 | $this->_xml = '<' . CreateElement::NAMESPACEWORD . |
130 | - ':font ' . CreateDocx::NAMESPACEWORD . |
|
131 | - ':name="' . $name . |
|
132 | - '">__GENERATEFONT__</' . CreateElement::NAMESPACEWORD . |
|
133 | - ':font>'; |
|
130 | + ':font ' . CreateDocx::NAMESPACEWORD . |
|
131 | + ':name="' . $name . |
|
132 | + '">__GENERATEFONT__</' . CreateElement::NAMESPACEWORD . |
|
133 | + ':font>'; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | protected function generatePANOSE1($val = '020F0502020204030204') |
143 | 143 | { |
144 | 144 | $xml = '<' . CreateElement::NAMESPACEWORD . |
145 | - ':panose1 ' . CreateElement::NAMESPACEWORD . |
|
146 | - ':val="' . $val . |
|
147 | - '"></' . CreateElement::NAMESPACEWORD . |
|
148 | - ':panose1>__GENERATEPANOSE1__'; |
|
145 | + ':panose1 ' . CreateElement::NAMESPACEWORD . |
|
146 | + ':val="' . $val . |
|
147 | + '"></' . CreateElement::NAMESPACEWORD . |
|
148 | + ':panose1>__GENERATEPANOSE1__'; |
|
149 | 149 | |
150 | 150 | $this->_xml = str_replace('__GENERATEFONT__', $xml, $this->_xml); |
151 | 151 | } |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | protected function generateCHARSET($val = '00') |
160 | 160 | { |
161 | 161 | $xml = '<' . CreateElement::NAMESPACEWORD . |
162 | - ':charset ' . CreateElement::NAMESPACEWORD . |
|
163 | - ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD . |
|
164 | - ':charset>__GENERATECHARSET__'; |
|
162 | + ':charset ' . CreateElement::NAMESPACEWORD . |
|
163 | + ':val="' . $val . '"></' . CreateElement::NAMESPACEWORD . |
|
164 | + ':charset>__GENERATECHARSET__'; |
|
165 | 165 | |
166 | 166 | $this->_xml = str_replace('__GENERATEPANOSE1__', $xml, $this->_xml); |
167 | 167 | } |
@@ -212,18 +212,18 @@ discard block |
||
212 | 212 | * @access protected |
213 | 213 | */ |
214 | 214 | protected function generateSIG($usbA = 'A00002EF', $usbB = '4000207B', |
215 | - $usbC = '00000000', $usbD = '00000000', |
|
216 | - $csbA = '0000009F', $csbB = '00000000') |
|
215 | + $usbC = '00000000', $usbD = '00000000', |
|
216 | + $csbA = '0000009F', $csbB = '00000000') |
|
217 | 217 | { |
218 | 218 | $xml = '<' . CreateElement::NAMESPACEWORD . |
219 | - ':sig ' . CreateElement::NAMESPACEWORD . |
|
220 | - ':usb0="' . $usbA . '" ' . CreateElement::NAMESPACEWORD . |
|
221 | - ':usb1="' . $usbB . '" ' . CreateElement::NAMESPACEWORD . |
|
222 | - ':usb2="' . $usbC . '" ' . CreateElement::NAMESPACEWORD . |
|
223 | - ':usb3="' . $usbD . '" ' . CreateElement::NAMESPACEWORD . |
|
224 | - ':csb0="' . $csbA . '" ' . CreateElement::NAMESPACEWORD . |
|
225 | - ':csb1="' . $csbB . '"></' . CreateElement::NAMESPACEWORD . |
|
226 | - ':sig>'; |
|
219 | + ':sig ' . CreateElement::NAMESPACEWORD . |
|
220 | + ':usb0="' . $usbA . '" ' . CreateElement::NAMESPACEWORD . |
|
221 | + ':usb1="' . $usbB . '" ' . CreateElement::NAMESPACEWORD . |
|
222 | + ':usb2="' . $usbC . '" ' . CreateElement::NAMESPACEWORD . |
|
223 | + ':usb3="' . $usbD . '" ' . CreateElement::NAMESPACEWORD . |
|
224 | + ':csb0="' . $csbA . '" ' . CreateElement::NAMESPACEWORD . |
|
225 | + ':csb1="' . $csbB . '"></' . CreateElement::NAMESPACEWORD . |
|
226 | + ':sig>'; |
|
227 | 227 | |
228 | 228 | $this->_xml = str_replace('__GENERATEPITCH__', $xml, $this->_xml); |
229 | 229 | } |
@@ -119,10 +119,10 @@ |
||
119 | 119 | \h \z \u') |
120 | 120 | { |
121 | 121 | $xml = '<' . CreateElement::NAMESPACEWORD . |
122 | - ':fldSimple ' . CreateElement::NAMESPACEWORD . |
|
123 | - ':instr="' . $instr . |
|
124 | - '">__GENERATEP__</' . CreateElement::NAMESPACEWORD . |
|
125 | - ':fldSimple>'; |
|
122 | + ':fldSimple ' . CreateElement::NAMESPACEWORD . |
|
123 | + ':instr="' . $instr . |
|
124 | + '">__GENERATEP__</' . CreateElement::NAMESPACEWORD . |
|
125 | + ':fldSimple>'; |
|
126 | 126 | |
127 | 127 | $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml); |
128 | 128 | } |
@@ -516,7 +516,7 @@ |
||
516 | 516 | * @param string $themeFillTint |
517 | 517 | */ |
518 | 518 | protected function generateSHD($val, $color = '', $fill = '', |
519 | - $themeFill = '', $themeFillTint = '') |
|
519 | + $themeFill = '', $themeFillTint = '') |
|
520 | 520 | { |
521 | 521 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':shd ' . |
522 | 522 | CreateElement::NAMESPACEWORD . ':val="' . $val . '"'; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @access protected |
203 | 203 | */ |
204 | 204 | protected function generateSHD($val = 'horz-cross', $color = 'ff0000', |
205 | - $fill = '', $bgcolor = '', $themeFill = '') |
|
205 | + $fill = '', $bgcolor = '', $themeFill = '') |
|
206 | 206 | { |
207 | 207 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':shd w:val="' . |
208 | 208 | $val . '"'; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @access protected |
238 | 238 | */ |
239 | 239 | protected function generateTBLBOTTOM($val="single", $sz="4", $space='0', |
240 | - $color='auto') |
|
240 | + $color='auto') |
|
241 | 241 | { |
242 | 242 | $xml = '<' . CreateElement::NAMESPACEWORD . |
243 | 243 | ':bottom ' . CreateElement::NAMESPACEWORD . |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @access protected |
320 | 320 | */ |
321 | 321 | protected function generateTBLINSIDEH($val = "single", $sz = "4", |
322 | - $space = '0', $color = 'auto') |
|
322 | + $space = '0', $color = 'auto') |
|
323 | 323 | { |
324 | 324 | $xml = '<' . CreateElement::NAMESPACEWORD . |
325 | 325 | ':insideH ' . CreateElement::NAMESPACEWORD . |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | * @access protected |
342 | 342 | */ |
343 | 343 | protected function generateTBLINSIDEV($val = "single", $sz= "4", $space='0', |
344 | - $color= 'auto') |
|
344 | + $color= 'auto') |
|
345 | 345 | { |
346 | 346 | $xml = '<' . CreateElement::NAMESPACEWORD . ':insideV ' . |
347 | 347 | CreateElement::NAMESPACEWORD . ':val="' . $val . '" ' . |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | * @access protected |
363 | 363 | */ |
364 | 364 | protected function generateTBLLEFT($val = "single", $sz = "4", $space = '0', |
365 | - $color = 'auto') |
|
365 | + $color = 'auto') |
|
366 | 366 | { |
367 | 367 | $xml = '<' . CreateElement::NAMESPACEWORD . ':left ' . |
368 | 368 | CreateElement::NAMESPACEWORD . ':val="' . $val . '" ' . |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | * @access protected |
449 | 449 | */ |
450 | 450 | protected function generateTBLTOP($val = 'single', $sz = '4', $space = '0', |
451 | - $color = 'auto') |
|
451 | + $color = 'auto') |
|
452 | 452 | { |
453 | 453 | $xml = '<' . CreateElement::NAMESPACEWORD . ':top ' . |
454 | 454 | CreateElement::NAMESPACEWORD . ':val="' . $val . '" ' . |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | protected function generateWORKSHEET() |
171 | 171 | { |
172 | 172 | $this->_xml = '<?xml version="1.0" encoding="UTF-8" ' . |
173 | - 'standalone="yes" ?><worksheet ' . |
|
174 | - 'xmlns="http://schemas.openxmlformats.org/' . |
|
175 | - 'spreadsheetml/2006/main" ' . 'xmlns:r="http://schemas.' . |
|
176 | - 'openxmlformats.org/officeDocument/2006/relationships"' . |
|
177 | - '>__GENERATEWORKSHEET__</worksheet>'; |
|
173 | + 'standalone="yes" ?><worksheet ' . |
|
174 | + 'xmlns="http://schemas.openxmlformats.org/' . |
|
175 | + 'spreadsheetml/2006/main" ' . 'xmlns:r="http://schemas.' . |
|
176 | + 'openxmlformats.org/officeDocument/2006/relationships"' . |
|
177 | + '>__GENERATEWORKSHEET__</worksheet>'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @access protected |
217 | 217 | */ |
218 | 218 | protected function generateSHEETVIEW($tabSelected = '1', |
219 | - $workbookViewId = '0') |
|
219 | + $workbookViewId = '0') |
|
220 | 220 | { |
221 | 221 | $xml = '<sheetView tabSelected="' . $tabSelected . |
222 | 222 | '" workbookViewId="' . $workbookViewId . |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * @access protected |
248 | 248 | */ |
249 | 249 | protected function generateSHEETFORMATPR($baseColWidth = '10', |
250 | - $defaultRowHeight = '15') |
|
250 | + $defaultRowHeight = '15') |
|
251 | 251 | { |
252 | 252 | $xml = '<sheetFormatPr baseColWidth="' . $baseColWidth . |
253 | 253 | '" defaultRowHeight="' . $defaultRowHeight . |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @access protected |
278 | 278 | */ |
279 | 279 | protected function generateCOL($min = '1', $max = '1', |
280 | - $width = '11.85546875', $customWidth = '1') |
|
280 | + $width = '11.85546875', $customWidth = '1') |
|
281 | 281 | { |
282 | 282 | $xml = '<col min="' . $min . '" max="' . $max . '" width="' . $width . |
283 | 283 | '" customWidth="' . $customWidth . '"></col>'; |
@@ -359,8 +359,8 @@ discard block |
||
359 | 359 | * @access protected |
360 | 360 | */ |
361 | 361 | protected function generatePAGEMARGINS($left = '0.7', $rigth = '0.7', |
362 | - $bottom = '0.75', $top = '0.75', |
|
363 | - $header = '0.3', $footer = '0.3') |
|
362 | + $bottom = '0.75', $top = '0.75', |
|
363 | + $header = '0.3', $footer = '0.3') |
|
364 | 364 | { |
365 | 365 | $xml = '<pageMargins left="' . $left . '" right="' . $rigth . |
366 | 366 | '" top="' . $top . '" bottom="' . $bottom . |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | * @access protected |
380 | 380 | */ |
381 | 381 | protected function generatePAGESETUP($paperSize = '9', |
382 | - $orientation = 'portrait', $id = '1') |
|
382 | + $orientation = 'portrait', $id = '1') |
|
383 | 383 | { |
384 | 384 | $xml = '<pageSetup paperSize="' . $paperSize . |
385 | 385 | '" orientation="' . $orientation . '" r:id="rId' . $id . |
@@ -2438,7 +2438,7 @@ |
||
2438 | 2438 | 'relationships/' . $arrArgs[1]; |
2439 | 2439 | |
2440 | 2440 | return '<Relationship Id="' . $arrArgs[0] . '" Type="' . $strType . |
2441 | - '" Target="' . $arrArgs[2] . '"></Relationship>'; |
|
2441 | + '" Target="' . $arrArgs[2] . '"></Relationship>'; |
|
2442 | 2442 | } |
2443 | 2443 | |
2444 | 2444 | /** |
@@ -1542,7 +1542,7 @@ discard block |
||
1542 | 1542 | * @param string $customStyle |
1543 | 1543 | */ |
1544 | 1544 | protected function generateSTYLE($type, $styleId, $default = '', |
1545 | - $customStyle = '') |
|
1545 | + $customStyle = '') |
|
1546 | 1546 | { |
1547 | 1547 | $this->_xml .= '<' . CreateElement::NAMESPACEWORD . |
1548 | 1548 | ':style ' . CreateElement::NAMESPACEWORD . |
@@ -1835,7 +1835,7 @@ discard block |
||
1835 | 1835 | * @param string $themeColor |
1836 | 1836 | */ |
1837 | 1837 | protected function generatePBDR_BOTTOM($val, $sz, $space, $color, |
1838 | - $themeColor) |
|
1838 | + $themeColor) |
|
1839 | 1839 | { |
1840 | 1840 | $xml = '<' . CreateElement::NAMESPACEWORD . |
1841 | 1841 | ':pBdr ' . CreateElement::NAMESPACEWORD . |
@@ -1979,7 +1979,7 @@ discard block |
||
1979 | 1979 | * @param string $themeFillTint |
1980 | 1980 | */ |
1981 | 1981 | protected function generateSHD($val, $color='', $fill='', $themeFill='', |
1982 | - $themeFillTint='') |
|
1982 | + $themeFillTint='') |
|
1983 | 1983 | { |
1984 | 1984 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . |
1985 | 1985 | ':shd ' . CreateElement::NAMESPACEWORD . |
@@ -2086,8 +2086,8 @@ discard block |
||
2086 | 2086 | * @param string $themeTint |
2087 | 2087 | */ |
2088 | 2088 | protected function generateTBLBORDERS_TOP($val, $sz = '', $space = '', |
2089 | - $color = '', $themeColor = '', |
|
2090 | - $themeTint ='') |
|
2089 | + $color = '', $themeColor = '', |
|
2090 | + $themeTint ='') |
|
2091 | 2091 | { |
2092 | 2092 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . |
2093 | 2093 | ':top ' . CreateElement::NAMESPACEWORD . |
@@ -2132,8 +2132,8 @@ discard block |
||
2132 | 2132 | * @param string $themeTint |
2133 | 2133 | */ |
2134 | 2134 | protected function generateTBLBORDERS_LEFT($val, $sz = '', $space = '', |
2135 | - $color = '', $themeColor = '', |
|
2136 | - $themeTint = '') |
|
2135 | + $color = '', $themeColor = '', |
|
2136 | + $themeTint = '') |
|
2137 | 2137 | { |
2138 | 2138 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':left ' . |
2139 | 2139 | CreateElement::NAMESPACEWORD . |
@@ -2178,8 +2178,8 @@ discard block |
||
2178 | 2178 | * @param string $themeTint |
2179 | 2179 | */ |
2180 | 2180 | protected function generateTBLBORDERS_BOTTOM($val, $sz = '', $space = '', |
2181 | - $color = '', $themeColor = '', |
|
2182 | - $themeTint = '') |
|
2181 | + $color = '', $themeColor = '', |
|
2182 | + $themeTint = '') |
|
2183 | 2183 | { |
2184 | 2184 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . |
2185 | 2185 | ':bottom ' . CreateElement::NAMESPACEWORD . |
@@ -2270,8 +2270,8 @@ discard block |
||
2270 | 2270 | * @param string $themeTint |
2271 | 2271 | */ |
2272 | 2272 | protected function generateTBLBORDERS_INSIDEH($val, $sz='', $space='', |
2273 | - $color='', $themeColor='', |
|
2274 | - $themeTint='') |
|
2273 | + $color='', $themeColor='', |
|
2274 | + $themeTint='') |
|
2275 | 2275 | { |
2276 | 2276 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . |
2277 | 2277 | ':insideH ' . CreateElement::NAMESPACEWORD . ':val="' . $val . '"'; |
@@ -2315,8 +2315,8 @@ discard block |
||
2315 | 2315 | * @param string $themeTint |
2316 | 2316 | */ |
2317 | 2317 | protected function generateTBLBORDERS_INSIDEV($val, $sz='', $space='', |
2318 | - $color='', $themeColor='', |
|
2319 | - $themeTint='') |
|
2318 | + $color='', $themeColor='', |
|
2319 | + $themeTint='') |
|
2320 | 2320 | { |
2321 | 2321 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . |
2322 | 2322 | ':insideV ' . CreateElement::NAMESPACEWORD . ':val="' . $val . '"'; |
@@ -2451,7 +2451,7 @@ discard block |
||
2451 | 2451 | * @param string $cstheme |
2452 | 2452 | */ |
2453 | 2453 | protected function generateRFONTS($asciiTheme, $eastAsiaTheme, $hAnsiTheme, |
2454 | - $cstheme) |
|
2454 | + $cstheme) |
|
2455 | 2455 | { |
2456 | 2456 | $xml = '<' . CreateElement::NAMESPACEWORD . |
2457 | 2457 | ':rFonts ' . CreateElement::NAMESPACEWORD . |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @version SVN: $Id: Logger.php 824193 2009-10-11 22:51:24Z chammers $ |
44 | 44 | * @link http://logging.apache.org/log4php |
45 | 45 | */ |
46 | - /* |
|
46 | + /* |
|
47 | 47 | * TODO: |
48 | 48 | * Localization: setResourceBundle($bundle) : not supported |
49 | 49 | * Localization: getResourceBundle: not supported |
@@ -51,576 +51,576 @@ discard block |
||
51 | 51 | * Localization: l7dlog($priority, $key, $params, $t) : not supported |
52 | 52 | */ |
53 | 53 | class Logger { |
54 | - private static $_classes = array( |
|
55 | - 'LoggerException' => '/LoggerException.php', |
|
56 | - 'LoggerHierarchy' => '/LoggerHierarchy.php', |
|
57 | - 'LoggerLayout' => '/LoggerLayout.php', |
|
58 | - 'LoggerLevel' => '/LoggerLevel.php', |
|
59 | - 'LoggerMDC' => '/LoggerMDC.php', |
|
60 | - 'LoggerNDC' => '/LoggerNDC.php', |
|
61 | - 'LoggerReflectionUtils' => '/LoggerReflectionUtils.php', |
|
62 | - 'LoggerConfigurator' => '/LoggerConfigurator.php', |
|
63 | - 'LoggerConfiguratorBasic' => '/configurators/LoggerConfiguratorBasic.php', |
|
64 | - 'LoggerConfiguratorIni' => '/configurators/LoggerConfiguratorIni.php', |
|
65 | - 'LoggerConfiguratorPhp' => '/configurators/LoggerConfiguratorPhp.php', |
|
66 | - 'LoggerConfiguratorXml' => '/configurators/LoggerConfiguratorXml.php', |
|
67 | - 'LoggerRoot' => '/LoggerRoot.php', |
|
68 | - 'LoggerAppender' => '/LoggerAppender.php', |
|
69 | - 'LoggerAppenderPool' => '/LoggerAppenderPool.php', |
|
70 | - 'LoggerAppenderAdodb' => '/appenders/LoggerAppenderAdodb.php', |
|
71 | - 'LoggerAppenderPDO' => '/appenders/LoggerAppenderPDO.php', |
|
72 | - 'LoggerAppenderConsole' => '/appenders/LoggerAppenderConsole.php', |
|
73 | - 'LoggerAppenderDailyFile' => '/appenders/LoggerAppenderDailyFile.php', |
|
74 | - 'LoggerAppenderEcho' => '/appenders/LoggerAppenderEcho.php', |
|
75 | - 'LoggerAppenderFile' => '/appenders/LoggerAppenderFile.php', |
|
76 | - 'LoggerAppenderMail' => '/appenders/LoggerAppenderMail.php', |
|
77 | - 'LoggerAppenderMailEvent' => '/appenders/LoggerAppenderMailEvent.php', |
|
78 | - 'LoggerAppenderNull' => '/appenders/LoggerAppenderNull.php', |
|
79 | - 'LoggerAppenderPhp' => '/appenders/LoggerAppenderPhp.php', |
|
80 | - 'LoggerAppenderRollingFile' => '/appenders/LoggerAppenderRollingFile.php', |
|
81 | - 'LoggerAppenderSocket' => '/appenders/LoggerAppenderSocket.php', |
|
82 | - 'LoggerAppenderSyslog' => '/appenders/LoggerAppenderSyslog.php', |
|
83 | - 'LoggerFormattingInfo' => '/helpers/LoggerFormattingInfo.php', |
|
84 | - 'LoggerOptionConverter' => '/helpers/LoggerOptionConverter.php', |
|
85 | - 'LoggerPatternConverter' => '/helpers/LoggerPatternConverter.php', |
|
86 | - 'LoggerBasicPatternConverter' => '/helpers/LoggerBasicPatternConverter.php', |
|
87 | - 'LoggerCategoryPatternConverter' => '/helpers/LoggerCategoryPatternConverter.php', |
|
88 | - 'LoggerClassNamePatternConverter' => '/helpers/LoggerClassNamePatternConverter.php', |
|
89 | - 'LoggerDatePatternConverter' => '/helpers/LoggerDatePatternConverter.php', |
|
90 | - 'LoggerLiteralPatternConverter' => '/helpers/LoggerLiteralPatternConverter.php', |
|
91 | - 'LoggerLocationPatternConverter' => '/helpers/LoggerLocationPatternConverter.php', |
|
92 | - 'LoggerMDCPatternConverter' => '/helpers/LoggerMDCPatternConverter.php', |
|
93 | - 'LoggerNamedPatternConverter' => '/helpers/LoggerNamedPatternConverter.php', |
|
94 | - 'LoggerBasicPatternConverter' => '/helpers/LoggerBasicPatternConverter.php', |
|
95 | - 'LoggerLiteralPatternConverter' => '/helpers/LoggerLiteralPatternConverter.php', |
|
96 | - 'LoggerDatePatternConverter' => '/helpers/LoggerDatePatternConverter.php', |
|
97 | - 'LoggerMDCPatternConverter' => '/helpers/LoggerMDCPatternConverter.php', |
|
98 | - 'LoggerLocationPatternConverter' => '/helpers/LoggerLocationPatternConverter.php', |
|
99 | - 'LoggerNamedPatternConverter' => '/helpers/LoggerNamedPatternConverter.php', |
|
100 | - 'LoggerClassNamePatternConverter' => '/helpers/LoggerClassNamePatternConverter.php', |
|
101 | - 'LoggerCategoryPatternConverter' => '/helpers/LoggerCategoryPatternConverter.php', |
|
102 | - 'LoggerPatternParser' => '/helpers/LoggerPatternParser.php', |
|
103 | - 'LoggerLayoutHtml' => '/layouts/LoggerLayoutHtml.php', |
|
104 | - 'LoggerLayoutSimple' => '/layouts/LoggerLayoutSimple.php', |
|
105 | - 'LoggerLayoutTTCC' => '/layouts/LoggerLayoutTTCC.php', |
|
106 | - 'LoggerLayoutPattern' => '/layouts/LoggerLayoutPattern.php', |
|
107 | - 'LoggerLayoutXml' => '/layouts/LoggerLayoutXml.php', |
|
108 | - 'LoggerRendererDefault' => '/renderers/LoggerRendererDefault.php', |
|
109 | - 'LoggerRendererObject' => '/renderers/LoggerRendererObject.php', |
|
110 | - 'LoggerRendererMap' => '/renderers/LoggerRendererMap.php', |
|
111 | - 'LoggerLocationInfo' => '/LoggerLocationInfo.php', |
|
112 | - 'LoggerLoggingEvent' => '/LoggerLoggingEvent.php', |
|
113 | - 'LoggerFilter' => '/LoggerFilter.php', |
|
114 | - 'LoggerFilterDenyAll' => '/filters/LoggerFilterDenyAll.php', |
|
115 | - 'LoggerFilterLevelMatch' => '/filters/LoggerFilterLevelMatch.php', |
|
116 | - 'LoggerFilterLevelRange' => '/filters/LoggerFilterLevelRange.php', |
|
117 | - 'LoggerFilterStringMatch' => '/filters/LoggerFilterStringMatch.php', |
|
118 | - ); |
|
54 | + private static $_classes = array( |
|
55 | + 'LoggerException' => '/LoggerException.php', |
|
56 | + 'LoggerHierarchy' => '/LoggerHierarchy.php', |
|
57 | + 'LoggerLayout' => '/LoggerLayout.php', |
|
58 | + 'LoggerLevel' => '/LoggerLevel.php', |
|
59 | + 'LoggerMDC' => '/LoggerMDC.php', |
|
60 | + 'LoggerNDC' => '/LoggerNDC.php', |
|
61 | + 'LoggerReflectionUtils' => '/LoggerReflectionUtils.php', |
|
62 | + 'LoggerConfigurator' => '/LoggerConfigurator.php', |
|
63 | + 'LoggerConfiguratorBasic' => '/configurators/LoggerConfiguratorBasic.php', |
|
64 | + 'LoggerConfiguratorIni' => '/configurators/LoggerConfiguratorIni.php', |
|
65 | + 'LoggerConfiguratorPhp' => '/configurators/LoggerConfiguratorPhp.php', |
|
66 | + 'LoggerConfiguratorXml' => '/configurators/LoggerConfiguratorXml.php', |
|
67 | + 'LoggerRoot' => '/LoggerRoot.php', |
|
68 | + 'LoggerAppender' => '/LoggerAppender.php', |
|
69 | + 'LoggerAppenderPool' => '/LoggerAppenderPool.php', |
|
70 | + 'LoggerAppenderAdodb' => '/appenders/LoggerAppenderAdodb.php', |
|
71 | + 'LoggerAppenderPDO' => '/appenders/LoggerAppenderPDO.php', |
|
72 | + 'LoggerAppenderConsole' => '/appenders/LoggerAppenderConsole.php', |
|
73 | + 'LoggerAppenderDailyFile' => '/appenders/LoggerAppenderDailyFile.php', |
|
74 | + 'LoggerAppenderEcho' => '/appenders/LoggerAppenderEcho.php', |
|
75 | + 'LoggerAppenderFile' => '/appenders/LoggerAppenderFile.php', |
|
76 | + 'LoggerAppenderMail' => '/appenders/LoggerAppenderMail.php', |
|
77 | + 'LoggerAppenderMailEvent' => '/appenders/LoggerAppenderMailEvent.php', |
|
78 | + 'LoggerAppenderNull' => '/appenders/LoggerAppenderNull.php', |
|
79 | + 'LoggerAppenderPhp' => '/appenders/LoggerAppenderPhp.php', |
|
80 | + 'LoggerAppenderRollingFile' => '/appenders/LoggerAppenderRollingFile.php', |
|
81 | + 'LoggerAppenderSocket' => '/appenders/LoggerAppenderSocket.php', |
|
82 | + 'LoggerAppenderSyslog' => '/appenders/LoggerAppenderSyslog.php', |
|
83 | + 'LoggerFormattingInfo' => '/helpers/LoggerFormattingInfo.php', |
|
84 | + 'LoggerOptionConverter' => '/helpers/LoggerOptionConverter.php', |
|
85 | + 'LoggerPatternConverter' => '/helpers/LoggerPatternConverter.php', |
|
86 | + 'LoggerBasicPatternConverter' => '/helpers/LoggerBasicPatternConverter.php', |
|
87 | + 'LoggerCategoryPatternConverter' => '/helpers/LoggerCategoryPatternConverter.php', |
|
88 | + 'LoggerClassNamePatternConverter' => '/helpers/LoggerClassNamePatternConverter.php', |
|
89 | + 'LoggerDatePatternConverter' => '/helpers/LoggerDatePatternConverter.php', |
|
90 | + 'LoggerLiteralPatternConverter' => '/helpers/LoggerLiteralPatternConverter.php', |
|
91 | + 'LoggerLocationPatternConverter' => '/helpers/LoggerLocationPatternConverter.php', |
|
92 | + 'LoggerMDCPatternConverter' => '/helpers/LoggerMDCPatternConverter.php', |
|
93 | + 'LoggerNamedPatternConverter' => '/helpers/LoggerNamedPatternConverter.php', |
|
94 | + 'LoggerBasicPatternConverter' => '/helpers/LoggerBasicPatternConverter.php', |
|
95 | + 'LoggerLiteralPatternConverter' => '/helpers/LoggerLiteralPatternConverter.php', |
|
96 | + 'LoggerDatePatternConverter' => '/helpers/LoggerDatePatternConverter.php', |
|
97 | + 'LoggerMDCPatternConverter' => '/helpers/LoggerMDCPatternConverter.php', |
|
98 | + 'LoggerLocationPatternConverter' => '/helpers/LoggerLocationPatternConverter.php', |
|
99 | + 'LoggerNamedPatternConverter' => '/helpers/LoggerNamedPatternConverter.php', |
|
100 | + 'LoggerClassNamePatternConverter' => '/helpers/LoggerClassNamePatternConverter.php', |
|
101 | + 'LoggerCategoryPatternConverter' => '/helpers/LoggerCategoryPatternConverter.php', |
|
102 | + 'LoggerPatternParser' => '/helpers/LoggerPatternParser.php', |
|
103 | + 'LoggerLayoutHtml' => '/layouts/LoggerLayoutHtml.php', |
|
104 | + 'LoggerLayoutSimple' => '/layouts/LoggerLayoutSimple.php', |
|
105 | + 'LoggerLayoutTTCC' => '/layouts/LoggerLayoutTTCC.php', |
|
106 | + 'LoggerLayoutPattern' => '/layouts/LoggerLayoutPattern.php', |
|
107 | + 'LoggerLayoutXml' => '/layouts/LoggerLayoutXml.php', |
|
108 | + 'LoggerRendererDefault' => '/renderers/LoggerRendererDefault.php', |
|
109 | + 'LoggerRendererObject' => '/renderers/LoggerRendererObject.php', |
|
110 | + 'LoggerRendererMap' => '/renderers/LoggerRendererMap.php', |
|
111 | + 'LoggerLocationInfo' => '/LoggerLocationInfo.php', |
|
112 | + 'LoggerLoggingEvent' => '/LoggerLoggingEvent.php', |
|
113 | + 'LoggerFilter' => '/LoggerFilter.php', |
|
114 | + 'LoggerFilterDenyAll' => '/filters/LoggerFilterDenyAll.php', |
|
115 | + 'LoggerFilterLevelMatch' => '/filters/LoggerFilterLevelMatch.php', |
|
116 | + 'LoggerFilterLevelRange' => '/filters/LoggerFilterLevelRange.php', |
|
117 | + 'LoggerFilterStringMatch' => '/filters/LoggerFilterStringMatch.php', |
|
118 | + ); |
|
119 | 119 | |
120 | - /** |
|
121 | - * Class autoloader |
|
122 | - * This method is provided to be invoked within an __autoload() magic method. |
|
123 | - * @param string class name |
|
124 | - */ |
|
125 | - public static function autoload($className) { |
|
126 | - if(isset(self::$_classes[$className])) { |
|
127 | - include LOG4PHP_DIR.self::$_classes[$className]; |
|
128 | - } |
|
129 | - } |
|
120 | + /** |
|
121 | + * Class autoloader |
|
122 | + * This method is provided to be invoked within an __autoload() magic method. |
|
123 | + * @param string class name |
|
124 | + */ |
|
125 | + public static function autoload($className) { |
|
126 | + if(isset(self::$_classes[$className])) { |
|
127 | + include LOG4PHP_DIR.self::$_classes[$className]; |
|
128 | + } |
|
129 | + } |
|
130 | 130 | |
131 | - /** |
|
132 | - * Additivity is set to true by default, that is children inherit the |
|
133 | - * appenders of their ancestors by default. |
|
134 | - * @var boolean |
|
135 | - */ |
|
136 | - private $additive = true; |
|
137 | - |
|
138 | - /** @var string fully qualified class name */ |
|
139 | - private $fqcn = 'Logger'; |
|
131 | + /** |
|
132 | + * Additivity is set to true by default, that is children inherit the |
|
133 | + * appenders of their ancestors by default. |
|
134 | + * @var boolean |
|
135 | + */ |
|
136 | + private $additive = true; |
|
137 | + |
|
138 | + /** @var string fully qualified class name */ |
|
139 | + private $fqcn = 'Logger'; |
|
140 | 140 | |
141 | - /** @var LoggerLevel The assigned level of this category. */ |
|
142 | - private $level = null; |
|
141 | + /** @var LoggerLevel The assigned level of this category. */ |
|
142 | + private $level = null; |
|
143 | 143 | |
144 | - /** @var string name of this category. */ |
|
145 | - private $name = ''; |
|
144 | + /** @var string name of this category. */ |
|
145 | + private $name = ''; |
|
146 | 146 | |
147 | - /** @var Logger The parent of this category. Null if this is the root logger*/ |
|
148 | - private $parent = null; |
|
147 | + /** @var Logger The parent of this category. Null if this is the root logger*/ |
|
148 | + private $parent = null; |
|
149 | 149 | |
150 | - /** |
|
151 | - * @var array collection of appenders |
|
152 | - * @see LoggerAppender |
|
153 | - */ |
|
154 | - private $aai = array(); |
|
150 | + /** |
|
151 | + * @var array collection of appenders |
|
152 | + * @see LoggerAppender |
|
153 | + */ |
|
154 | + private $aai = array(); |
|
155 | 155 | |
156 | - /** the hierarchy used by log4php */ |
|
157 | - private static $hierarchy; |
|
158 | - |
|
159 | - /** the configurator class name */ |
|
160 | - private static $configurationClass = 'LoggerConfiguratorBasic'; |
|
161 | - |
|
162 | - /** the path to the configuration file */ |
|
163 | - private static $configurationFile = null; |
|
164 | - |
|
165 | - /** inidicates if log4php has already been initialized */ |
|
166 | - private static $initialized = false; |
|
167 | - |
|
168 | - /** |
|
169 | - * Constructor. |
|
170 | - * @param string $name Category name |
|
171 | - */ |
|
172 | - public function __construct($name) { |
|
173 | - $this->name = $name; |
|
174 | - } |
|
175 | - |
|
176 | - /** |
|
177 | - * Return the category name. |
|
178 | - * @return string |
|
179 | - */ |
|
180 | - public function getName() { |
|
181 | - return $this->name; |
|
182 | - } |
|
156 | + /** the hierarchy used by log4php */ |
|
157 | + private static $hierarchy; |
|
158 | + |
|
159 | + /** the configurator class name */ |
|
160 | + private static $configurationClass = 'LoggerConfiguratorBasic'; |
|
161 | + |
|
162 | + /** the path to the configuration file */ |
|
163 | + private static $configurationFile = null; |
|
164 | + |
|
165 | + /** inidicates if log4php has already been initialized */ |
|
166 | + private static $initialized = false; |
|
167 | + |
|
168 | + /** |
|
169 | + * Constructor. |
|
170 | + * @param string $name Category name |
|
171 | + */ |
|
172 | + public function __construct($name) { |
|
173 | + $this->name = $name; |
|
174 | + } |
|
175 | + |
|
176 | + /** |
|
177 | + * Return the category name. |
|
178 | + * @return string |
|
179 | + */ |
|
180 | + public function getName() { |
|
181 | + return $this->name; |
|
182 | + } |
|
183 | 183 | |
184 | - /** |
|
185 | - * Returns the parent of this category. |
|
186 | - * @return Logger |
|
187 | - */ |
|
188 | - public function getParent() { |
|
189 | - return $this->parent; |
|
190 | - } |
|
191 | - |
|
192 | - /** |
|
193 | - * Returns the hierarchy used by this Logger. |
|
194 | - * Caution: do not use this hierarchy unless you have called initialize(). |
|
195 | - * To get Loggers, use the Logger::getLogger and Logger::getRootLogger methods |
|
196 | - * instead of operating on on the hierarchy directly. |
|
197 | - * |
|
198 | - * @deprecated - will be moved to private |
|
199 | - * @return LoggerHierarchy |
|
200 | - */ |
|
201 | - public static function getHierarchy() { |
|
202 | - if(!isset(self::$hierarchy)) { |
|
203 | - self::$hierarchy = new LoggerHierarchy(new LoggerRoot()); |
|
204 | - } |
|
205 | - return self::$hierarchy; |
|
206 | - } |
|
207 | - |
|
208 | - /* Logging methods */ |
|
209 | - /** |
|
210 | - * Log a message object with the DEBUG level including the caller. |
|
211 | - * |
|
212 | - * @param mixed $message message |
|
213 | - * @param mixed $caller caller object or caller string id |
|
214 | - */ |
|
215 | - public function debug($message, $caller = null) { |
|
216 | - $this->logLevel($message, LoggerLevel::getLevelDebug(), $caller); |
|
217 | - } |
|
184 | + /** |
|
185 | + * Returns the parent of this category. |
|
186 | + * @return Logger |
|
187 | + */ |
|
188 | + public function getParent() { |
|
189 | + return $this->parent; |
|
190 | + } |
|
191 | + |
|
192 | + /** |
|
193 | + * Returns the hierarchy used by this Logger. |
|
194 | + * Caution: do not use this hierarchy unless you have called initialize(). |
|
195 | + * To get Loggers, use the Logger::getLogger and Logger::getRootLogger methods |
|
196 | + * instead of operating on on the hierarchy directly. |
|
197 | + * |
|
198 | + * @deprecated - will be moved to private |
|
199 | + * @return LoggerHierarchy |
|
200 | + */ |
|
201 | + public static function getHierarchy() { |
|
202 | + if(!isset(self::$hierarchy)) { |
|
203 | + self::$hierarchy = new LoggerHierarchy(new LoggerRoot()); |
|
204 | + } |
|
205 | + return self::$hierarchy; |
|
206 | + } |
|
207 | + |
|
208 | + /* Logging methods */ |
|
209 | + /** |
|
210 | + * Log a message object with the DEBUG level including the caller. |
|
211 | + * |
|
212 | + * @param mixed $message message |
|
213 | + * @param mixed $caller caller object or caller string id |
|
214 | + */ |
|
215 | + public function debug($message, $caller = null) { |
|
216 | + $this->logLevel($message, LoggerLevel::getLevelDebug(), $caller); |
|
217 | + } |
|
218 | 218 | |
219 | 219 | |
220 | - /** |
|
221 | - * Log a message object with the INFO Level. |
|
222 | - * |
|
223 | - * @param mixed $message message |
|
224 | - * @param mixed $caller caller object or caller string id |
|
225 | - */ |
|
226 | - public function info($message, $caller = null) { |
|
227 | - $this->logLevel($message, LoggerLevel::getLevelInfo(), $caller); |
|
228 | - } |
|
220 | + /** |
|
221 | + * Log a message object with the INFO Level. |
|
222 | + * |
|
223 | + * @param mixed $message message |
|
224 | + * @param mixed $caller caller object or caller string id |
|
225 | + */ |
|
226 | + public function info($message, $caller = null) { |
|
227 | + $this->logLevel($message, LoggerLevel::getLevelInfo(), $caller); |
|
228 | + } |
|
229 | 229 | |
230 | - /** |
|
231 | - * Log a message with the WARN level. |
|
232 | - * |
|
233 | - * @param mixed $message message |
|
234 | - * @param mixed $caller caller object or caller string id |
|
235 | - */ |
|
236 | - public function warn($message, $caller = null) { |
|
237 | - $this->logLevel($message, LoggerLevel::getLevelWarn(), $caller); |
|
238 | - } |
|
239 | - |
|
240 | - /** |
|
241 | - * Log a message object with the ERROR level including the caller. |
|
242 | - * |
|
243 | - * @param mixed $message message |
|
244 | - * @param mixed $caller caller object or caller string id |
|
245 | - */ |
|
246 | - public function error($message, $caller = null) { |
|
247 | - $this->logLevel($message, LoggerLevel::getLevelError(), $caller); |
|
248 | - } |
|
249 | - |
|
250 | - /** |
|
251 | - * Log a message object with the FATAL level including the caller. |
|
252 | - * |
|
253 | - * @param mixed $message message |
|
254 | - * @param mixed $caller caller object or caller string id |
|
255 | - */ |
|
256 | - public function fatal($message, $caller = null) { |
|
257 | - $this->logLevel($message, LoggerLevel::getLevelFatal(), $caller); |
|
258 | - } |
|
259 | - |
|
260 | - /** |
|
261 | - * This method creates a new logging event and logs the event without further checks. |
|
262 | - * |
|
263 | - * It should not be called directly. Use {@link info()}, {@link debug()}, {@link warn()}, |
|
264 | - * {@link error()} and {@link fatal()} wrappers. |
|
265 | - * |
|
266 | - * @param string $fqcn Fully Qualified Class Name of the Logger |
|
267 | - * @param mixed $caller caller object or caller string id |
|
268 | - * @param LoggerLevel $level log level |
|
269 | - * @param mixed $message message |
|
270 | - * @see LoggerLoggingEvent |
|
271 | - */ |
|
272 | - public function forcedLog($fqcn, $caller, $level, $message) { |
|
273 | - $this->callAppenders(new LoggerLoggingEvent($fqcn, $this, $level, $message)); |
|
274 | - } |
|
275 | - |
|
276 | - |
|
277 | - /** |
|
278 | - * Check whether this category is enabled for the DEBUG Level. |
|
279 | - * @return boolean |
|
280 | - */ |
|
281 | - public function isDebugEnabled() { |
|
282 | - return $this->isEnabledFor(LoggerLevel::getLevelDebug()); |
|
283 | - } |
|
230 | + /** |
|
231 | + * Log a message with the WARN level. |
|
232 | + * |
|
233 | + * @param mixed $message message |
|
234 | + * @param mixed $caller caller object or caller string id |
|
235 | + */ |
|
236 | + public function warn($message, $caller = null) { |
|
237 | + $this->logLevel($message, LoggerLevel::getLevelWarn(), $caller); |
|
238 | + } |
|
239 | + |
|
240 | + /** |
|
241 | + * Log a message object with the ERROR level including the caller. |
|
242 | + * |
|
243 | + * @param mixed $message message |
|
244 | + * @param mixed $caller caller object or caller string id |
|
245 | + */ |
|
246 | + public function error($message, $caller = null) { |
|
247 | + $this->logLevel($message, LoggerLevel::getLevelError(), $caller); |
|
248 | + } |
|
249 | + |
|
250 | + /** |
|
251 | + * Log a message object with the FATAL level including the caller. |
|
252 | + * |
|
253 | + * @param mixed $message message |
|
254 | + * @param mixed $caller caller object or caller string id |
|
255 | + */ |
|
256 | + public function fatal($message, $caller = null) { |
|
257 | + $this->logLevel($message, LoggerLevel::getLevelFatal(), $caller); |
|
258 | + } |
|
259 | + |
|
260 | + /** |
|
261 | + * This method creates a new logging event and logs the event without further checks. |
|
262 | + * |
|
263 | + * It should not be called directly. Use {@link info()}, {@link debug()}, {@link warn()}, |
|
264 | + * {@link error()} and {@link fatal()} wrappers. |
|
265 | + * |
|
266 | + * @param string $fqcn Fully Qualified Class Name of the Logger |
|
267 | + * @param mixed $caller caller object or caller string id |
|
268 | + * @param LoggerLevel $level log level |
|
269 | + * @param mixed $message message |
|
270 | + * @see LoggerLoggingEvent |
|
271 | + */ |
|
272 | + public function forcedLog($fqcn, $caller, $level, $message) { |
|
273 | + $this->callAppenders(new LoggerLoggingEvent($fqcn, $this, $level, $message)); |
|
274 | + } |
|
275 | + |
|
276 | + |
|
277 | + /** |
|
278 | + * Check whether this category is enabled for the DEBUG Level. |
|
279 | + * @return boolean |
|
280 | + */ |
|
281 | + public function isDebugEnabled() { |
|
282 | + return $this->isEnabledFor(LoggerLevel::getLevelDebug()); |
|
283 | + } |
|
284 | 284 | |
285 | - /** |
|
286 | - * Check whether this category is enabled for a given Level passed as parameter. |
|
287 | - * |
|
288 | - * @param LoggerLevel level |
|
289 | - * @return boolean |
|
290 | - */ |
|
291 | - public function isEnabledFor($level) { |
|
292 | - return (bool)($level->isGreaterOrEqual($this->getEffectiveLevel())); |
|
293 | - } |
|
285 | + /** |
|
286 | + * Check whether this category is enabled for a given Level passed as parameter. |
|
287 | + * |
|
288 | + * @param LoggerLevel level |
|
289 | + * @return boolean |
|
290 | + */ |
|
291 | + public function isEnabledFor($level) { |
|
292 | + return (bool)($level->isGreaterOrEqual($this->getEffectiveLevel())); |
|
293 | + } |
|
294 | 294 | |
295 | - /** |
|
296 | - * Check whether this category is enabled for the info Level. |
|
297 | - * @return boolean |
|
298 | - * @see LoggerLevel |
|
299 | - */ |
|
300 | - public function isInfoEnabled() { |
|
301 | - return $this->isEnabledFor(LoggerLevel::getLevelInfo()); |
|
302 | - } |
|
295 | + /** |
|
296 | + * Check whether this category is enabled for the info Level. |
|
297 | + * @return boolean |
|
298 | + * @see LoggerLevel |
|
299 | + */ |
|
300 | + public function isInfoEnabled() { |
|
301 | + return $this->isEnabledFor(LoggerLevel::getLevelInfo()); |
|
302 | + } |
|
303 | 303 | |
304 | - /** |
|
305 | - * This generic form is intended to be used by wrappers. |
|
306 | - * |
|
307 | - * @param LoggerLevel $priority a valid level |
|
308 | - * @param mixed $message message |
|
309 | - * @param mixed $caller caller object or caller string id |
|
310 | - */ |
|
311 | - public function log($priority, $message, $caller = null) { |
|
312 | - if($this->isEnabledFor($priority)) { |
|
313 | - $this->forcedLog($this->fqcn, $caller, $priority, $message); |
|
314 | - } |
|
315 | - } |
|
316 | - |
|
317 | - /** |
|
318 | - * If assertion parameter is false, then logs msg as an error statement. |
|
319 | - * |
|
320 | - * @param bool $assertion |
|
321 | - * @param string $msg message to log |
|
322 | - */ |
|
323 | - public function assertLog($assertion = true, $msg = '') { |
|
324 | - if($assertion == false) { |
|
325 | - $this->error($msg); |
|
326 | - } |
|
327 | - } |
|
304 | + /** |
|
305 | + * This generic form is intended to be used by wrappers. |
|
306 | + * |
|
307 | + * @param LoggerLevel $priority a valid level |
|
308 | + * @param mixed $message message |
|
309 | + * @param mixed $caller caller object or caller string id |
|
310 | + */ |
|
311 | + public function log($priority, $message, $caller = null) { |
|
312 | + if($this->isEnabledFor($priority)) { |
|
313 | + $this->forcedLog($this->fqcn, $caller, $priority, $message); |
|
314 | + } |
|
315 | + } |
|
316 | + |
|
317 | + /** |
|
318 | + * If assertion parameter is false, then logs msg as an error statement. |
|
319 | + * |
|
320 | + * @param bool $assertion |
|
321 | + * @param string $msg message to log |
|
322 | + */ |
|
323 | + public function assertLog($assertion = true, $msg = '') { |
|
324 | + if($assertion == false) { |
|
325 | + $this->error($msg); |
|
326 | + } |
|
327 | + } |
|
328 | 328 | |
329 | - private function logLevel($message, $level, $caller = null) { |
|
330 | - if($level->isGreaterOrEqual($this->getEffectiveLevel())) { |
|
331 | - $this->forcedLog($this->fqcn, $caller, $level, $message); |
|
332 | - } |
|
333 | - } |
|
334 | - |
|
335 | - /* Factory methods */ |
|
336 | - |
|
337 | - /** |
|
338 | - * Get a Logger by name (Delegate to {@link Logger}) |
|
339 | - * |
|
340 | - * @param string $name logger name |
|
341 | - * @param LoggerFactory $factory a {@link LoggerFactory} instance or null |
|
342 | - * @return Logger |
|
343 | - * @static |
|
344 | - */ |
|
345 | - public static function getLogger($name) { |
|
346 | - if(!self::isInitialized()) { |
|
347 | - self::initialize(); |
|
348 | - } |
|
349 | - return self::getHierarchy()->getLogger($name); |
|
350 | - } |
|
351 | - |
|
352 | - /** |
|
353 | - * get the Root Logger (Delegate to {@link Logger}) |
|
354 | - * @return LoggerRoot |
|
355 | - * @static |
|
356 | - */ |
|
357 | - public static function getRootLogger() { |
|
358 | - if(!self::isInitialized()) { |
|
359 | - self::initialize(); |
|
360 | - } |
|
361 | - return self::getHierarchy()->getRootLogger(); |
|
362 | - } |
|
363 | - |
|
364 | - /* Configuration methods */ |
|
365 | - |
|
366 | - /** |
|
367 | - * Add a new Appender to the list of appenders of this Category instance. |
|
368 | - * |
|
369 | - * @param LoggerAppender $newAppender |
|
370 | - */ |
|
371 | - public function addAppender($newAppender) { |
|
372 | - $appenderName = $newAppender->getName(); |
|
373 | - $this->aai[$appenderName] = $newAppender; |
|
374 | - } |
|
375 | - |
|
376 | - /** |
|
377 | - * Remove all previously added appenders from this Category instance. |
|
378 | - */ |
|
379 | - public function removeAllAppenders() { |
|
380 | - $appenderNames = array_keys($this->aai); |
|
381 | - $enumAppenders = count($appenderNames); |
|
382 | - for($i = 0; $i < $enumAppenders; $i++) { |
|
383 | - $this->removeAppender($appenderNames[$i]); |
|
384 | - } |
|
385 | - } |
|
329 | + private function logLevel($message, $level, $caller = null) { |
|
330 | + if($level->isGreaterOrEqual($this->getEffectiveLevel())) { |
|
331 | + $this->forcedLog($this->fqcn, $caller, $level, $message); |
|
332 | + } |
|
333 | + } |
|
334 | + |
|
335 | + /* Factory methods */ |
|
336 | + |
|
337 | + /** |
|
338 | + * Get a Logger by name (Delegate to {@link Logger}) |
|
339 | + * |
|
340 | + * @param string $name logger name |
|
341 | + * @param LoggerFactory $factory a {@link LoggerFactory} instance or null |
|
342 | + * @return Logger |
|
343 | + * @static |
|
344 | + */ |
|
345 | + public static function getLogger($name) { |
|
346 | + if(!self::isInitialized()) { |
|
347 | + self::initialize(); |
|
348 | + } |
|
349 | + return self::getHierarchy()->getLogger($name); |
|
350 | + } |
|
351 | + |
|
352 | + /** |
|
353 | + * get the Root Logger (Delegate to {@link Logger}) |
|
354 | + * @return LoggerRoot |
|
355 | + * @static |
|
356 | + */ |
|
357 | + public static function getRootLogger() { |
|
358 | + if(!self::isInitialized()) { |
|
359 | + self::initialize(); |
|
360 | + } |
|
361 | + return self::getHierarchy()->getRootLogger(); |
|
362 | + } |
|
363 | + |
|
364 | + /* Configuration methods */ |
|
365 | + |
|
366 | + /** |
|
367 | + * Add a new Appender to the list of appenders of this Category instance. |
|
368 | + * |
|
369 | + * @param LoggerAppender $newAppender |
|
370 | + */ |
|
371 | + public function addAppender($newAppender) { |
|
372 | + $appenderName = $newAppender->getName(); |
|
373 | + $this->aai[$appenderName] = $newAppender; |
|
374 | + } |
|
375 | + |
|
376 | + /** |
|
377 | + * Remove all previously added appenders from this Category instance. |
|
378 | + */ |
|
379 | + public function removeAllAppenders() { |
|
380 | + $appenderNames = array_keys($this->aai); |
|
381 | + $enumAppenders = count($appenderNames); |
|
382 | + for($i = 0; $i < $enumAppenders; $i++) { |
|
383 | + $this->removeAppender($appenderNames[$i]); |
|
384 | + } |
|
385 | + } |
|
386 | 386 | |
387 | - /** |
|
388 | - * Remove the appender passed as parameter form the list of appenders. |
|
389 | - * |
|
390 | - * @param mixed $appender can be an appender name or a {@link LoggerAppender} object |
|
391 | - */ |
|
392 | - public function removeAppender($appender) { |
|
393 | - if($appender instanceof LoggerAppender) { |
|
394 | - $appender->close(); |
|
395 | - unset($this->aai[$appender->getName()]); |
|
396 | - } else if (is_string($appender) and isset($this->aai[$appender])) { |
|
397 | - $this->aai[$appender]->close(); |
|
398 | - unset($this->aai[$appender]); |
|
399 | - } |
|
400 | - } |
|
387 | + /** |
|
388 | + * Remove the appender passed as parameter form the list of appenders. |
|
389 | + * |
|
390 | + * @param mixed $appender can be an appender name or a {@link LoggerAppender} object |
|
391 | + */ |
|
392 | + public function removeAppender($appender) { |
|
393 | + if($appender instanceof LoggerAppender) { |
|
394 | + $appender->close(); |
|
395 | + unset($this->aai[$appender->getName()]); |
|
396 | + } else if (is_string($appender) and isset($this->aai[$appender])) { |
|
397 | + $this->aai[$appender]->close(); |
|
398 | + unset($this->aai[$appender]); |
|
399 | + } |
|
400 | + } |
|
401 | 401 | |
402 | - /** |
|
403 | - * Call the appenders in the hierarchy starting at this. |
|
404 | - * |
|
405 | - * @param LoggerLoggingEvent $event |
|
406 | - */ |
|
407 | - public function callAppenders($event) { |
|
408 | - if(count($this->aai) > 0) { |
|
409 | - foreach(array_keys($this->aai) as $appenderName) { |
|
410 | - $this->aai[$appenderName]->doAppend($event); |
|
411 | - } |
|
412 | - } |
|
413 | - if($this->parent != null and $this->getAdditivity()) { |
|
414 | - $this->parent->callAppenders($event); |
|
415 | - } |
|
416 | - } |
|
417 | - |
|
418 | - /** |
|
419 | - * Get the appenders contained in this category as an array. |
|
420 | - * @return array collection of appenders |
|
421 | - */ |
|
422 | - public function getAllAppenders() { |
|
423 | - return array_values($this->aai); |
|
424 | - } |
|
425 | - |
|
426 | - /** |
|
427 | - * Look for the appender named as name. |
|
428 | - * @return LoggerAppender |
|
429 | - */ |
|
430 | - public function getAppender($name) { |
|
431 | - return $this->aai[$name]; |
|
432 | - } |
|
433 | - |
|
434 | - /** |
|
435 | - * Get the additivity flag for this Category instance. |
|
436 | - * @return boolean |
|
437 | - */ |
|
438 | - public function getAdditivity() { |
|
439 | - return $this->additive; |
|
440 | - } |
|
402 | + /** |
|
403 | + * Call the appenders in the hierarchy starting at this. |
|
404 | + * |
|
405 | + * @param LoggerLoggingEvent $event |
|
406 | + */ |
|
407 | + public function callAppenders($event) { |
|
408 | + if(count($this->aai) > 0) { |
|
409 | + foreach(array_keys($this->aai) as $appenderName) { |
|
410 | + $this->aai[$appenderName]->doAppend($event); |
|
411 | + } |
|
412 | + } |
|
413 | + if($this->parent != null and $this->getAdditivity()) { |
|
414 | + $this->parent->callAppenders($event); |
|
415 | + } |
|
416 | + } |
|
417 | + |
|
418 | + /** |
|
419 | + * Get the appenders contained in this category as an array. |
|
420 | + * @return array collection of appenders |
|
421 | + */ |
|
422 | + public function getAllAppenders() { |
|
423 | + return array_values($this->aai); |
|
424 | + } |
|
425 | + |
|
426 | + /** |
|
427 | + * Look for the appender named as name. |
|
428 | + * @return LoggerAppender |
|
429 | + */ |
|
430 | + public function getAppender($name) { |
|
431 | + return $this->aai[$name]; |
|
432 | + } |
|
433 | + |
|
434 | + /** |
|
435 | + * Get the additivity flag for this Category instance. |
|
436 | + * @return boolean |
|
437 | + */ |
|
438 | + public function getAdditivity() { |
|
439 | + return $this->additive; |
|
440 | + } |
|
441 | 441 | |
442 | - /** |
|
443 | - * Starting from this category, search the category hierarchy for a non-null level and return it. |
|
444 | - * @see LoggerLevel |
|
445 | - * @return LoggerLevel or null |
|
446 | - */ |
|
447 | - public function getEffectiveLevel() { |
|
448 | - for($c = $this; $c != null; $c = $c->parent) { |
|
449 | - if($c->getLevel() !== null) { |
|
450 | - return $c->getLevel(); |
|
451 | - } |
|
452 | - } |
|
453 | - return null; |
|
454 | - } |
|
442 | + /** |
|
443 | + * Starting from this category, search the category hierarchy for a non-null level and return it. |
|
444 | + * @see LoggerLevel |
|
445 | + * @return LoggerLevel or null |
|
446 | + */ |
|
447 | + public function getEffectiveLevel() { |
|
448 | + for($c = $this; $c != null; $c = $c->parent) { |
|
449 | + if($c->getLevel() !== null) { |
|
450 | + return $c->getLevel(); |
|
451 | + } |
|
452 | + } |
|
453 | + return null; |
|
454 | + } |
|
455 | 455 | |
456 | - /** |
|
457 | - * Returns the assigned Level, if any, for this Category. |
|
458 | - * @return LoggerLevel or null |
|
459 | - */ |
|
460 | - public function getLevel() { |
|
461 | - return $this->level; |
|
462 | - } |
|
463 | - |
|
464 | - /** |
|
465 | - * Set the level of this Category. |
|
466 | - * |
|
467 | - * @param LoggerLevel $level a level string or a level constant |
|
468 | - */ |
|
469 | - public function setLevel($level) { |
|
470 | - $this->level = $level; |
|
471 | - } |
|
472 | - |
|
473 | - /** |
|
474 | - * Clears all logger definitions |
|
475 | - * |
|
476 | - * @static |
|
477 | - * @return boolean |
|
478 | - */ |
|
479 | - public static function clear() { |
|
480 | - return self::getHierarchy()->clear(); |
|
481 | - } |
|
482 | - |
|
483 | - /** |
|
484 | - * Destroy configurations for logger definitions |
|
485 | - * |
|
486 | - * @static |
|
487 | - * @return boolean |
|
488 | - */ |
|
489 | - public static function resetConfiguration() { |
|
490 | - $result = self::getHierarchy()->resetConfiguration(); |
|
491 | - self::$initialized = false; |
|
492 | - self::$configurationClass = 'LoggerConfiguratorBasic'; |
|
493 | - self::$configurationFile = null; |
|
494 | - return $result; |
|
495 | - } |
|
456 | + /** |
|
457 | + * Returns the assigned Level, if any, for this Category. |
|
458 | + * @return LoggerLevel or null |
|
459 | + */ |
|
460 | + public function getLevel() { |
|
461 | + return $this->level; |
|
462 | + } |
|
463 | + |
|
464 | + /** |
|
465 | + * Set the level of this Category. |
|
466 | + * |
|
467 | + * @param LoggerLevel $level a level string or a level constant |
|
468 | + */ |
|
469 | + public function setLevel($level) { |
|
470 | + $this->level = $level; |
|
471 | + } |
|
472 | + |
|
473 | + /** |
|
474 | + * Clears all logger definitions |
|
475 | + * |
|
476 | + * @static |
|
477 | + * @return boolean |
|
478 | + */ |
|
479 | + public static function clear() { |
|
480 | + return self::getHierarchy()->clear(); |
|
481 | + } |
|
482 | + |
|
483 | + /** |
|
484 | + * Destroy configurations for logger definitions |
|
485 | + * |
|
486 | + * @static |
|
487 | + * @return boolean |
|
488 | + */ |
|
489 | + public static function resetConfiguration() { |
|
490 | + $result = self::getHierarchy()->resetConfiguration(); |
|
491 | + self::$initialized = false; |
|
492 | + self::$configurationClass = 'LoggerConfiguratorBasic'; |
|
493 | + self::$configurationFile = null; |
|
494 | + return $result; |
|
495 | + } |
|
496 | 496 | |
497 | - /** |
|
498 | - * Safely close all appenders. |
|
499 | - * This is not longer necessary due the appenders shutdown via |
|
500 | - * destructors. |
|
501 | - * @deprecated |
|
502 | - * @static |
|
503 | - */ |
|
504 | - public static function shutdown() { |
|
505 | - return self::getHierarchy()->shutdown(); |
|
506 | - } |
|
507 | - |
|
508 | - /** |
|
509 | - * check if a given logger exists. |
|
510 | - * |
|
511 | - * @param string $name logger name |
|
512 | - * @static |
|
513 | - * @return boolean |
|
514 | - */ |
|
515 | - public static function exists($name) { |
|
516 | - return self::getHierarchy()->exists($name); |
|
517 | - } |
|
518 | - |
|
519 | - /** |
|
520 | - * Returns an array this whole Logger instances. |
|
521 | - * |
|
522 | - * @static |
|
523 | - * @see Logger |
|
524 | - * @return array |
|
525 | - */ |
|
526 | - public static function getCurrentLoggers() { |
|
527 | - return self::getHierarchy()->getCurrentLoggers(); |
|
528 | - } |
|
529 | - |
|
530 | - /** |
|
531 | - * Is the appender passed as parameter attached to this category? |
|
532 | - * |
|
533 | - * @param LoggerAppender $appender |
|
534 | - */ |
|
535 | - public function isAttached($appender) { |
|
536 | - return isset($this->aai[$appender->getName()]); |
|
537 | - } |
|
497 | + /** |
|
498 | + * Safely close all appenders. |
|
499 | + * This is not longer necessary due the appenders shutdown via |
|
500 | + * destructors. |
|
501 | + * @deprecated |
|
502 | + * @static |
|
503 | + */ |
|
504 | + public static function shutdown() { |
|
505 | + return self::getHierarchy()->shutdown(); |
|
506 | + } |
|
507 | + |
|
508 | + /** |
|
509 | + * check if a given logger exists. |
|
510 | + * |
|
511 | + * @param string $name logger name |
|
512 | + * @static |
|
513 | + * @return boolean |
|
514 | + */ |
|
515 | + public static function exists($name) { |
|
516 | + return self::getHierarchy()->exists($name); |
|
517 | + } |
|
518 | + |
|
519 | + /** |
|
520 | + * Returns an array this whole Logger instances. |
|
521 | + * |
|
522 | + * @static |
|
523 | + * @see Logger |
|
524 | + * @return array |
|
525 | + */ |
|
526 | + public static function getCurrentLoggers() { |
|
527 | + return self::getHierarchy()->getCurrentLoggers(); |
|
528 | + } |
|
529 | + |
|
530 | + /** |
|
531 | + * Is the appender passed as parameter attached to this category? |
|
532 | + * |
|
533 | + * @param LoggerAppender $appender |
|
534 | + */ |
|
535 | + public function isAttached($appender) { |
|
536 | + return isset($this->aai[$appender->getName()]); |
|
537 | + } |
|
538 | 538 | |
539 | - /** |
|
540 | - * Set the additivity flag for this Category instance. |
|
541 | - * |
|
542 | - * @param boolean $additive |
|
543 | - */ |
|
544 | - public function setAdditivity($additive) { |
|
545 | - $this->additive = (bool)$additive; |
|
546 | - } |
|
539 | + /** |
|
540 | + * Set the additivity flag for this Category instance. |
|
541 | + * |
|
542 | + * @param boolean $additive |
|
543 | + */ |
|
544 | + public function setAdditivity($additive) { |
|
545 | + $this->additive = (bool)$additive; |
|
546 | + } |
|
547 | 547 | |
548 | - /** |
|
549 | - * Sets the parent logger of this logger |
|
550 | - */ |
|
551 | - public function setParent(Logger $logger) { |
|
552 | - $this->parent = $logger; |
|
553 | - } |
|
554 | - |
|
555 | - /** |
|
556 | - * Configures Log4PHP. |
|
557 | - * This method needs to be called before the first logging event |
|
558 | - * has occured. If this methode is never called, the standard configuration |
|
559 | - * takes place (@see LoggerConfiguratorBasic). |
|
560 | - * If only the configuration file is given, the configurator class will |
|
561 | - * be the XML Configurator or the INI Configurator, if no .xml ending |
|
562 | - * could be determined. |
|
563 | - * |
|
564 | - * If a custom configurator should be used, the configuration file |
|
565 | - * is either null or the path to file the custom configurator uses. |
|
566 | - * Make sure the configurator is already or can be loaded by PHP when necessary. |
|
567 | - * |
|
568 | - * @param String $configurationFile the configuration file |
|
569 | - * @param String $configurationClass the configurator class |
|
570 | - */ |
|
571 | - public static function configure($configurationFile = null, |
|
572 | - $configurationClass = null ) { |
|
573 | - if($configurationClass === null && $configurationFile === null) { |
|
574 | - self::$configurationClass = 'LoggerConfiguratorBasic'; |
|
575 | - return; |
|
576 | - } |
|
548 | + /** |
|
549 | + * Sets the parent logger of this logger |
|
550 | + */ |
|
551 | + public function setParent(Logger $logger) { |
|
552 | + $this->parent = $logger; |
|
553 | + } |
|
554 | + |
|
555 | + /** |
|
556 | + * Configures Log4PHP. |
|
557 | + * This method needs to be called before the first logging event |
|
558 | + * has occured. If this methode is never called, the standard configuration |
|
559 | + * takes place (@see LoggerConfiguratorBasic). |
|
560 | + * If only the configuration file is given, the configurator class will |
|
561 | + * be the XML Configurator or the INI Configurator, if no .xml ending |
|
562 | + * could be determined. |
|
563 | + * |
|
564 | + * If a custom configurator should be used, the configuration file |
|
565 | + * is either null or the path to file the custom configurator uses. |
|
566 | + * Make sure the configurator is already or can be loaded by PHP when necessary. |
|
567 | + * |
|
568 | + * @param String $configurationFile the configuration file |
|
569 | + * @param String $configurationClass the configurator class |
|
570 | + */ |
|
571 | + public static function configure($configurationFile = null, |
|
572 | + $configurationClass = null ) { |
|
573 | + if($configurationClass === null && $configurationFile === null) { |
|
574 | + self::$configurationClass = 'LoggerConfiguratorBasic'; |
|
575 | + return; |
|
576 | + } |
|
577 | 577 | |
578 | - if($configurationClass !== null) { |
|
579 | - self::$configurationFile = $configurationFile; |
|
580 | - self::$configurationClass = $configurationClass; |
|
581 | - return; |
|
582 | - } |
|
578 | + if($configurationClass !== null) { |
|
579 | + self::$configurationFile = $configurationFile; |
|
580 | + self::$configurationClass = $configurationClass; |
|
581 | + return; |
|
582 | + } |
|
583 | 583 | |
584 | - if (strtolower(substr( $configurationFile, -4 )) == '.xml') { |
|
585 | - self::$configurationFile = $configurationFile; |
|
586 | - self::$configurationClass = 'LoggerConfiguratorXml'; |
|
587 | - } else { |
|
588 | - self::$configurationFile = $configurationFile; |
|
589 | - self::$configurationClass = 'LoggerConfiguratorIni'; |
|
590 | - } |
|
591 | - } |
|
592 | - |
|
593 | - /** |
|
594 | - * Returns the current configurator |
|
595 | - * @return the configurator |
|
596 | - */ |
|
597 | - public static function getConfigurationClass() { |
|
598 | - return self::$configurationClass; |
|
599 | - } |
|
600 | - |
|
601 | - /** |
|
602 | - * Returns the current configuration file |
|
603 | - * @return the configuration file |
|
604 | - */ |
|
605 | - public static function getConfigurationFile() { |
|
606 | - return self::$configurationFile; |
|
607 | - } |
|
608 | - |
|
609 | - /** |
|
610 | - * Returns, true, if the log4php framework is already initialized |
|
611 | - */ |
|
612 | - private static function isInitialized() { |
|
613 | - return self::$initialized; |
|
614 | - } |
|
615 | - |
|
616 | - /** |
|
617 | - * Initializes the log4php framework. |
|
618 | - * @return boolean |
|
619 | - */ |
|
620 | - public static function initialize() { |
|
621 | - self::$initialized = true; |
|
622 | - $instance = LoggerReflectionUtils::createObject(self::$configurationClass); |
|
623 | - $result = $instance->configure(self::getHierarchy(), self::$configurationFile); |
|
624 | - return $result; |
|
625 | - } |
|
584 | + if (strtolower(substr( $configurationFile, -4 )) == '.xml') { |
|
585 | + self::$configurationFile = $configurationFile; |
|
586 | + self::$configurationClass = 'LoggerConfiguratorXml'; |
|
587 | + } else { |
|
588 | + self::$configurationFile = $configurationFile; |
|
589 | + self::$configurationClass = 'LoggerConfiguratorIni'; |
|
590 | + } |
|
591 | + } |
|
592 | + |
|
593 | + /** |
|
594 | + * Returns the current configurator |
|
595 | + * @return the configurator |
|
596 | + */ |
|
597 | + public static function getConfigurationClass() { |
|
598 | + return self::$configurationClass; |
|
599 | + } |
|
600 | + |
|
601 | + /** |
|
602 | + * Returns the current configuration file |
|
603 | + * @return the configuration file |
|
604 | + */ |
|
605 | + public static function getConfigurationFile() { |
|
606 | + return self::$configurationFile; |
|
607 | + } |
|
608 | + |
|
609 | + /** |
|
610 | + * Returns, true, if the log4php framework is already initialized |
|
611 | + */ |
|
612 | + private static function isInitialized() { |
|
613 | + return self::$initialized; |
|
614 | + } |
|
615 | + |
|
616 | + /** |
|
617 | + * Initializes the log4php framework. |
|
618 | + * @return boolean |
|
619 | + */ |
|
620 | + public static function initialize() { |
|
621 | + self::$initialized = true; |
|
622 | + $instance = LoggerReflectionUtils::createObject(self::$configurationClass); |
|
623 | + $result = $instance->configure(self::getHierarchy(), self::$configurationFile); |
|
624 | + return $result; |
|
625 | + } |
|
626 | 626 | } |