setLayout($config); } if (isset($config['layoutFormatter'])) { $layoutFormatter = new $config['layoutFormatter']; $writer->setLayoutFormatter($layoutFormatter); } if (isset($config['subjectPrependText'])) { $writer->setSubjectPrependText($config['subjectPrependText']); } if (isset($config['useExtrasId'])) { $writer->_useExtrasId = (bool) $config['useExtrasId']; } if (isset($config['sendmailDistanceTime'])) { $writer->_sendmailDistanceTime = (int) $config['sendmailDistanceTime']; } return $writer; } /** * Places event line into array of lines to be used as message body. * * Handles the formatting of both plaintext entries, as well as those * rendered with Zend_Layout. * * @param array $event Event data * @return void */ protected function _write($event) { if ($this->_useExtrasId) { if (empty($event['info'])) { throw new Zeed_Exception('must defined $extras message for log when set mail use extras for id.'); } $id = __CLASS__.md5($event['info']); $cache = Zeed_Cache::instance(); if (($data = $cache->load($id)) && $data) { return; } $cache->save(time(), $id, array(), $this->_sendmailDistanceTime); } return parent::_write($event); } } // End ^ Native EOL ^ encoding