Example #1
0
 public function getExcludeClassesConfig()
 {
     $configValue = (string) Mage::getConfig()->getNode('default/aitsys_rewriter_exclude_classes');
     // before trying to unserialize we are replacing error_handler with another one to catch E_NOTICE run-time error
     Aitoc_Aitsys_Model_Exception::setErrorException();
     try {
         $configValue = unserialize($configValue);
     } catch (ErrorException $e) {
         //restore old data value
         $configValue = $tmpValue;
         unset($tmpValue);
     }
     Aitoc_Aitsys_Model_Exception::restoreErrorHandler();
     if (!$configValue) {
         $configValue = array();
     }
     return $configValue;
 }
Example #2
0
 public function getConfigValue($path, $defaultValue = null)
 {
     $conn = $this->_connection();
     $select = $conn->select()->from($this->_table('core_config_data'))->where('path = ?', $path)->where('scope = ?', 'default');
     $data = $conn->fetchRow($select);
     //$conn->closeConnection();
     if ($data === false || !isset($data['value']) || $data['value'] === '') {
         $data = $defaultValue;
     } else {
         $data = $data['value'];
     }
     // before trying to unserialize we are replacing error_handler with another one to catch E_NOTICE run-time error
     Aitoc_Aitsys_Model_Exception::setErrorException();
     $tmpData = $data;
     try {
         $data = unserialize($data);
     } catch (ErrorException $e) {
         //restore old data value
         $data = $tmpData;
         unset($tmpData);
     }
     Aitoc_Aitsys_Model_Exception::restoreErrorHandler();
     return $data;
 }