Ejemplo n.º 1
0
    return $aMessages;
}
function doUpgrade($dbname)
{
    global $oUpgrader;
    $GLOBALS['_MAX']['CONF']['database']['name'] = $dbname;
    $oUpgrader->oDBUpgrader->doBackups = false;
    if ($oUpgrader->upgrade()) {
        $aMessages[] = 'Your database has successfully been upgraded to version ' . OA_VERSION;
    } else {
        $aMessages[] = 'Your database has NOT been upgraded to version ' . OA_VERSION;
    }
    return $aMessages;
}
if (array_key_exists('btn_data_drop', $_POST)) {
    OA_DB::dropDatabase($_POST['dbname']);
}
$oIntegrity = new OA_DB_Integrity();
$GLOBALS['_MAX']['CONF']['table']['prefix'] = '';
$datasetfile = $_REQUEST['datasetfile'];
$aDatasetFile = $oIntegrity->getSchemaFileInfo(TD_DATAPATH, $datasetfile);
if (array_key_exists('error', $aDatasetFile)) {
    $aMessages[] = $aDatasetFile['error'];
} else {
    $oIntegrity->version = $aDatasetFile['version'];
    $oUpgrader = new OA_Upgrade();
    $aMessages = getUpgradeStatus($aDatasetFile['name']);
}
if (array_key_exists('btn_data_integ', $_REQUEST)) {
    if ($oIntegrity->init($_REQUEST['compare_version'], $aDatasetFile['name'])) {
        $oIntegrity->checkIntegrity();
Ejemplo n.º 2
0
 /**
  * remove the currently connected database
  *
  * @param boolean $log
  */
 function _dropDatabase($log = true)
 {
     if ($this->can_drop_database) {
         if (OA_DB::dropDatabase($this->aDsn['database']['name'])) {
             if ($log) {
                 $this->oLogger->log('Installation dropped the database ' . $this->aDsn['database']['name']);
             }
             return true;
         }
         $this->oLogger->logError('Installation failed to drop the database ' . $this->aDsn['database']['name']);
         return false;
     } else {
         $this->oTable->dropAllTables();
         if ($log) {
             $this->oLogger->log('Installation dropped the core tables from database ' . $this->aDsn['database']['name']);
         }
         return true;
     }
 }
Ejemplo n.º 3
0
 /**
  * A method for tearing down (dropping) the test database.
  */
 static function teardownDB()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $result = OA_DB::dropDatabase($aConf['database']['name']);
     unset($GLOBALS['_OA']['CONNECTIONS']);
     $GLOBALS['_MDB2_databases'] = array();
 }