/** * Upgrade to the latest version. * * @param String $currentVersion Phprojekt version string indicating our * current version * @param Zend_Db_Adapter_Abstract $db The database to use * * @return void * @throws Exception On Errors */ public function upgrade($currentVersion, Zend_Db_Adapter_Abstract $db) { $this->_db = $db; if (is_null($currentVersion) || Phprojekt::compareVersion($currentVersion, '6.1.4') < 0) { $obj =& $this; $before = function ($oldVersion, $newVersion) use($obj) { $obj->beforeVersionStep($oldVersion, $newVersion); }; $after = function ($oldVersion, $newVersion) use($obj) { $obj->afterVersionStep($oldVersion, $newVersion); }; $dbParser = new Phprojekt_DbParser(array('useExtraData' => false), Phprojekt::getInstance()->getDb()); $dbParser->parseSingleModuleData('Project', null, array('before' => $before, 'after' => $after)); Phprojekt::getInstance()->getCache()->clean(Zend_Cache::CLEANING_MODE_ALL); } if (is_null($currentVersion) || Phprojekt::compareVersion($currentVersion, '6.2.1') < 0) { $this->repairUserRightsOnRoot(); $this->patchOldModuleGrids(); } }
/** * Helper function that parses the SQL/Db.json file and updates the database * accordingly. * * @param string $module The name of this module. * * @return void */ protected final function parseDbFile($module) { $dbParser = new Phprojekt_DbParser(array('useExtraData' => false), Phprojekt::getInstance()->getDb()); $dbParser->parseSingleModuleData($module); }