Author: grobmeier
Date: Mon Jul 20 10:01:41 2009
New Revision: 795734
URL: http://svn.apache.org/viewvc?rev=795734&view=rev
Log:
LOG4PHP-53: Removed references were appropriate
Modified:
incubator/log4php/trunk/src/changes/changes.xml
incubator/log4php/trunk/src/main/php/LoggerReflectionUtils.php
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorPhp.php
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorXml.php
incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php
incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php
incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php
incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutPattern.php
incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutXml.php
Modified: incubator/log4php/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/changes/changes.xml?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
--- incubator/log4php/trunk/src/changes/changes.xml (original)
+++ incubator/log4php/trunk/src/changes/changes.xml Mon Jul 20 10:01:41 2009
@@ -58,6 +58,7 @@
<action type="update" issue="LOG4PHP-43">Remove size
restriction of MDC table in LoggerMDC (Knut Urdalen)</action>
<action type="update" issue="LOG4PHP-44">PEAR package (Knut
Urdalen)</action>
<action type="update" issue="LOG4PHP-52">Use of custom factorys
is discouraged - clean up (Christian Grobmeier)</action>
+ <action type="update" issue="LOG4PHP-53">Removed references
were appropriate (Christian Grobmeier)</action>
<action type="fix" issue="LOG4PHP-54">PHPDoc is wrong due to
class movements - clean up (Christian Grobmeier)</action>
<action type="update">Initial port to PHP 5 (Knut
Urdalen)</action>
<action type="update">Established new unit test suite (Knut
Urdalen)</action>
Modified: incubator/log4php/trunk/src/main/php/LoggerReflectionUtils.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerReflectionUtils.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerReflectionUtils.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerReflectionUtils.php Mon Jul 20
10:01:41 2009
@@ -31,8 +31,8 @@
* one or more times.
* @param object &$obj the object for which to set properties
*/
- public function __construct(&$obj) {
- $this->obj =& $obj;
+ public function __construct($obj) {
+ $this->obj = $obj;
}
/**
@@ -40,13 +40,13 @@
* go. The <code>properties</code> are parsed relative to a
* <code>prefix</code>.
*
- * @param object &$obj The object to configure.
+ * @param object $obj The object to configure.
* @param array $properties An array containing keys and values.
* @param string $prefix Only keys having the specified prefix will be
set.
* @static
*/
// TODO: check, if this is really useful
- public static function setPropertiesByObject(&$obj, $properties,
$prefix) {
+ public static function setPropertiesByObject($obj, $properties,
$prefix) {
$pSetter = new LoggerReflectionUtils($obj);
return $pSetter->setProperties($properties, $prefix);
}
@@ -110,13 +110,13 @@
// no such setter method
return;
} else {
- return call_user_func(array(&$this->obj, $method),
$value);
+ return call_user_func(array($this->obj, $method),
$value);
}
}
public function activate() {
if(method_exists($this->obj, 'activateoptions')) {
- return call_user_func(array(&$this->obj,
'activateoptions'));
+ return call_user_func(array($this->obj,
'activateoptions'));
}
}
@@ -139,13 +139,13 @@
* @param string $name
* @param mixed $value
*/
- public function setter(&$object, $name, $value) {
+ public function setter($object, $name, $value) {
if (empty($name)) {
return false;
}
$methodName = 'set'.ucfirst($name);
if (method_exists($object, $methodName)) {
- return call_user_func(array(&$object, $methodName), $value);
+ return call_user_func(array($object, $methodName), $value);
} else {
return false;
}
Modified:
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
---
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php
(original)
+++
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php
Mon Jul 20 10:01:41 2009
@@ -298,9 +298,9 @@
*
* @param string $url The name of the configuration file where the
* configuration information is
stored.
- * @param LoggerHierarchy &$repository the repository to apply the
configuration
+ * @param LoggerHierarchy $repository the repository to apply the
configuration
*/
- private function doConfigure($url, &$repository) {
+ private function doConfigure($url, LoggerHierarchy $repository) {
$properties = @parse_ini_file($url);
if($properties === false || count($properties) == 0) {
// as of PHP 5.2.7 parse_ini_file() returns FALSE
instead of an empty array
@@ -315,9 +315,9 @@
*
* @see doConfigure().
* @param array $properties
- * @param LoggerHierarchy &$hierarchy
+ * @param LoggerHierarchy $hierarchy
*/
- private function doConfigureProperties($properties, &$hierarchy) {
+ private function doConfigureProperties($properties, LoggerHierarchy
$hierarchy) {
/*
$value = @$properties[LOGGER_DEBUG_KEY];
@@ -342,9 +342,9 @@
/**
* @param array $props array of properties
- * @param LoggerHierarchy &$hierarchy
+ * @param LoggerHierarchy $hierarchy
*/
- private function configureRootCategory($props, &$hierarchy) {
+ private function configureRootCategory($props, LoggerHierarchy
$hierarchy) {
$effectivePrefix = self::ROOT_LOGGER_PREFIX;
$value = @$props[self::ROOT_LOGGER_PREFIX];
@@ -376,9 +376,9 @@
* Parse non-root elements, such non-root categories and renderers.
*
* @param array $props array of properties
- * @param LoggerHierarchy &$hierarchy
+ * @param LoggerHierarchy $hierarchy
*/
- private function parseCatsAndRenderers($props, &$hierarchy) {
+ private function parseCatsAndRenderers($props, LoggerHierarchy
$hierarchy) {
while(list($key,$value) = each($props)) {
if(strpos($key, self::CATEGORY_PREFIX) === 0 or
strpos($key, self::LOGGER_PREFIX) === 0) {
@@ -407,10 +407,10 @@
* Parse the additivity option for a non-root category.
*
* @param array $props array of properties
- * @param Logger &$cat
+ * @param Logger $cat
* @param string $loggerName
*/
- private function parseAdditivityForLogger($props, &$cat, $loggerName) {
+ private function parseAdditivityForLogger($props, Logger $cat,
$loggerName) {
$value = LoggerOptionConverter::findAndSubst(
self::ADDITIVITY_PREFIX . $loggerName,
$props
@@ -427,13 +427,13 @@
* This method must work for the root category as well.
*
* @param array $props array of properties
- * @param Logger &$logger
+ * @param Logger $logger
* @param string $optionKey
* @param string $loggerName
* @param string $value
* @return Logger
*/
- private function parseCategory($props, &$logger, $optionKey,
$loggerName, $value) {
+ private function parseCategory($props, Logger $logger, $optionKey,
$loggerName, $value) {
// We must skip over ',' but not white space
$st = explode(',', $value);
@@ -474,7 +474,7 @@
continue;
}
- $appender =& $this->parseAppender($props,
$appenderName);
+ $appender = $this->parseAppender($props, $appenderName);
if($appender !== null) {
$logger->addAppender($appender);
}
@@ -486,7 +486,7 @@
* @param string $appenderName
* @return LoggerAppender
*/
- private function &parseAppender($props, $appenderName) {
+ private function parseAppender($props, $appenderName) {
$appender = LoggerAppender::singleton($appenderName);
if($appender !== null) {
return $appender;
Modified:
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorPhp.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorPhp.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
---
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorPhp.php
(original)
+++
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorPhp.php
Mon Jul 20 10:01:41 2009
@@ -62,7 +62,7 @@
return $configurator->doConfigure($url, $hierarchy);
}
- private function doConfigure($url, &$hierarchy) {
+ private function doConfigure($url, LoggerHierarchy $hierarchy) {
$config = require $url;
Modified:
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorXml.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorXml.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
---
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorXml.php
(original)
+++
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorXml.php
Mon Jul 20 10:01:41 2009
@@ -132,9 +132,9 @@
* set to "1".
*
* @param string $url
- * @param LoggerHierarchy &$repository
+ * @param LoggerHierarchy $repository
*/
- private function doConfigure($url = '', &$repository)
+ private function doConfigure($url = '', LoggerHierarchy $repository)
{
$xmlData = '';
if (!empty($url))
@@ -146,17 +146,17 @@
* Configure the given <b>repository</b> using the configuration written
in <b>xmlData</b>.
* Do not call this method directly. Use {...@link doConfigure()} instead.
* @param string $xmlData
- * @param LoggerHierarchy &$repository
+ * @param LoggerHierarchy $repository
*/
- private function doConfigureByString($xmlData, &$repository)
+ private function doConfigureByString($xmlData, LoggerHierarchy $repository)
{
return $this->parse($xmlData, $repository);
}
/**
- * @param LoggerHierarchy &$repository
+ * @param LoggerHierarchy $repository
*/
- private function doConfigureDefault(&$repository)
+ private function doConfigureDefault(LoggerHierarchy $repository)
{
return $this->doConfigureByString(self::DEFAULT_CONFIGURATION,
$repository);
}
@@ -164,10 +164,10 @@
/**
* @param string $xmlData
*/
- private function parse($xmlData, &$repository)
+ private function parse($xmlData, LoggerHierarchy $repository)
{
// LoggerManager::resetConfiguration();
- $this->repository =& $repository;
+ $this->repository = $repository;
$parser = xml_parser_create_ns();
Modified:
incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
---
incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php
(original)
+++
incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php
Mon Jul 20 10:01:41 2009
@@ -38,10 +38,10 @@
}
/**
- * @param string &$sbuf
+ * @param string $sbuf
* @param LoggerLoggingEvent $event
*/
- public function format(&$sbuf, $event) {
+ public function format($sbuf, $event) {
$sbuf .= $this->literal;
}
Modified:
incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php
(original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php Mon
Jul 20 10:01:41 2009
@@ -82,10 +82,10 @@
/**
* A template method for formatting in a converter specific way.
*
- * @param string &$sbuf string buffer
+ * @param string $sbuf string buffer
* @param LoggerLoggingEvent $e
*/
- public function format(&$sbuf, $e) {
+ public function format($sbuf, $e) {
$s = $this->convert($e);
if($s == null or empty($s)) {
@@ -115,12 +115,12 @@
/**
* Fast space padding method.
*
- * @param string &$sbuf string buffer
+ * @param string $sbuf string buffer
* @param integer $length pad length
*
* @todo reimplement using PHP string functions
*/
- public function spacePad(&$sbuf, $length) {
+ public function spacePad($sbuf, $length) {
while($length >= 32) {
$sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][5];
$length -= 32;
Modified: incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php
(original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php Mon
Jul 20 10:01:41 2009
@@ -100,10 +100,10 @@
public function addToList($pc) {
if($this->head == null) {
$this->head = $pc;
- $this->tail =& $this->head;
+ $this->tail = $this->head;
} else {
$this->tail->next = $pc;
- $this->tail =& $this->tail->next;
+ $this->tail = $this->tail->next;
}
}
Modified: incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutPattern.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutPattern.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutPattern.php
(original)
+++ incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutPattern.php Mon
Jul 20 10:01:41 2009
@@ -39,7 +39,7 @@
*
* Then the statements
* <code>
- * $root =& LoggerManager::getRoot();
+ * $root = LoggerManager::getRoot();
* $root->debug("Message 1");
* $root->warn("Message 2");
* </code>
@@ -145,9 +145,6 @@
/** Default conversion TTCC Pattern */
const TTCC_CONVERSION_PATTERN = '%r [%t] %p %c %x - %m%n';
- /** @var string output buffer appended to when format() is invoked */
- private $sbuf;
-
/** @var string */
private $pattern;
@@ -187,13 +184,12 @@
* @return string
*/
public function format(LoggerLoggingEvent $event) {
- // Reset working stringbuffer
- $this->sbuf = '';
+ $sbuf = '';
$c = $this->head;
while ($c !== null) {
- $c->format($this->sbuf, $event);
+ $c->format(&$sbuf, $event);
$c = $c->next;
}
- return $this->sbuf;
+ return $sbuf;
}
}
\ No newline at end of file
Modified: incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutXml.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutXml.php?rev=795734&r1=795733&r2=795734&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutXml.php (original)
+++ incubator/log4php/trunk/src/main/php/layouts/LoggerLayoutXml.php Mon Jul 20
10:01:41 2009
@@ -177,7 +177,7 @@
* 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
+ * @param string str The String that is inserted into an existing
* CDATA Section within
buf.
* @static
*/