Author: grobmeier
Date: Fri Jul 3 11:20:22 2009
New Revision: 790863
URL: http://svn.apache.org/viewvc?rev=790863&view=rev
Log:
moved global vars to class members
Modified:
incubator/log4php/trunk/src/main/php/LoggerLocationInfo.php
Modified: incubator/log4php/trunk/src/main/php/LoggerLocationInfo.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerLocationInfo.php?rev=790863&r1=790862&r2=790863&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerLocationInfo.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerLocationInfo.php Fri Jul 3
11:20:22 2009
@@ -21,13 +21,6 @@
*/
/**
- * When location information is not available the constant
- * <i>NA</i> is returned. Current value of this string
- * constant is <b>?</b>.
- */
-define('LOG4PHP_LOGGER_LOCATION_INFO_NA', 'NA');
-
-/**
* The internal representation of caller location information.
*
* @version $Revision$
@@ -36,7 +29,13 @@
* @since 0.3
*/
class LoggerLocationInfo {
-
+ /**
+ * When location information is not available the constant
+ * <i>NA</i> is returned. Current value of this string
+ * constant is <b>?</b>.
+ */
+ const LOCATION_INFO_NA = 'NA';
+
/**
* @var string Caller's line number.
*/
@@ -78,7 +77,7 @@
}
public function getClassName() {
- return ($this->className === null) ?
LOG4PHP_LOGGER_LOCATION_INFO_NA : $this->className;
+ return ($this->className === null) ? self::LOCATION_INFO_NA :
$this->className;
}
/**
@@ -86,7 +85,7 @@
* <p>This information is not always available.
*/
public function getFileName() {
- return ($this->fileName === null) ?
LOG4PHP_LOGGER_LOCATION_INFO_NA : $this->fileName;
+ return ($this->fileName === null) ? self::LOCATION_INFO_NA :
$this->fileName;
}
/**
@@ -94,21 +93,21 @@
* <p>This information is not always available.
*/
public function getLineNumber() {
- return ($this->lineNumber === null) ?
LOG4PHP_LOGGER_LOCATION_INFO_NA : $this->lineNumber;
+ return ($this->lineNumber === null) ? self::LOCATION_INFO_NA :
$this->lineNumber;
}
/**
* Returns the method name of the caller.
*/
public function getMethodName() {
- return ($this->methodName === null) ?
LOG4PHP_LOGGER_LOCATION_INFO_NA : $this->methodName;
+ return ($this->methodName === null) ? self::LOCATION_INFO_NA :
$this->methodName;
}
/**
* Returns the full information of the caller.
*/
public function getFullInfo() {
- return ($this->fullInfo === null) ?
LOG4PHP_LOGGER_LOCATION_INFO_NA : $this->fullInfo;
+ return ($this->fullInfo === null) ? self::LOCATION_INFO_NA :
$this->fullInfo;
}
}