/**
  * Short description of method init
  *
  * @access public
  * @author Sam
  * @param  array configuration
  * @return boolean
  */
 public function init($configuration)
 {
     parent::init($configuration);
     $this->data = array();
     $this->archivers = array();
     if (isset($configuration['local_server_comment'])) {
         $this->comment = strval($configuration['local_server_comment']);
     }
     foreach ($configuration['archivers'] as $archiverConfig) {
         if (isset($archiverConfig['class'])) {
             $classname = $archiverConfig['class'];
             if (!class_exists($classname)) {
                 $classname = 'common_profiler_archiver_' . $classname;
             }
             if (class_exists($classname)) {
                 $archiver = new $classname();
                 try {
                     if ($archiver instanceof common_profiler_archiver_Archiver && !is_null($archiver) && $archiver->init($archiverConfig)) {
                         $this->archivers[] = $archiver;
                     }
                 } catch (InvalidArgumentException $e) {
                     common_Logger::w('archiver configuration issue: ' . $e->getMessage());
                 }
             }
         }
     }
     return true;
 }
예제 #2
0
 /**
  * Short description of method init
  *
  * @access public
  * @author Sam
  * @param  array configuration
  * @return boolean
  */
 public function init($configuration)
 {
     $returnValue = (bool) false;
     parent::init($configuration);
     $this->tag = isset($configuration['tag']) && !empty($configuration['tag']) ? strval($configuration['tag']) : 'PROFILER';
     $returnValue = true;
     return (bool) $returnValue;
 }