Author: grobmeier Date: Sat May 23 13:30:21 2009 New Revision: 777917 URL: http://svn.apache.org/viewvc?rev=777917&view=rev Log: put constructor to public - no need for forcing singleton atm
Modified: incubator/log4php/trunk/src/main/php/LoggerHierarchy.php Modified: incubator/log4php/trunk/src/main/php/LoggerHierarchy.php URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerHierarchy.php?rev=777917&r1=777916&r2=777917&view=diff ============================================================================== --- incubator/log4php/trunk/src/main/php/LoggerHierarchy.php (original) +++ incubator/log4php/trunk/src/main/php/LoggerHierarchy.php Sat May 23 13:30:21 2009 @@ -83,7 +83,7 @@ * Create a new logger hierarchy. * @param object $root the root logger */ - protected function __construct(LoggerRoot $root) { + public function __construct(LoggerRoot $root) { $this->root = $root; $this->root->setHierarchy($this); $this->setThreshold(LoggerLevel::getLevelAll()); @@ -152,11 +152,16 @@ $this->ht[$name]->setHierarchy($this); $nodes = explode('.', $name); $firstNode = array_shift($nodes); + + // if name is not a first node but another first node is their if($firstNode != $name and isset($this->ht[$firstNode])) { $this->ht[$name]->setParent($this->ht[$firstNode]); } else { + // if there is no father, set root logger as father $this->ht[$name]->setParent($this->root); } + + // if there are more nodes than one if(count($nodes) > 0) { // find parent node foreach($nodes as $node) {