Пример #1
0
 public function __construct(Search_Index_Interface $searchIndex, $logWriter = null)
 {
     if (!$logWriter instanceof Zend_Log_Writer_Abstract) {
         $logWriter = new Zend_Log_Writer_Null();
     }
     $logWriter->setFormatter(new Zend_Log_Formatter_Simple(Zend_Log_Formatter_Simple::DEFAULT_FORMAT . ' [%memoryUsage% bytes]' . PHP_EOL));
     $this->log = new Zend_Log($logWriter);
     $this->searchIndex = $searchIndex;
 }
Пример #2
0
 public function __construct(Search_Index_Interface $searchIndex, $loggit = false)
 {
     if ($loggit) {
         // unused externally, set this to true here to enable logging
         global $prefs;
         $writer = new Zend_Log_Writer_Stream($prefs['tmpDir'] . '/Search_Indexer.log', 'w');
     } else {
         $writer = new Zend_Log_Writer_Null();
     }
     $writer->setFormatter(new Zend_Log_Formatter_Simple(Zend_Log_Formatter_Simple::DEFAULT_FORMAT . ' [%memoryUsage% bytes]' . PHP_EOL));
     $this->log = new Zend_Log($writer);
     $this->searchIndex = $searchIndex;
 }