示例#1
0
 public function checkForUpdate($module)
 {
     $front = Zend_Controller_Front::getInstance();
     $modulePath = $front->getModuleDirectory($module);
     $bootstrap = $front->getParam('bootstrap');
     /**
      * @todo Convert schema manager calls into a model
      */
     $manager = new FFR_Db_Schema_Manager($modulePath . '/schemas', $bootstrap->getResource('db'), $module);
     return $manager->updateTo(null, false);
 }
 public function processAction()
 {
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $module = $this->_request->getParam('update-module');
     $front = $this->getFrontController();
     $modulePath = $front->getModuleDirectory($module);
     $schemaManager = new FFR_Db_Schema_Manager($modulePath . '/schemas', $this->getInvokeArg('bootstrap')->getResource('db'), $module);
     $result = $schemaManager->updateTo();
     if ($result == FFR_Db_Schema_Manager::RESULT_OK || $result == FFR_Db_Schema_Manager::RESULT_AT_CURRENT_VERSION) {
         // Clear the cache since we've updated a module
         $cache = Zend_Controller_Action_HelperBroker::getStaticHelper('Cache')->getManager()->getCache('database');
         $cache->clean(Zend_Cache::CLEANING_MODE_ALL);
         $this->_redirect('/admin/update/');
     }
 }