Mage_Log_Model_Cron Class Reference

Inheritance diagram for Mage_Log_Model_Cron:

Mage_Core_Model_Abstract Varien_Object

List of all members.

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()


Detailed Description

Definition at line 35 of file Cron.php.


Member Function Documentation

_sendLogCleanEmail (  )  [protected]

Send Log Clean Warnings

Returns:
Mage_Log_Model_Cron

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

Returns:
Mage_Log_Model_Cron

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     }


Member Data Documentation

$_errors = array() [protected]

Definition at line 46 of file Cron.php.

const XML_PATH_EMAIL_LOG_CLEAN_IDENTITY = 'system/log/error_email_identity'

Definition at line 38 of file Cron.php.

const XML_PATH_EMAIL_LOG_CLEAN_RECIPIENT = 'system/log/error_email'

Definition at line 39 of file Cron.php.

const XML_PATH_EMAIL_LOG_CLEAN_TEMPLATE = 'system/log/error_email_template'

Definition at line 37 of file Cron.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:28 2009 for Magento by  doxygen 1.5.8