getController()->lang; $dbversionnumber = Yii::app()->getConfig('dbversionnumber'); $currentDBVersion=GetGlobalSetting('DBVersion'); $usertemplaterootdir = Yii::app()->getConfig('usertemplaterootdir'); $standardtemplaterootdir = Yii::app()->getConfig('standardtemplaterootdir'); if (intval($dbversionnumber)>intval($currentDBVersion)) { if(isset($subaction) && $subaction=="yes") { echo Yii::app()->getController()->_getAdminHeader(); echo "
"; Yii::app()->loadHelper('update/updatedb'); $result=db_upgrade_all(intval($currentDBVersion)); if ($result) { $data = "
".sprintf($clang->gT("Database has been successfully upgraded to version %s"),$dbversionnumber); $data .= "
".$clang->gT("Back to main menu")."
"; } else { $data = "

".$clang->gT("Please fix this error in your database and try again")."

"; } return $data; } else { return ShowDBUpgradeNotice(); } } } function ShowDBUpgradeNotice() { //$error=false; $clang = Yii::app()->lang; //$sitename = Yii::app()->getConfig('sitename'); return '
' ."
".$clang->gT('Database upgrade').'

' .$clang->gT('Please verify the following information before continuing with the database upgrade:').'


' ."

" ."" . $clang->gT('Click here to continue') . "" ."

" .'
'; } function getDBConnectionStringProperty($sProperty) { // Yii doesn't give us a good way to get the database name preg_match('/'.$sProperty.'=([^;]*)/', Yii::app()->db->getSchema()->getDbConnection()->connectionString, $aMatches); if ( count($aMatches) === 0 ) { return null; } return $aMatches[1]; }