示例#1
0
 /**
  * compare the schema of the connected database
  * with that of a given schema
  *
  * @param string $version
  * @return boolean
  */
 function _checkDBIntegrity($version, $aSchema = '')
 {
     if (empty($aSchema)) {
         $path_schema = $this->oDBUpgrader->path_schema;
         $file_schema = $this->oDBUpgrader->file_schema;
         $aSchema['name'] = 'tables_core';
     }
     $path_changes = $this->oDBUpgrader->path_changes;
     $file_changes = $this->oDBUpgrader->file_changes;
     $this->oIntegrity->oUpgrader = $this;
     $result = $this->oIntegrity->checkIntegrityQuick($version, $aSchema);
     if (empty($schema)) {
         $this->oDBUpgrader->path_schema = $path_schema;
         $this->oDBUpgrader->file_schema = $file_schema;
     }
     $this->oDBUpgrader->path_changes = $path_changes;
     $this->oDBUpgrader->file_changes = $file_changes;
     if (!$result) {
         $this->oLogger->logError('database integrity check could not complete due to problems');
         return false;
     }
     $this->oLogger->logClear();
     if (count($this->oIntegrity->aTasksConstructiveAll) > 0) {
         $this->oLogger->logError('database integrity check detected problems with the database');
         foreach ($this->oIntegrity->aTasksConstructiveAll as $elem => &$aTasks) {
             foreach ($aTasks as $task => &$aItems) {
                 $this->oLogger->logError(count($aItems) . ' ' . $elem . ' to ' . $task);
             }
         }
         return false;
     }
     return $this->oDBUpgrader->checkPotentialUpgradeProblems();
 }