From: Bharat M. <bh...@us...> - 2005-07-23 04:03:37
|
Update of /cvsroot/gallery/gallery2/install/steps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31853/steps Modified Files: DatabaseSetupStep.class Log Message: Make the "clean database" operation return a GalleryStatus and propagate any error stack traces to the template. Index: DatabaseSetupStep.class =================================================================== RCS file: /cvsroot/gallery/gallery2/install/steps/DatabaseSetupStep.class,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- DatabaseSetupStep.class 22 Jul 2005 15:39:04 -0000 1.27 +++ DatabaseSetupStep.class 23 Jul 2005 04:03:08 -0000 1.28 @@ -210,11 +210,14 @@ /* Drop all Gallery database tables listed in the schema table */ $this->_captureStart(); - if (!$this->_cleanDatabase()) { + $ret = $this->_cleanDatabase(); + if ($ret->isError()) { + $ret = $ret->wrap(__FILE__, __LINE__); global $gallery; $templateData['errors'][] = _('Could not execute the required API to drop the Gallery database tables. Please clean the Gallery database manually.'); $templateData['databaseErrors'] = $gallery->getDebugBuffer(); + $templateData['stackTrace'] = $ret->getAsHtml(); $gallery->clearDebugBuffer(); } else { $dbCleaned = true; @@ -588,7 +591,7 @@ * Drop all Gallery database tables * * Drop all Gallery database tables that are listed in the Gallery schema table - * @return boolean success + * @return array GalleryStatus a status code */ function _cleanDatabase() { global $gallery; @@ -597,8 +600,11 @@ $storage->_db->debug = true; $gallery->setDebug('immediate'); $ret = $storage->cleanStore(); + if ($ret->isError()) { + return $ret->wrap(__FILE__, __LINE__); + } - return $ret->isSuccess(); + return GalleryStatus::success(); } } ?> |