Author: grobmeier
Date: Sun Jul  5 18:29:17 2009
New Revision: 791297

URL: http://svn.apache.org/viewvc?rev=791297&view=rev
Log:
LOG4PHP-23: make use of access modifiers

Modified:
    incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php
    incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMailEvent.php
    incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderPDO.php
    incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php
    incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.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/LoggerBasicPatternConverter.php
    
incubator/log4php/trunk/src/main/php/helpers/LoggerCategoryPatternConverter.php
    
incubator/log4php/trunk/src/main/php/helpers/LoggerClassNamePatternConverter.php
    incubator/log4php/trunk/src/main/php/helpers/LoggerDatePatternConverter.php
    incubator/log4php/trunk/src/main/php/helpers/LoggerFormattingInfo.php
    
incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php
    
incubator/log4php/trunk/src/main/php/helpers/LoggerLocationPatternConverter.php
    incubator/log4php/trunk/src/main/php/helpers/LoggerMDCPatternConverter.php
    incubator/log4php/trunk/src/main/php/helpers/LoggerNamedPatternConverter.php
    incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php
    incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php

Modified: incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php 
(original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMail.php Sun 
Jul  5 18:29:17 2009
@@ -35,23 +35,23 @@
        /**
         * @var string 'from' field
         */
-       var $from = null;
+       private $from = null;
 
        /**
         * @var string 'subject' field
         */
-       var $subject = 'Log4php Report';
+       private $subject = 'Log4php Report';
        
        /**
         * @var string 'to' field
         */
-       var $to = null;
+       private $to = null;
 
        /**
         * @var string used to create mail body
         * @access private
         */
-       var $body = '';
+       private $body = '';
        
        /**
         * Constructor.
@@ -82,40 +82,19 @@
                $this->closed = true;
        }
        
-       /**
-        * @return string
-        */
-       function getFrom() {
-               return $this->from;
-       }
-       
-       /**
-        * @return string
-        */
-       function getSubject() {
-               return $this->subject;
-       }
-
-       /**
-        * @return string
-        */
-       function getTo() {
-               return $this->to;
-       }
-       
-       function setSubject($subject) {
+       public function setSubject($subject) {
                $this->subject = $subject;
        }
        
-       function setTo($to) {
+       public function setTo($to) {
                $this->to = $to;
        }
 
-       function setFrom($from) {
+       public function setFrom($from) {
                $this->from = $from;
        }  
 
-       function append($event) {
+       public function append($event) {
                if($this->layout !== null) {
                        $this->body .= $this->layout->format($event);
                }

Modified: 
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMailEvent.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMailEvent.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMailEvent.php 
(original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderMailEvent.php 
Sun Jul  5 18:29:17 2009
@@ -40,32 +40,32 @@
        /**
         * @var string 'from' field
         */
-       var $from = null;
+       private $from = null;
 
        /**
         * @var integer 'from' field
         */
-       var $port = 25;
+       private $port = 25;
 
        /**
         * @var string hostname. 
         */
-       var $smtpHost = null;
+       private $smtpHost = null;
 
        /**
         * @var string 'subject' field
         */
-       var $subject = '';
+       private $subject = '';
 
        /**
         * @var string 'to' field
         */
-       var $to = null;
+       private $to = null;
        
        /**
         * @access private
         */
-       var $requiresLayout = true;
+       private $requiresLayout = true;
 
        /**
         * Constructor.
@@ -76,70 +76,35 @@
                parent::__construct($name);
        }
 
-       function activateOptions() {
+       public function activateOptions() {
                $this->closed = false;
        }
        
-       function close() {
+       public function close() {
                $this->closed = true;
        }
 
-       /**
-        * @return string
-        */
-       function getFrom() {
-               return $this->from;
-       }
-       
-       /**
-        * @return integer
-        */
-       function getPort() {
-               return $this->port;
-       }
-       
-       /**
-        * @return string
-        */
-       function getSmtpHost() {
-               return $this->smtpHost;
-       }
-       
-       /**
-        * @return string
-        */
-       function getSubject() {
-               return $this->subject;
-       }
-
-       /**
-        * @return string
-        */
-       function getTo() {
-               return $this->to;
-       }
-
-       function setFrom($from) {
+       public function setFrom($from) {
                $this->from = $from;
        }
        
-       function setPort($port) {
+       public function setPort($port) {
                $this->port = (int)$port;
        }
        
-       function setSmtpHost($smtpHost) {
+       public function setSmtpHost($smtpHost) {
                $this->smtpHost = $smtpHost;
        }
        
-       function setSubject($subject) {
+       public function setSubject($subject) {
                $this->subject = $subject;
        }
        
-       function setTo($to) {
+       public function setTo($to) {
                $this->to = $to;
        }
 
-       function append($event) {
+       public function append($event) {
                $from = $this->getFrom();
                $to = $this->getTo();
                if(empty($from) or empty($to)) {

Modified: incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderPDO.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderPDO.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderPDO.php 
(original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderPDO.php Sun 
Jul  5 18:29:17 2009
@@ -57,7 +57,7 @@
      * This apender doesn't require a layout.
      * @param string $name appender name
      */
-    function __construct($name) {
+    public function __construct($name) {
         parent::__construct($name);
         $this->requiresLayout = false;
     }
@@ -148,7 +148,7 @@
      * Sets the username for this connection. 
      * Defaults to ''
      */
-    function setUser($user) {
+    public function setUser($user) {
         $this->user = $user;
     }
     

Modified: 
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php 
Sun Jul  5 18:29:17 2009
@@ -50,7 +50,7 @@
         *
         * @var integer
         */
-       var $maxFileSize = 10485760;
+       private $maxFileSize = 10485760;
        
        /**
         * Set the maximum number of backup files to keep around.
@@ -64,13 +64,13 @@
         *
         * @var integer 
         */
-       var $maxBackupIndex      = 1;
+       private $maxBackupIndex  = 1;
        
        /**
         * @var string the filename expanded
         * @access private
         */
-       var $expandedFileName = null;
+       private $expandedFileName = null;
 
        /**
         * Constructor.
@@ -85,7 +85,7 @@
         * Returns the value of the MaxBackupIndex option.
         * @return integer 
         */
-       function getExpandedFileName() {
+       private function getExpandedFileName() {
                return $this->expandedFileName;
        }
 
@@ -93,7 +93,7 @@
         * Returns the value of the MaxBackupIndex option.
         * @return integer 
         */
-       function getMaxBackupIndex() {
+       private function getMaxBackupIndex() {
                return $this->maxBackupIndex;
        }
 
@@ -102,7 +102,7 @@
         * before being rolled over to backup files.
         * @return integer
         */
-       function getMaximumFileSize() {
+       private function getMaximumFileSize() {
                return $this->maxFileSize;
        }
 
@@ -114,7 +114,7 @@
         * 
         * <p>If MaxBackupIndex is equal to zero, then the File is truncated 
with no backup files created.
         */
-       function rollOver() {
+       private function rollOver() {
                // If maxBackups <= 0, then there is no file renaming to be 
done.
                if($this->maxBackupIndex > 0) {
                        $fileName = $this->getExpandedFileName();
@@ -145,7 +145,7 @@
                $this->setFile($fileName, false);
        }
        
-       function setFileName($fileName) {
+       public function setFileName($fileName) {
                $this->fileName = $fileName;
                $this->expandedFileName = realpath($fileName);
        }
@@ -162,7 +162,7 @@
         *
         * @param mixed $maxBackups
         */
-       function setMaxBackupIndex($maxBackups) {
+       public function setMaxBackupIndex($maxBackups) {
                if(is_numeric($maxBackups)) {
                        $this->maxBackupIndex = abs((int)$maxBackups);
                }
@@ -175,7 +175,7 @@
         * @param mixed $maxFileSize
         * @see setMaxFileSize()
         */
-       function setMaximumFileSize($maxFileSize) {
+       public function setMaximumFileSize($maxFileSize) {
                $this->setMaxFileSize($maxFileSize);
        }
 
@@ -191,7 +191,7 @@
         *
         * @param mixed $value
         */
-       function setMaxFileSize($value) {
+       public function setMaxFileSize($value) {
                $maxFileSize = null;
                $numpart = substr($value,0, strlen($value) -2);
                $suffix = strtoupper(substr($value, -2));
@@ -215,7 +215,7 @@
        /**
         * @param LoggerLoggingEvent $event
         */
-       function append($event) {
+       public function append($event) {
                if($this->fp) {
                        parent::append($event);
                        if(ftell($this->fp) > $this->getMaximumFileSize()) {

Modified: 
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php 
(original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php Sun 
Jul  5 18:29:17 2009
@@ -36,46 +36,46 @@
         * @var mixed socket connection resource
         * @access private
         */
-       var $sp = false;
+       private $sp = false;
        
        /**
         * Target host. On how to define remote hostaname see 
         * {...@link PHP_MANUAL#fsockopen}
         * @var string 
         */
-       var $remoteHost = '';
+       private $remoteHost = '';
        
        /**
         * @var integer the network port.
         */
-       var $port = 4446;
+       private $port = 4446;
        
        /**
         * @var boolean get event's location info.
         */
-       var $locationInfo = false;
+       private $locationInfo = false;
        
        /**
         * @var integer connection timeout
         */
-       var $timeout = 30;
+       private $timeout = 30;
        
        /**
         * @var boolean output events via {...@link LoggerXmlLayout}
         */
-       var $useXml = false;
+       private $useXml = false;
        
        /**
         * @var boolean forward this option to {...@link LoggerXmlLayout}. 
         *                              Ignored if {...@link $useXml} is 
<i>false</i>.
         */
-       var $log4jNamespace = false;
+       private $log4jNamespace = false;
 
        /**
         * @var LoggerXmlLayout
         * @access private
         */
-       var $xmlLayout = null;
+       private $xmlLayout = null;
        
        /**
         * Create a socket connection using defined parameters

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=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php 
Sun Jul  5 18:29:17 2009
@@ -308,7 +308,7 @@
         *                                        configuration information is 
stored.
         * @param LoggerHierarchy &$repository the repository to apply the 
configuration
         */
-       function doConfigure($url, &$repository) {
+       private function doConfigure($url, &$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
@@ -325,7 +325,7 @@
         * @param array $properties
         * @param LoggerHierarchy &$hierarchy
         */
-       function doConfigureProperties($properties, &$hierarchy) {
+       private function doConfigureProperties($properties, &$hierarchy) {
                /*
                $value = @$properties[LOGGER_DEBUG_KEY];
                
@@ -362,7 +362,7 @@
         * @see parseCatsAndRenderers()
         * @param array $props array of properties
         */
-       function configureLoggerFactory($props) {
+       private function configureLoggerFactory($props) {
                $factoryFqcn = @$props[self::LOGGER_FACTORY_KEY];
                if(!empty($factoryFqcn)) {
                        $factoryClassName = basename($factoryFqcn);
@@ -382,7 +382,7 @@
         * @param array $props array of properties
         * @param LoggerHierarchy &$hierarchy
         */
-       function configureRootCategory($props, &$hierarchy) {
+       private function configureRootCategory($props, &$hierarchy) {
                $effectivePrefix = self::ROOT_LOGGER_PREFIX;
                $value = @$props[self::ROOT_LOGGER_PREFIX];
 
@@ -416,7 +416,7 @@
         * @param array $props array of properties
         * @param LoggerHierarchy &$hierarchy
         */
-       function parseCatsAndRenderers($props, &$hierarchy) {
+       private function parseCatsAndRenderers($props, &$hierarchy) {
                while(list($key,$value) = each($props)) {
                        if(strpos($key, self::CATEGORY_PREFIX) === 0 or 
                                strpos($key, self::LOGGER_PREFIX) === 0) {
@@ -448,7 +448,7 @@
         * @param Logger &$cat
         * @param string $loggerName
         */
-       function parseAdditivityForLogger($props, &$cat, $loggerName) {
+       private function parseAdditivityForLogger($props, &$cat, $loggerName) {
                $value = LoggerOptionConverter::findAndSubst(
                                        self::ADDITIVITY_PREFIX . $loggerName,
                                                                                
$props
@@ -471,7 +471,7 @@
         * @param string $value
         * @return Logger
         */
-       public function parseCategory($props, &$logger, $optionKey, 
$loggerName, $value) {
+       private function parseCategory($props, &$logger, $optionKey, 
$loggerName, $value) {
                
                // We must skip over ',' but not white space
                $st = explode(',', $value);
@@ -524,7 +524,7 @@
         * @param string $appenderName
         * @return LoggerAppender
         */
-       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=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorPhp.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorPhp.php 
Sun Jul  5 18:29:17 2009
@@ -65,7 +65,7 @@
                return $configurator->doConfigure($url, $hierarchy);
        }
        
-       public function doConfigure($url, &$hierarchy) {
+       private function doConfigure($url, &$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=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorXml.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/configurators/LoggerConfiguratorXml.php 
Sun Jul  5 18:29:17 2009
@@ -75,32 +75,32 @@
     /**
      * @var LoggerHierarchy
      */
-    var $repository;
+    private $repository;
     
     /**
      * @var array state stack 
      */
-    var $state;
+    private $state;
 
     /**
      * @var Logger parsed Logger  
      */
-    var $logger;
+    private $logger;
     
     /**
      * @var LoggerAppender parsed LoggerAppender 
      */
-    var $appender;
+    private $appender;
     
     /**
      * @var LoggerFilter parsed LoggerFilter 
      */
-    var $filter;
+    private $filter;
     
     /**
      * @var LoggerLayout parsed LoggerLayout 
      */
-    var $layout;
+    private $layout;
     
     /**
      * Constructor
@@ -137,7 +137,7 @@
      * @param string $url
      * @param LoggerHierarchy &$repository
      */
-    function doConfigure($url = '', &$repository)
+    private function doConfigure($url = '', &$repository)
     {
         $xmlData = '';
         if (!empty($url))
@@ -151,7 +151,7 @@
      * @param string $xmlData
      * @param LoggerHierarchy &$repository
      */
-    function doConfigureByString($xmlData, &$repository)
+    private function doConfigureByString($xmlData, &$repository)
     {
         return $this->parse($xmlData, $repository);
     }
@@ -159,7 +159,7 @@
     /**
      * @param LoggerHierarchy &$repository
      */
-    function doConfigureDefault(&$repository)
+    private function doConfigureDefault(&$repository)
     {
         return $this->doConfigureByString(self::DEFAULT_CONFIGURATION, 
$repository);
     }
@@ -167,7 +167,7 @@
     /**
      * @param string $xmlData
      */
-    function parse($xmlData, &$repository)
+    private function parse($xmlData, &$repository)
     {
         // LoggerManager::resetConfiguration();
         $this->repository =& $repository;
@@ -196,7 +196,7 @@
      *
      * @todo In 'LOGGER' case find a better way to detect 'getLogger()' method
      */
-    function tagOpen($parser, $tag, $attribs)
+    private function tagOpen($parser, $tag, $attribs)
     {
         switch ($tag) {
         
@@ -406,7 +406,7 @@
      * @param mixed $parser
      * @param string $tag
      */
-    function tagClose($parser, $tag)
+    private function tagClose($parser, $tag)
     {
         switch ($tag) {
         
@@ -458,7 +458,7 @@
         }
     }
     
-    function subst($value)
+    private function subst($value)
     {
         return LoggerOptionConverter::substVars($value);
     }

Modified: 
incubator/log4php/trunk/src/main/php/helpers/LoggerBasicPatternConverter.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerBasicPatternConverter.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/helpers/LoggerBasicPatternConverter.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/helpers/LoggerBasicPatternConverter.php 
Sun Jul  5 18:29:17 2009
@@ -29,7 +29,7 @@
        /**
         * @var integer
         */
-       var $type;
+       private $type;
 
        /**
         * Constructor
@@ -37,8 +37,8 @@
         * @param string $formattingInfo
         * @param integer $type
         */
-       function LoggerBasicPatternConverter($formattingInfo, $type) {
-         $this->LoggerPatternConverter($formattingInfo);
+       public function __construct($formattingInfo, $type) {
+         parent::__construct($formattingInfo);
          $this->type = $type;
        }
 
@@ -46,7 +46,7 @@
         * @param LoggerLoggingEvent $event
         * @return string
         */
-       function convert($event) {
+       public function convert($event) {
                switch($this->type) {
                        case 
LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_RELATIVE_TIME_CONVERTER:
                                $timeStamp = $event->getTimeStamp();
@@ -69,6 +69,5 @@
                        default: 
                                return '';
                }
-               echo "OK";
        }
 }

Modified: 
incubator/log4php/trunk/src/main/php/helpers/LoggerCategoryPatternConverter.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerCategoryPatternConverter.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/helpers/LoggerCategoryPatternConverter.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/helpers/LoggerCategoryPatternConverter.php 
Sun Jul  5 18:29:17 2009
@@ -32,15 +32,15 @@
         * @param string $formattingInfo
         * @param integer $precision
         */
-       function LoggerCategoryPatternConverter($formattingInfo, $precision) {
-               $this->LoggerNamedPatternConverter($formattingInfo, $precision);
+       public function __construct($formattingInfo, $precision) {
+               parent::__construct($formattingInfo, $precision);
        }
 
        /**
         * @param LoggerLoggingEvent $event
         * @return string
         */
-       function getFullyQualifiedName($event) {
+       public function getFullyQualifiedName($event) {
                return $event->getLoggerName();
        }
 }

Modified: 
incubator/log4php/trunk/src/main/php/helpers/LoggerClassNamePatternConverter.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerClassNamePatternConverter.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/helpers/LoggerClassNamePatternConverter.php
 (original)
+++ 
incubator/log4php/trunk/src/main/php/helpers/LoggerClassNamePatternConverter.php
 Sun Jul  5 18:29:17 2009
@@ -32,15 +32,15 @@
         * @param string $formattingInfo
         * @param integer $precision
         */
-       function LoggerClassNamePatternConverter($formattingInfo, $precision) {
-               $this->LoggerNamedPatternConverter($formattingInfo, $precision);
+       public function __construct($formattingInfo, $precision) {
+               parent::__construct($formattingInfo, $precision);
        }
 
        /**
         * @param LoggerLoggingEvent $event
         * @return string
         */
-       function getFullyQualifiedName($event) {
+       public function getFullyQualifiedName($event) {
                return $event->fqcn;
        }
 }

Modified: 
incubator/log4php/trunk/src/main/php/helpers/LoggerDatePatternConverter.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerDatePatternConverter.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerDatePatternConverter.php 
(original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerDatePatternConverter.php 
Sun Jul  5 18:29:17 2009
@@ -29,7 +29,7 @@
        /**
         * @var string
         */
-       var $df;
+       private $df;
        
        /**
         * Constructor
@@ -37,8 +37,8 @@
         * @param string $formattingInfo
         * @param string $df
         */
-       function LoggerDatePatternConverter($formattingInfo, $df) {
-               $this->LoggerPatternConverter($formattingInfo);
+       public function __construct($formattingInfo, $df) {
+               parent::__construct($formattingInfo);
                $this->df = $df;
        }
 
@@ -46,7 +46,7 @@
         * @param LoggerLoggingEvent $event
         * @return string
         */
-       function convert($event) {
+       public function convert($event) {
                $timeStamp = $event->getTimeStamp();
                $usecs = round(($timeStamp - (int)$timeStamp) * 1000);
                $this->df = preg_replace('/((?<!\\\\)(?:\\\\{2})*)u/', '${1}' . 
sprintf('%03d', $usecs), $this->df);

Modified: incubator/log4php/trunk/src/main/php/helpers/LoggerFormattingInfo.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerFormattingInfo.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerFormattingInfo.php 
(original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerFormattingInfo.php Sun 
Jul  5 18:29:17 2009
@@ -30,22 +30,22 @@
  */
 class LoggerFormattingInfo {
 
-       var $min = -1;
-       var $max = 0x7FFFFFFF;
-       var $leftAlign = false;
+       public $min = -1;
+       public $max = 0x7FFFFFFF;
+       public $leftAlign = false;
 
        /**
         * Constructor
         */
-       function LoggerFormattingInfo() {}
+       public function __construct() {}
        
-       function reset() {
+       public function reset() {
                $this->min = -1;
                $this->max = 0x7FFFFFFF;
                $this->leftAlign = false;         
        }
 
-       function dump() {
+       public function dump() {
                // TODO: other option to dump?
                // LoggerLog::debug("LoggerFormattingInfo::dump() 
min={$this->min}, max={$this->max}, leftAlign={$this->leftAlign}");
        }

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=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/helpers/LoggerLiteralPatternConverter.php 
Sun Jul  5 18:29:17 2009
@@ -29,14 +29,14 @@
        /**
         * @var string
         */
-       var $literal;
+       private $literal;
 
        /**
         * Constructor
         *
         * @param string $value
         */
-       function LoggerLiteralPatternConverter($value) {
+       public function __construct($value) {
                $this->literal = $value;
        }
 
@@ -44,7 +44,7 @@
         * @param string &$sbuf
         * @param LoggerLoggingEvent $event
         */
-       function format(&$sbuf, $event) {
+       public function format(&$sbuf, $event) {
                $sbuf .= $this->literal;
        }
 
@@ -52,7 +52,7 @@
         * @param LoggerLoggingEvent $event
         * @return string
         */
-       function convert($event) {
+       public function convert($event) {
                return $this->literal;
        }
 }

Modified: 
incubator/log4php/trunk/src/main/php/helpers/LoggerLocationPatternConverter.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerLocationPatternConverter.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/helpers/LoggerLocationPatternConverter.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/helpers/LoggerLocationPatternConverter.php 
Sun Jul  5 18:29:17 2009
@@ -29,7 +29,7 @@
        /**
         * @var integer
         */
-       var $type;
+       private $type;
 
        /**
         * Constructor
@@ -37,8 +37,8 @@
         * @param string $formattingInfo
         * @param integer $type
         */
-       function LoggerLocationPatternConverter($formattingInfo, $type) {
-         $this->LoggerPatternConverter($formattingInfo);
+       public function __construct($formattingInfo, $type) {
+         parent::__construct($formattingInfo);
          $this->type = $type;
        }
 
@@ -46,7 +46,7 @@
         * @param LoggerLoggingEvent $event
         * @return string
         */
-       function convert($event) {
+       public function convert($event) {
                $locationInfo = $event->getLocationInformation();
                switch($this->type) {
                        case 
LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_FULL_LOCATION_CONVERTER:

Modified: 
incubator/log4php/trunk/src/main/php/helpers/LoggerMDCPatternConverter.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerMDCPatternConverter.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerMDCPatternConverter.php 
(original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerMDCPatternConverter.php 
Sun Jul  5 18:29:17 2009
@@ -29,7 +29,7 @@
        /**
         * @var string
         */
-       var $key;
+       private $key;
 
        /**
         * Constructor
@@ -37,8 +37,8 @@
         * @param string $formattingInfo
         * @param string $key
         */
-       function LoggerMDCPatternConverter($formattingInfo, $key) {
-               $this->LoggerPatternConverter($formattingInfo);
+       public function __construct($formattingInfo, $key) {
+               parent::__construct($formattingInfo);
                $this->key = $key;
        }
 
@@ -46,7 +46,7 @@
         * @param LoggerLoggingEvent $event
         * @return string
         */
-       function convert($event) {
+       public function convert($event) {
                return $event->getMDC($this->key);
        }
 }

Modified: 
incubator/log4php/trunk/src/main/php/helpers/LoggerNamedPatternConverter.php
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/helpers/LoggerNamedPatternConverter.php?rev=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/main/php/helpers/LoggerNamedPatternConverter.php 
(original)
+++ 
incubator/log4php/trunk/src/main/php/helpers/LoggerNamedPatternConverter.php 
Sun Jul  5 18:29:17 2009
@@ -30,7 +30,7 @@
        /**
         * @var integer
         */
-       var $precision;
+       private $precision;
 
        /**
         * Constructor
@@ -38,8 +38,8 @@
         * @param string $formattingInfo
         * @param integer $precision
         */
-       function LoggerNamedPatternConverter($formattingInfo, $precision) {
-         $this->LoggerPatternConverter($formattingInfo);
+       public function __construct($formattingInfo, $precision) {
+         parent::__construct($formattingInfo);
          $this->precision =  $precision;
        }
 
@@ -48,7 +48,7 @@
         * @return string
         * @abstract
         */
-       function getFullyQualifiedName($event) {
+       public function getFullyQualifiedName($event) {
                // abstract
                return;
        }

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=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php 
(original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerPatternConverter.php Sun 
Jul  5 18:29:17 2009
@@ -52,18 +52,18 @@
        /**
         * @var LoggerPatternConverter next converter in converter chain
         */
-       var $next = null;
+       public $next = null;
        
-       var $min = -1;
-       var $max = 0x7FFFFFFF;
-       var $leftAlign = false;
+       public $min = -1;
+       public $max = 0x7FFFFFFF;
+       public $leftAlign = false;
 
        /**
         * Constructor 
         *
         * @param LoggerFormattingInfo $fi
         */
-       function LoggerPatternConverter($fi = null) {  
+       public function __construct($fi = null) {  
                if($fi !== null) {
                        $this->min = $fi->min;
                        $this->max = $fi->max;
@@ -77,7 +77,7 @@
         *
         * @param LoggerLoggingEvent $event
         */
-       function convert($event) {}
+       public function convert($event) {}
 
        /**
         * A template method for formatting in a converter specific way.
@@ -85,7 +85,7 @@
         * @param string &$sbuf string buffer
         * @param LoggerLoggingEvent $e
         */
-       function format(&$sbuf, $e) {
+       public function format(&$sbuf, $e) {
                $s = $this->convert($e);
                
                if($s == null or empty($s)) {
@@ -120,7 +120,7 @@
         *
         * @todo reimplement using PHP string functions
         */
-       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=791297&r1=791296&r2=791297&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php 
(original)
+++ incubator/log4php/trunk/src/main/php/helpers/LoggerPatternParser.php Sun 
Jul  5 18:29:17 2009
@@ -60,37 +60,37 @@
        const LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_ABSOLUTE = 'H:i:s';
        const LOG4PHP_LOGGER_PATTERN_PARSER_DATE_FORMAT_DATE = 'd M Y H:i:s,u';
 
-       var $state;
-       var $currentLiteral;
-       var $patternLength;
-       var $i;
+       private $state;
+       private $currentLiteral;
+       private $patternLength;
+       private $i;
        
        /**
         * @var LoggerPatternConverter
         */
-       var $head = null;
+       private $head = null;
         
        /**
         * @var LoggerPatternConverter
         */
-       var $tail = null;
+       private $tail = null;
        
        /**
         * @var LoggerFormattingInfo
         */
-       var $formattingInfo;
+       private $formattingInfo;
        
        /**
         * @var string pattern to parse
         */
-       var $pattern;
+       private $pattern;
 
        /**
         * Constructor 
         *
         * @param string $pattern
         */
-       function LoggerPatternParser($pattern) {
+       public function __construct($pattern) {
                $this->pattern = $pattern;
                $this->patternLength =  strlen($pattern);
                $this->formattingInfo = new LoggerFormattingInfo();
@@ -100,7 +100,7 @@
        /**
         * @param LoggerPatternConverter $pc
         */
-       function addToList($pc) {
+       public function addToList($pc) {
                if($this->head == null) {
                        $this->head = $pc;
                        $this->tail =& $this->head;
@@ -113,7 +113,7 @@
        /**
         * @return string
         */
-       function extractOption() {
+       public function extractOption() {
                if(($this->i < $this->patternLength) and 
($this->pattern{$this->i} == '{')) {
                        $end = strpos($this->pattern, '}' , $this->i);
                        if($end !== false) {
@@ -129,7 +129,7 @@
         * The option is expected to be in decimal and positive. In case of
         * error, zero is returned.      
         */
-       function extractPrecisionOption() {
+       public function extractPrecisionOption() {
                $opt = $this->extractOption();
                $r = 0;
                if($opt !== null) {
@@ -143,7 +143,7 @@
                return $r;
        }
 
-       function parse() {
+       public function parse() {
                $c = '';
                $this->i = 0;
                $this->currentLiteral = '';
@@ -243,7 +243,7 @@
                return $this->head;
        }
 
-       function finalizeConverter($c) {
+       public function finalizeConverter($c) {
                $pc = null;
                switch($c) {
                        case 'c':
@@ -334,7 +334,7 @@
                $this->addConverter($pc);
        }
 
-       function addConverter($pc) {
+       public function addConverter($pc) {
                $this->currentLiteral = '';
                // Add the pattern converter to the list.
                $this->addToList($pc);


Reply via email to