Author: grobmeier
Date: Thu May 7 05:16:03 2009
New Revision: 772504
URL: http://svn.apache.org/viewvc?rev=772504&view=rev
Log:
moved method from helper class to private in loggerxmllayout, since it is the
only place where it could be used
Modified:
incubator/log4php/trunk/src/main/php/helpers/LoggerTransform.php
incubator/log4php/trunk/src/main/php/layouts/LoggerXmlLayout.php
Modified: incubator/log4php/trunk/src/main/php/helpers/LoggerTransform.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerTransform.php?rev=772504&r1=772503&r2=772504&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerTransform.php (original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerTransform.php Thu May 7
05:16:03 2009
@@ -61,28 +61,5 @@
return htmlspecialchars($input, ENT_NOQUOTES);
}
- /**
- * Ensures that embeded CDEnd strings (]]>) are handled properly
- * within message, NDC and throwable tag text.
- *
- * @param string $buf String holding the XML data to this point.
The
- * initial CDStart
(<![CDATA[) and final CDEnd (]]>)
- * of the CDATA section
are the responsibility of
- * the calling method.
- * @param string &str The String that is inserted into an existing
- * CDATA Section within
buf.
- * @static
- */
- function appendEscapingCDATA(&$buf, $str) {
- if(empty($str)) {
- return;
- }
- $rStr = str_replace(
- LOG4PHP_LOGGER_TRANSFORM_CDATA_END,
- LOG4PHP_LOGGER_TRANSFORM_CDATA_EMBEDDED_END,
- $str
- );
- $buf .= $rStr;
- }
}
Modified: incubator/log4php/trunk/src/main/php/layouts/LoggerXmlLayout.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/layouts/LoggerXmlLayout.php?rev=772504&r1=772503&r2=772504&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/layouts/LoggerXmlLayout.php (original)
+++ incubator/log4php/trunk/src/main/php/layouts/LoggerXmlLayout.php Thu May 7
05:16:03 2009
@@ -111,13 +111,13 @@
$buf = "<{$this->_namespacePrefix}:event logger=\"{$loggerName}\"
level=\"{$levelStr}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">\r\n";
$buf .= "<{$this->_namespacePrefix}:message><![CDATA[";
- LoggerTransform::appendEscapingCDATA($buf,
$event->getRenderedMessage());
+ $this->appendEscapingCDATA($buf, $event->getRenderedMessage());
$buf .= "]]></{$this->_namespacePrefix}:message>\r\n";
$ndc = $event->getNDC();
if($ndc != null) {
$buf .= "<{$this->_namespacePrefix}:NDC><![CDATA[";
- LoggerTransform::appendEscapingCDATA($buf, $ndc);
+ $this->appendEscapingCDATA($buf, $ndc);
$buf .= "]]></{$this->_namespacePrefix}:NDC>\r\n";
}
@@ -192,5 +192,30 @@
{
$this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, true);
}
+
+ /**
+ * Ensures that embeded CDEnd strings (]]>) are handled properly
+ * within message, NDC and throwable tag text.
+ *
+ * @param string $buf String holding the XML data to this point.
The
+ * initial CDStart
(<![CDATA[) and final CDEnd (]]>)
+ * of the CDATA section
are the responsibility of
+ * the calling method.
+ * @param string &str The String that is inserted into an existing
+ * CDATA Section within
buf.
+ * @static
+ */
+ private function appendEscapingCDATA(&$buf, $str) {
+ if(empty($str)) {
+ return;
+ }
+
+ $rStr = str_replace(
+ LOG4PHP_LOGGER_TRANSFORM_CDATA_END,
+ LOG4PHP_LOGGER_TRANSFORM_CDATA_EMBEDDED_END,
+ $str
+ );
+ $buf .= $rStr;
+ }
}