@@ -50,7 +50,7 @@ |
||
| 50 | 50 | /** |
| 51 | 51 | * @param $value |
| 52 | 52 | */ |
| 53 | - public function addTransactionstatusForwarding($value){ |
|
| 53 | + public function addTransactionstatusForwarding($value) { |
|
| 54 | 54 | $this->transactionstatus_forwarding[] = $value; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -187,8 +187,7 @@ |
||
| 187 | 187 | |
| 188 | 188 | return $object->get($propertyName); |
| 189 | 189 | } |
| 190 | - } |
|
| 191 | - elseif (property_exists($this, $name)) { |
|
| 190 | + } elseif (property_exists($this, $name)) { |
|
| 192 | 191 | return $this->$name; |
| 193 | 192 | } |
| 194 | 193 | return null; |
@@ -41,16 +41,16 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | class Payone_Log4php_LoggerAppenderPhp extends Payone_Log4php_LoggerAppender { |
| 43 | 43 | |
| 44 | - public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 45 | - if($this->layout !== null) { |
|
| 46 | - $level = $event->getLevel(); |
|
| 47 | - if($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 48 | - trigger_error($this->layout->format($event), E_USER_ERROR); |
|
| 49 | - } else if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
|
| 50 | - trigger_error($this->layout->format($event), E_USER_WARNING); |
|
| 51 | - } else { |
|
| 52 | - trigger_error($this->layout->format($event), E_USER_NOTICE); |
|
| 53 | - } |
|
| 54 | - } |
|
| 55 | - } |
|
| 44 | + public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 45 | + if($this->layout !== null) { |
|
| 46 | + $level = $event->getLevel(); |
|
| 47 | + if($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 48 | + trigger_error($this->layout->format($event), E_USER_ERROR); |
|
| 49 | + } else if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
|
| 50 | + trigger_error($this->layout->format($event), E_USER_WARNING); |
|
| 51 | + } else { |
|
| 52 | + trigger_error($this->layout->format($event), E_USER_NOTICE); |
|
| 53 | + } |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -42,9 +42,9 @@ |
||
| 42 | 42 | class Payone_Log4php_LoggerAppenderPhp extends Payone_Log4php_LoggerAppender { |
| 43 | 43 | |
| 44 | 44 | public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
| 45 | - if($this->layout !== null) { |
|
| 45 | + if ($this->layout !== null) { |
|
| 46 | 46 | $level = $event->getLevel(); |
| 47 | - if($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 47 | + if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelError())) { |
|
| 48 | 48 | trigger_error($this->layout->format($event), E_USER_ERROR); |
| 49 | 49 | } else if ($level->isGreaterOrEqual(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
| 50 | 50 | trigger_error($this->layout->format($event), E_USER_WARNING); |
@@ -39,13 +39,13 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | class Payone_Log4php_LoggerRendererDefault implements Payone_Log4php_LoggerRendererObject { |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Render objects by type casting |
|
| 44 | - * |
|
| 45 | - * @param mixed $o the object to render |
|
| 46 | - * @return string |
|
| 47 | - */ |
|
| 48 | - public function render($o) { |
|
| 49 | - return var_export($o, true); |
|
| 50 | - } |
|
| 42 | + /** |
|
| 43 | + * Render objects by type casting |
|
| 44 | + * |
|
| 45 | + * @param mixed $o the object to render |
|
| 46 | + * @return string |
|
| 47 | + */ |
|
| 48 | + public function render($o) { |
|
| 49 | + return var_export($o, true); |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -35,21 +35,21 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | abstract class Payone_Log4php_LoggerPatternConverterSuperglobal extends Payone_Log4php_LoggerPatternConverter { |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Name of the superglobal variable, to be defined by subclasses. |
|
| 40 | - * For example: "_SERVER" or "_ENV". |
|
| 41 | - */ |
|
| 42 | - protected $name; |
|
| 38 | + /** |
|
| 39 | + * Name of the superglobal variable, to be defined by subclasses. |
|
| 40 | + * For example: "_SERVER" or "_ENV". |
|
| 41 | + */ |
|
| 42 | + protected $name; |
|
| 43 | 43 | |
| 44 | - protected $value = ''; |
|
| 44 | + protected $value = ''; |
|
| 45 | 45 | |
| 46 | - public function activateOptions() { |
|
| 47 | - // Read the key from options array |
|
| 48 | - if (isset($this->option) && $this->option !== '') { |
|
| 49 | - $key = $this->option; |
|
| 50 | - } |
|
| 46 | + public function activateOptions() { |
|
| 47 | + // Read the key from options array |
|
| 48 | + if (isset($this->option) && $this->option !== '') { |
|
| 49 | + $key = $this->option; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /* |
|
| 52 | + /* |
|
| 53 | 53 | * There is a bug in PHP which doesn't allow superglobals to be |
| 54 | 54 | * accessed when their name is stored in a variable, e.g.: |
| 55 | 55 | * |
@@ -65,35 +65,35 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * That's why global is used here. |
| 67 | 67 | */ |
| 68 | - global ${$this->name}; |
|
| 68 | + global ${$this->name}; |
|
| 69 | 69 | |
| 70 | - // Check the given superglobal exists. It is possible that it is not initialized. |
|
| 71 | - if (!isset(${$this->name})) { |
|
| 72 | - $class = get_class($this); |
|
| 73 | - trigger_error("log4php: $class: Cannot find superglobal variable \${$this->name}.", E_USER_WARNING); |
|
| 74 | - return; |
|
| 75 | - } |
|
| 70 | + // Check the given superglobal exists. It is possible that it is not initialized. |
|
| 71 | + if (!isset(${$this->name})) { |
|
| 72 | + $class = get_class($this); |
|
| 73 | + trigger_error("log4php: $class: Cannot find superglobal variable \${$this->name}.", E_USER_WARNING); |
|
| 74 | + return; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - $source = ${$this->name}; |
|
| 77 | + $source = ${$this->name}; |
|
| 78 | 78 | |
| 79 | - // When the key is set, display the matching value |
|
| 80 | - if (isset($key)) { |
|
| 81 | - if (isset($source[$key])) { |
|
| 82 | - $this->value = $source[$key]; |
|
| 83 | - } |
|
| 84 | - } |
|
| 79 | + // When the key is set, display the matching value |
|
| 80 | + if (isset($key)) { |
|
| 81 | + if (isset($source[$key])) { |
|
| 82 | + $this->value = $source[$key]; |
|
| 83 | + } |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - // When the key is not set, display all values |
|
| 87 | - else { |
|
| 88 | - $values = array(); |
|
| 89 | - foreach($source as $key => $value) { |
|
| 90 | - $values[] = "$key=$value"; |
|
| 91 | - } |
|
| 92 | - $this->value = implode(', ', $values); |
|
| 93 | - } |
|
| 94 | - } |
|
| 86 | + // When the key is not set, display all values |
|
| 87 | + else { |
|
| 88 | + $values = array(); |
|
| 89 | + foreach($source as $key => $value) { |
|
| 90 | + $values[] = "$key=$value"; |
|
| 91 | + } |
|
| 92 | + $this->value = implode(', ', $values); |
|
| 93 | + } |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - public function convert(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 97 | - return $this->value; |
|
| 98 | - } |
|
| 96 | + public function convert(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 97 | + return $this->value; |
|
| 98 | + } |
|
| 99 | 99 | } |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | // When the key is not set, display all values |
| 87 | 87 | else { |
| 88 | 88 | $values = array(); |
| 89 | - foreach($source as $key => $value) { |
|
| 89 | + foreach ($source as $key => $value) { |
|
| 90 | 90 | $values[] = "$key=$value"; |
| 91 | 91 | } |
| 92 | 92 | $this->value = implode(', ', $values); |
@@ -47,168 +47,168 @@ |
||
| 47 | 47 | * @subpackage layouts |
| 48 | 48 | */ |
| 49 | 49 | class Payone_Log4php_LoggerLayoutHtml extends Payone_Log4php_LoggerLayout { |
| 50 | - /** |
|
| 51 | - * The <b>LocationInfo</b> option takes a boolean value. By |
|
| 52 | - * default, it is set to false which means there will be no location |
|
| 53 | - * information output by this layout. If the the option is set to |
|
| 54 | - * true, then the file name and line number of the statement |
|
| 55 | - * at the origin of the log statement will be output. |
|
| 56 | - * |
|
| 57 | - * <p>If you are embedding this layout within a {@link Payone_Log4php_LoggerAppenderMail} |
|
| 58 | - * or a {@link Payone_Log4php_LoggerAppenderMailEvent} then make sure to set the |
|
| 59 | - * <b>LocationInfo</b> option of that appender as well. |
|
| 60 | - * @var boolean |
|
| 61 | - */ |
|
| 62 | - protected $locationInfo = false; |
|
| 50 | + /** |
|
| 51 | + * The <b>LocationInfo</b> option takes a boolean value. By |
|
| 52 | + * default, it is set to false which means there will be no location |
|
| 53 | + * information output by this layout. If the the option is set to |
|
| 54 | + * true, then the file name and line number of the statement |
|
| 55 | + * at the origin of the log statement will be output. |
|
| 56 | + * |
|
| 57 | + * <p>If you are embedding this layout within a {@link Payone_Log4php_LoggerAppenderMail} |
|
| 58 | + * or a {@link Payone_Log4php_LoggerAppenderMailEvent} then make sure to set the |
|
| 59 | + * <b>LocationInfo</b> option of that appender as well. |
|
| 60 | + * @var boolean |
|
| 61 | + */ |
|
| 62 | + protected $locationInfo = false; |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * The <b>Title</b> option takes a String value. This option sets the |
|
| 66 | - * document title of the generated HTML document. |
|
| 67 | - * Defaults to 'Log4php Log Messages'. |
|
| 68 | - * @var string |
|
| 69 | - */ |
|
| 70 | - protected $title = "Log4php Log Messages"; |
|
| 64 | + /** |
|
| 65 | + * The <b>Title</b> option takes a String value. This option sets the |
|
| 66 | + * document title of the generated HTML document. |
|
| 67 | + * Defaults to 'Log4php Log Messages'. |
|
| 68 | + * @var string |
|
| 69 | + */ |
|
| 70 | + protected $title = "Log4php Log Messages"; |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * The <b>LocationInfo</b> option takes a boolean value. By |
|
| 74 | - * default, it is set to false which means there will be no location |
|
| 75 | - * information output by this layout. If the the option is set to |
|
| 76 | - * true, then the file name and line number of the statement |
|
| 77 | - * at the origin of the log statement will be output. |
|
| 78 | - * |
|
| 79 | - * <p>If you are embedding this layout within a {@link Payone_Log4php_LoggerAppenderMail} |
|
| 80 | - * or a {@link Payone_Log4php_LoggerAppenderMailEvent} then make sure to set the |
|
| 81 | - * <b>LocationInfo</b> option of that appender as well. |
|
| 82 | - */ |
|
| 83 | - public function setLocationInfo($flag) { |
|
| 84 | - $this->setBoolean('locationInfo', $flag); |
|
| 85 | - } |
|
| 72 | + /** |
|
| 73 | + * The <b>LocationInfo</b> option takes a boolean value. By |
|
| 74 | + * default, it is set to false which means there will be no location |
|
| 75 | + * information output by this layout. If the the option is set to |
|
| 76 | + * true, then the file name and line number of the statement |
|
| 77 | + * at the origin of the log statement will be output. |
|
| 78 | + * |
|
| 79 | + * <p>If you are embedding this layout within a {@link Payone_Log4php_LoggerAppenderMail} |
|
| 80 | + * or a {@link Payone_Log4php_LoggerAppenderMailEvent} then make sure to set the |
|
| 81 | + * <b>LocationInfo</b> option of that appender as well. |
|
| 82 | + */ |
|
| 83 | + public function setLocationInfo($flag) { |
|
| 84 | + $this->setBoolean('locationInfo', $flag); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - /** |
|
| 88 | - * Returns the current value of the <b>LocationInfo</b> option. |
|
| 89 | - */ |
|
| 90 | - public function getLocationInfo() { |
|
| 91 | - return $this->locationInfo; |
|
| 92 | - } |
|
| 87 | + /** |
|
| 88 | + * Returns the current value of the <b>LocationInfo</b> option. |
|
| 89 | + */ |
|
| 90 | + public function getLocationInfo() { |
|
| 91 | + return $this->locationInfo; |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * The <b>Title</b> option takes a String value. This option sets the |
|
| 96 | - * document title of the generated HTML document. |
|
| 97 | - * Defaults to 'Log4php Log Messages'. |
|
| 98 | - */ |
|
| 99 | - public function setTitle($title) { |
|
| 100 | - $this->setString('title', $title); |
|
| 101 | - } |
|
| 94 | + /** |
|
| 95 | + * The <b>Title</b> option takes a String value. This option sets the |
|
| 96 | + * document title of the generated HTML document. |
|
| 97 | + * Defaults to 'Log4php Log Messages'. |
|
| 98 | + */ |
|
| 99 | + public function setTitle($title) { |
|
| 100 | + $this->setString('title', $title); |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * @return string Returns the current value of the <b>Title</b> option. |
|
| 105 | - */ |
|
| 106 | - public function getTitle() { |
|
| 107 | - return $this->title; |
|
| 108 | - } |
|
| 103 | + /** |
|
| 104 | + * @return string Returns the current value of the <b>Title</b> option. |
|
| 105 | + */ |
|
| 106 | + public function getTitle() { |
|
| 107 | + return $this->title; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - /** |
|
| 111 | - * @return string Returns the content type output by this layout, i.e "text/html". |
|
| 112 | - */ |
|
| 113 | - public function getContentType() { |
|
| 114 | - return "text/html"; |
|
| 115 | - } |
|
| 110 | + /** |
|
| 111 | + * @return string Returns the content type output by this layout, i.e "text/html". |
|
| 112 | + */ |
|
| 113 | + public function getContentType() { |
|
| 114 | + return "text/html"; |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - /** |
|
| 118 | - * @param Payone_Log4php_LoggerLoggingEvent $event |
|
| 119 | - * @return string |
|
| 120 | - */ |
|
| 121 | - public function format(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 122 | - $sbuf = PHP_EOL . "<tr>" . PHP_EOL; |
|
| 117 | + /** |
|
| 118 | + * @param Payone_Log4php_LoggerLoggingEvent $event |
|
| 119 | + * @return string |
|
| 120 | + */ |
|
| 121 | + public function format(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 122 | + $sbuf = PHP_EOL . "<tr>" . PHP_EOL; |
|
| 123 | 123 | |
| 124 | - $sbuf .= "<td>"; |
|
| 125 | - $sbuf .= $event->getTime(); |
|
| 126 | - $sbuf .= "</td>" . PHP_EOL; |
|
| 124 | + $sbuf .= "<td>"; |
|
| 125 | + $sbuf .= $event->getTime(); |
|
| 126 | + $sbuf .= "</td>" . PHP_EOL; |
|
| 127 | 127 | |
| 128 | - $sbuf .= "<td title=\"" . $event->getThreadName() . " thread\">"; |
|
| 129 | - $sbuf .= $event->getThreadName(); |
|
| 130 | - $sbuf .= "</td>" . PHP_EOL; |
|
| 128 | + $sbuf .= "<td title=\"" . $event->getThreadName() . " thread\">"; |
|
| 129 | + $sbuf .= $event->getThreadName(); |
|
| 130 | + $sbuf .= "</td>" . PHP_EOL; |
|
| 131 | 131 | |
| 132 | - $sbuf .= "<td title=\"Level\">"; |
|
| 132 | + $sbuf .= "<td title=\"Level\">"; |
|
| 133 | 133 | |
| 134 | - $level = $event->getLevel(); |
|
| 134 | + $level = $event->getLevel(); |
|
| 135 | 135 | |
| 136 | - if ($level->equals(Payone_Log4php_LoggerLevel::getLevelDebug())) { |
|
| 137 | - $sbuf .= "<font color=\"#339933\">$level</font>"; |
|
| 138 | - } else if ($level->equals(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
|
| 139 | - $sbuf .= "<font color=\"#993300\"><strong>$level</strong></font>"; |
|
| 140 | - } else { |
|
| 141 | - $sbuf .= $level; |
|
| 142 | - } |
|
| 143 | - $sbuf .= "</td>" . PHP_EOL; |
|
| 136 | + if ($level->equals(Payone_Log4php_LoggerLevel::getLevelDebug())) { |
|
| 137 | + $sbuf .= "<font color=\"#339933\">$level</font>"; |
|
| 138 | + } else if ($level->equals(Payone_Log4php_LoggerLevel::getLevelWarn())) { |
|
| 139 | + $sbuf .= "<font color=\"#993300\"><strong>$level</strong></font>"; |
|
| 140 | + } else { |
|
| 141 | + $sbuf .= $level; |
|
| 142 | + } |
|
| 143 | + $sbuf .= "</td>" . PHP_EOL; |
|
| 144 | 144 | |
| 145 | - $sbuf .= "<td title=\"" . htmlentities($event->getLoggerName(), ENT_QUOTES) . " category\">"; |
|
| 146 | - $sbuf .= htmlentities($event->getLoggerName(), ENT_QUOTES); |
|
| 147 | - $sbuf .= "</td>" . PHP_EOL; |
|
| 145 | + $sbuf .= "<td title=\"" . htmlentities($event->getLoggerName(), ENT_QUOTES) . " category\">"; |
|
| 146 | + $sbuf .= htmlentities($event->getLoggerName(), ENT_QUOTES); |
|
| 147 | + $sbuf .= "</td>" . PHP_EOL; |
|
| 148 | 148 | |
| 149 | - if ($this->locationInfo) { |
|
| 150 | - $locInfo = $event->getLocationInformation(); |
|
| 151 | - $sbuf .= "<td>"; |
|
| 152 | - $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES). ':' . $locInfo->getLineNumber(); |
|
| 153 | - $sbuf .= "</td>" . PHP_EOL; |
|
| 154 | - } |
|
| 149 | + if ($this->locationInfo) { |
|
| 150 | + $locInfo = $event->getLocationInformation(); |
|
| 151 | + $sbuf .= "<td>"; |
|
| 152 | + $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES). ':' . $locInfo->getLineNumber(); |
|
| 153 | + $sbuf .= "</td>" . PHP_EOL; |
|
| 154 | + } |
|
| 155 | 155 | |
| 156 | - $sbuf .= "<td title=\"Message\">"; |
|
| 157 | - $sbuf .= htmlentities($event->getRenderedMessage(), ENT_QUOTES); |
|
| 158 | - $sbuf .= "</td>" . PHP_EOL; |
|
| 156 | + $sbuf .= "<td title=\"Message\">"; |
|
| 157 | + $sbuf .= htmlentities($event->getRenderedMessage(), ENT_QUOTES); |
|
| 158 | + $sbuf .= "</td>" . PHP_EOL; |
|
| 159 | 159 | |
| 160 | - $sbuf .= "</tr>" . PHP_EOL; |
|
| 160 | + $sbuf .= "</tr>" . PHP_EOL; |
|
| 161 | 161 | |
| 162 | - if ($event->getNDC() != null) { |
|
| 163 | - $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">"; |
|
| 164 | - $sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES); |
|
| 165 | - $sbuf .= "</td></tr>" . PHP_EOL; |
|
| 166 | - } |
|
| 167 | - return $sbuf; |
|
| 168 | - } |
|
| 162 | + if ($event->getNDC() != null) { |
|
| 163 | + $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">"; |
|
| 164 | + $sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES); |
|
| 165 | + $sbuf .= "</td></tr>" . PHP_EOL; |
|
| 166 | + } |
|
| 167 | + return $sbuf; |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | - /** |
|
| 171 | - * @return string Returns appropriate HTML headers. |
|
| 172 | - */ |
|
| 173 | - public function getHeader() { |
|
| 174 | - $sbuf = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . PHP_EOL; |
|
| 175 | - $sbuf .= "<html>" . PHP_EOL; |
|
| 176 | - $sbuf .= "<head>" . PHP_EOL; |
|
| 177 | - $sbuf .= "<title>" . $this->title . "</title>" . PHP_EOL; |
|
| 178 | - $sbuf .= "<style type=\"text/css\">" . PHP_EOL; |
|
| 179 | - $sbuf .= "<!--" . PHP_EOL; |
|
| 180 | - $sbuf .= "body, table {font-family: arial,sans-serif; font-size: x-small;}" . PHP_EOL; |
|
| 181 | - $sbuf .= "th {background: #336699; color: #FFFFFF; text-align: left;}" . PHP_EOL; |
|
| 182 | - $sbuf .= "-->" . PHP_EOL; |
|
| 183 | - $sbuf .= "</style>" . PHP_EOL; |
|
| 184 | - $sbuf .= "</head>" . PHP_EOL; |
|
| 185 | - $sbuf .= "<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">" . PHP_EOL; |
|
| 186 | - $sbuf .= "<hr size=\"1\" noshade>" . PHP_EOL; |
|
| 187 | - $sbuf .= "Log session start time " . strftime('%c', time()) . "<br>" . PHP_EOL; |
|
| 188 | - $sbuf .= "<br>" . PHP_EOL; |
|
| 189 | - $sbuf .= "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">" . PHP_EOL; |
|
| 190 | - $sbuf .= "<tr>" . PHP_EOL; |
|
| 191 | - $sbuf .= "<th>Time</th>" . PHP_EOL; |
|
| 192 | - $sbuf .= "<th>Thread</th>" . PHP_EOL; |
|
| 193 | - $sbuf .= "<th>Level</th>" . PHP_EOL; |
|
| 194 | - $sbuf .= "<th>Category</th>" . PHP_EOL; |
|
| 195 | - if ($this->locationInfo) { |
|
| 196 | - $sbuf .= "<th>File:Line</th>" . PHP_EOL; |
|
| 197 | - } |
|
| 198 | - $sbuf .= "<th>Message</th>" . PHP_EOL; |
|
| 199 | - $sbuf .= "</tr>" . PHP_EOL; |
|
| 170 | + /** |
|
| 171 | + * @return string Returns appropriate HTML headers. |
|
| 172 | + */ |
|
| 173 | + public function getHeader() { |
|
| 174 | + $sbuf = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . PHP_EOL; |
|
| 175 | + $sbuf .= "<html>" . PHP_EOL; |
|
| 176 | + $sbuf .= "<head>" . PHP_EOL; |
|
| 177 | + $sbuf .= "<title>" . $this->title . "</title>" . PHP_EOL; |
|
| 178 | + $sbuf .= "<style type=\"text/css\">" . PHP_EOL; |
|
| 179 | + $sbuf .= "<!--" . PHP_EOL; |
|
| 180 | + $sbuf .= "body, table {font-family: arial,sans-serif; font-size: x-small;}" . PHP_EOL; |
|
| 181 | + $sbuf .= "th {background: #336699; color: #FFFFFF; text-align: left;}" . PHP_EOL; |
|
| 182 | + $sbuf .= "-->" . PHP_EOL; |
|
| 183 | + $sbuf .= "</style>" . PHP_EOL; |
|
| 184 | + $sbuf .= "</head>" . PHP_EOL; |
|
| 185 | + $sbuf .= "<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">" . PHP_EOL; |
|
| 186 | + $sbuf .= "<hr size=\"1\" noshade>" . PHP_EOL; |
|
| 187 | + $sbuf .= "Log session start time " . strftime('%c', time()) . "<br>" . PHP_EOL; |
|
| 188 | + $sbuf .= "<br>" . PHP_EOL; |
|
| 189 | + $sbuf .= "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">" . PHP_EOL; |
|
| 190 | + $sbuf .= "<tr>" . PHP_EOL; |
|
| 191 | + $sbuf .= "<th>Time</th>" . PHP_EOL; |
|
| 192 | + $sbuf .= "<th>Thread</th>" . PHP_EOL; |
|
| 193 | + $sbuf .= "<th>Level</th>" . PHP_EOL; |
|
| 194 | + $sbuf .= "<th>Category</th>" . PHP_EOL; |
|
| 195 | + if ($this->locationInfo) { |
|
| 196 | + $sbuf .= "<th>File:Line</th>" . PHP_EOL; |
|
| 197 | + } |
|
| 198 | + $sbuf .= "<th>Message</th>" . PHP_EOL; |
|
| 199 | + $sbuf .= "</tr>" . PHP_EOL; |
|
| 200 | 200 | |
| 201 | - return $sbuf; |
|
| 202 | - } |
|
| 201 | + return $sbuf; |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | - /** |
|
| 205 | - * @return string Returns the appropriate HTML footers. |
|
| 206 | - */ |
|
| 207 | - public function getFooter() { |
|
| 208 | - $sbuf = "</table>" . PHP_EOL; |
|
| 209 | - $sbuf .= "<br>" . PHP_EOL; |
|
| 210 | - $sbuf .= "</body></html>"; |
|
| 204 | + /** |
|
| 205 | + * @return string Returns the appropriate HTML footers. |
|
| 206 | + */ |
|
| 207 | + public function getFooter() { |
|
| 208 | + $sbuf = "</table>" . PHP_EOL; |
|
| 209 | + $sbuf .= "<br>" . PHP_EOL; |
|
| 210 | + $sbuf .= "</body></html>"; |
|
| 211 | 211 | |
| 212 | - return $sbuf; |
|
| 213 | - } |
|
| 212 | + return $sbuf; |
|
| 213 | + } |
|
| 214 | 214 | } |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | if ($this->locationInfo) { |
| 150 | 150 | $locInfo = $event->getLocationInformation(); |
| 151 | 151 | $sbuf .= "<td>"; |
| 152 | - $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES). ':' . $locInfo->getLineNumber(); |
|
| 152 | + $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES) . ':' . $locInfo->getLineNumber(); |
|
| 153 | 153 | $sbuf .= "</td>" . PHP_EOL; |
| 154 | 154 | } |
| 155 | 155 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class Payone_Log4php_LoggerPatternConverterNewLine extends Payone_Log4php_LoggerPatternConverter { |
| 28 | 28 | |
| 29 | - public function convert(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 30 | - return PHP_EOL; |
|
| 31 | - } |
|
| 29 | + public function convert(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 30 | + return PHP_EOL; |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class Payone_Log4php_LoggerPatternConverterClass extends Payone_Log4php_LoggerPatternConverter { |
| 29 | 29 | |
| 30 | - public function convert(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 31 | - return $event->getLocationInformation()->getClassName(); |
|
| 32 | - } |
|
| 30 | + public function convert(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 31 | + return $event->getLocationInformation()->getClassName(); |
|
| 32 | + } |
|
| 33 | 33 | } |
| 34 | - |
|
| 35 | 34 | \ No newline at end of file |
| 35 | + |
|
| 36 | 36 | \ No newline at end of file |
@@ -25,50 +25,50 @@ |
||
| 25 | 25 | * @package log4php |
| 26 | 26 | */ |
| 27 | 27 | abstract class Payone_Log4php_LoggerLayout extends Payone_Log4php_LoggerConfigurable { |
| 28 | - /** |
|
| 29 | - * Activates options for this layout. |
|
| 30 | - * Override this method if you have options to be activated. |
|
| 31 | - */ |
|
| 32 | - public function activateOptions() { |
|
| 33 | - return true; |
|
| 34 | - } |
|
| 28 | + /** |
|
| 29 | + * Activates options for this layout. |
|
| 30 | + * Override this method if you have options to be activated. |
|
| 31 | + */ |
|
| 32 | + public function activateOptions() { |
|
| 33 | + return true; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Override this method to create your own layout format. |
|
| 38 | - * |
|
| 39 | - * @param LoggerLoggingEvent |
|
| 40 | - * @return string |
|
| 41 | - */ |
|
| 42 | - public function format(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 43 | - return $event->getRenderedMessage(); |
|
| 44 | - } |
|
| 36 | + /** |
|
| 37 | + * Override this method to create your own layout format. |
|
| 38 | + * |
|
| 39 | + * @param LoggerLoggingEvent |
|
| 40 | + * @return string |
|
| 41 | + */ |
|
| 42 | + public function format(Payone_Log4php_LoggerLoggingEvent $event) { |
|
| 43 | + return $event->getRenderedMessage(); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Returns the content type output by this layout. |
|
| 48 | - * @return string |
|
| 49 | - */ |
|
| 50 | - public function getContentType() { |
|
| 51 | - return "text/plain"; |
|
| 52 | - } |
|
| 46 | + /** |
|
| 47 | + * Returns the content type output by this layout. |
|
| 48 | + * @return string |
|
| 49 | + */ |
|
| 50 | + public function getContentType() { |
|
| 51 | + return "text/plain"; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Returns the footer for the layout format. |
|
| 56 | - * @return string |
|
| 57 | - */ |
|
| 58 | - public function getFooter() { |
|
| 59 | - return null; |
|
| 60 | - } |
|
| 54 | + /** |
|
| 55 | + * Returns the footer for the layout format. |
|
| 56 | + * @return string |
|
| 57 | + */ |
|
| 58 | + public function getFooter() { |
|
| 59 | + return null; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Returns the header for the layout format. |
|
| 64 | - * @return string |
|
| 65 | - */ |
|
| 66 | - public function getHeader() { |
|
| 67 | - return null; |
|
| 68 | - } |
|
| 62 | + /** |
|
| 63 | + * Returns the header for the layout format. |
|
| 64 | + * @return string |
|
| 65 | + */ |
|
| 66 | + public function getHeader() { |
|
| 67 | + return null; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - /** Triggers a warning for this layout with the given message. */ |
|
| 71 | - protected function warn($message) { |
|
| 72 | - trigger_error("log4php: [" . get_class($this) . "]: $message", E_USER_WARNING); |
|
| 73 | - } |
|
| 70 | + /** Triggers a warning for this layout with the given message. */ |
|
| 71 | + protected function warn($message) { |
|
| 72 | + trigger_error("log4php: [" . get_class($this) . "]: $message", E_USER_WARNING); |
|
| 73 | + } |
|
| 74 | 74 | } |