Public Member Functions | |
logClean () | |
Public Attributes | |
const | XML_PATH_EMAIL_LOG_CLEAN_TEMPLATE = 'system/log/error_email_template' |
const | XML_PATH_EMAIL_LOG_CLEAN_IDENTITY = 'system/log/error_email_identity' |
const | XML_PATH_EMAIL_LOG_CLEAN_RECIPIENT = 'system/log/error_email' |
Protected Member Functions | |
_sendLogCleanEmail () | |
Protected Attributes | |
$_errors = array() |
Definition at line 35 of file Cron.php.
_sendLogCleanEmail | ( | ) | [protected] |
Send Log Clean Warnings
Definition at line 53 of file Cron.php.
00054 { 00055 if (!$this->_errors) { 00056 return $this; 00057 } 00058 if (!Mage::getStoreConfig(self::XML_PATH_EMAIL_LOG_CLEAN_RECIPIENT)) { 00059 return $this; 00060 } 00061 00062 $translate = Mage::getSingleton('core/translate'); 00063 /* @var $translate Mage_Core_Model_Translate */ 00064 $translate->setTranslateInline(false); 00065 00066 $emailTemplate = Mage::getModel('core/email_template'); 00067 /* @var $emailTemplate Mage_Core_Model_Email_Template */ 00068 $emailTemplate->setDesignConfig(array('area' => 'backend')) 00069 ->sendTransactional( 00070 Mage::getStoreConfig(self::XML_PATH_EMAIL_LOG_CLEAN_TEMPLATE), 00071 Mage::getStoreConfig(self::XML_PATH_EMAIL_LOG_CLEAN_IDENTITY), 00072 Mage::getStoreConfig(self::XML_PATH_EMAIL_LOG_CLEAN_RECIPIENT), 00073 null, 00074 array('warnings' => join("\n", $this->_errors)) 00075 ); 00076 00077 $translate->setTranslateInline(true); 00078 00079 return $this; 00080 }
logClean | ( | ) |
Clean logs
Definition at line 87 of file Cron.php.
00088 { 00089 $this->_errors = array(); 00090 00091 try { 00092 Mage::getModel('log/log')->clean(); 00093 } 00094 catch (Exception $e) { 00095 $this->_errors[] = $e->getMessage(); 00096 $this->_errors[] = $e->getTrace(); 00097 } 00098 00099 $this->_sendLogCleanEmail(); 00100 00101 return $this; 00102 }
const XML_PATH_EMAIL_LOG_CLEAN_IDENTITY = 'system/log/error_email_identity' |
const XML_PATH_EMAIL_LOG_CLEAN_RECIPIENT = 'system/log/error_email' |
const XML_PATH_EMAIL_LOG_CLEAN_TEMPLATE = 'system/log/error_email_template' |