示例#1
0
 public function removeAction()
 {
     $model = Axis_Core_Model_Cache::getCache();
     if ($this->_hasParam('data')) {
         $tags = Zend_Json::decode($this->_getParam('data'));
         $success = $model->clean('matchingAnyTag', $tags);
     } else {
         $success = $model->clean();
     }
     if (!$success) {
         return $this->_helper->json->sendFailure();
     }
     Axis::message()->addSuccess(Axis::translate('admin')->__('Cache was cleared successfully'));
     return $this->_helper->json->sendSuccess();
 }
示例#2
0
 public function up()
 {
     $installer = Axis::single('install/installer');
     $installer->run("\n\n        ALTER TABLE `{$installer->getTable('account_customer')}`\n            ADD COLUMN `locale` CHAR(5) NOT NULL DEFAULT 'en_US' AFTER `group_id`;\n\n        ");
     Axis_Core_Model_Cache::getCache()->clean();
 }
示例#3
0
 public function upgradeAction()
 {
     $model = Axis::model('core/module');
     if (!$this->_hasParam('code')) {
         foreach ($model->fetchAll() as $module) {
             $module->upgradeAll();
         }
     } else {
         $module = $model->getByCode($this->_getParam('code'));
         $module->upgradeAll();
     }
     Axis_Core_Model_Cache::getCache()->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('modules', 'config'));
     return $this->_helper->json->sendSuccess();
 }
示例#4
0
 public function up()
 {
     $installer = $this->getInstaller();
     $installer->run("\n\n        ALTER TABLE `{$installer->getTable('sales_order')}`\n            ADD COLUMN `locale` CHAR(5) NOT NULL DEFAULT 'en_US' AFTER `customer_id`;\n\n        ");
     Axis_Core_Model_Cache::getCache()->clean();
 }
示例#5
0
 protected function _initCache()
 {
     $this->bootstrap('DbAdapter');
     //create default cache
     $cache = Axis_Core_Model_Cache::getCache();
     //create database metacache
     Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
     //        /**
     //         * Zend_View acceleration
     //         * http://www.web-blog.org.ua/articles/uskoryaem-zend-view
     //         */
     //        $cacheDir = Axis::config()->system->path . '/var/PluginLoader/';
     //        if (!is_readable($cacheDir)) {
     //            mkdir($cacheDir, 0777);
     //        } elseif(!is_writable($cacheDir)) {
     //            chmod($cacheDir, 0777);
     //        }
     //        require_once 'Zend/Loader/PluginLoader.php';
     //        $classFileIncCache = $cacheDir . 'cache.php';
     //        if (file_exists($classFileIncCache))  {
     //            include_once $classFileIncCache;
     //        } else {
     //            file_put_contents($classFileIncCache, "<?php\n");
     //        }
     //        Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
     return Axis::cache();
 }