[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 /*+*********************************************************************************** 3 * The contents of this file are subject to the vtiger CRM Public License Version 1.0 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 *************************************************************************************/ 10 11 /** Classes to avoid logging */ 12 class LoggerPropertyConfigurator { 13 14 static $singleton = false; 15 16 function __construct() { 17 LoggerPropertyConfigurator::$singleton = $this; 18 } 19 20 function configure($configfile) { 21 $configinfo = parse_ini_file($configfile); 22 23 $types = array(); 24 $appenders = array(); 25 26 foreach($configinfo as $k=>$v) { 27 if(preg_match("/log4php.rootLogger/i", $k, $m)) { 28 $name = 'ROOT'; 29 list($level, $appender) = explode(',', $v); 30 $types[$name]['level'] = $level; 31 $types[$name]['appender'] = $appender; 32 } 33 if(preg_match("/log4php.logger.(.*)/i", $k, $m)) { 34 $name = $m[1]; 35 list($level, $appender) = explode(',', $v); 36 $types[$name]['level'] = $level; 37 $types[$name]['appender'] = $appender; 38 } 39 if(preg_match("/log4php.appender.([^.]+).?(.*)/i", $k, $m)) { 40 $appenders[$m[1]][$m[2]] = $v; 41 } 42 43 } 44 45 $this->types = $types; 46 $this->appenders = $appenders; 47 } 48 49 function getConfigInfo($type) { 50 if(isset($this->types[$type])) { 51 $typeinfo = $this->types[$type]; 52 return array ( 53 'level' => $typeinfo['level'], 54 'appender'=> $this->appenders[$typeinfo['appender']] 55 56 ); 57 } 58 return false; 59 } 60 61 static function getInstance() { 62 return self::$singleton; 63 } 64 } 65 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |