From: Sam Reed Date: Thu, 27 Oct 2011 23:07:04 +0000 (+0000) Subject: Add dropTable method X-Git-Tag: 1.31.0-rc.0~26862 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=d18f8b76ec5b86120d4eb995dd71674c776a59f3;p=lhc%2Fweb%2Fwiklou.git Add dropTable method --- diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 80dbe30ac6..b21f69413a 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -480,6 +480,21 @@ abstract class DatabaseUpdater { } } + /** + * @param $table string + * @param $patch string + * @param $fullpath bool + */ + protected function dropTable( $table, $patch, $fullpath = false ) { + if ( $this->db->tableExists( $table ) ) { + $this->output( "Dropping table $table... " ); + $this->applyPatch( $patch, $fullpath ); + $this->output( "ok\n" ); + } else { + $this->output( "...$table doesn't exist.\n" ); + } + } + /** * Modify an existing field *