public function currentSchemaVersion($module)
 {
     $front = Zend_Controller_Front::getInstance();
     $modulePath = $front->getModuleDirectory($module);
     $bootstrap = $front->getParam('bootstrap');
     /**
      * This only happens when running unit tests.
      * Not sure why at this point but this keeps things running for now
      */
     if ($bootstrap == null) {
         return '';
     }
     $manager = new FFR_Db_Schema_Manager($modulePath . '/schemas', $bootstrap->getResource('db'), $module);
     return $manager->getCurrentSchemaVersion();
 }
 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/');
     }
 }