Advertisement
turist_ua

Untitled

May 14th, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. class Application_Model_DbTable_Base extends Zend_Db_Table_Abstract {
  2.  
  3.     public function __construct($config = array())
  4.     {
  5.         parent::__construct($config);
  6.  
  7.         if (Zend_Db_Table_Abstract::getDefaultMetadataCache() === null)
  8.         {
  9.             $frontendOptions = array('automatic_serialization' => true);
  10.  
  11.             $zendCacheDir = PUBLIC_PATH.'/cache/'; // directory for caching
  12.  
  13.             if (!file_exists($zendCacheDir))
  14.             {
  15.                 mkdir($zendCacheDir, 0777);
  16.             }
  17.  
  18.             $backendOptions  = array('cache_dir' => $zendCacheDir);
  19.  
  20.             $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
  21.             //$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
  22.             Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement