From: jeroendedauw Date: Thu, 23 Aug 2012 20:43:20 +0000 (+0200) Subject: cherry-pick bdaee6f6594532409ce55e9cde0f942f96ec4181 X-Git-Tag: 1.31.0-rc.0~22097^2^2~56^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=8882bb82b4db0d3b153b337f703cf9e0571d1c17;p=lhc%2Fweb%2Fwiklou.git cherry-pick bdaee6f6594532409ce55e9cde0f942f96ec4181 Change-Id: I5251c8f83f401731c3027718656cb65d8d910f22 --- diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 6483c4e8ac..d344704b6c 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -561,15 +561,27 @@ abstract class DatabaseUpdater { } /** + * If the specified table exists, drop it, or execute the + * patch if one is provided. + * + * Public @since 1.20 + * * @param $table string - * @param $patch string + * @param $patch string|false * @param $fullpath bool */ - protected function dropTable( $table, $patch, $fullpath = false ) { + public function dropTable( $table, $patch = false, $fullpath = false ) { if ( $this->db->tableExists( $table, __METHOD__ ) ) { - $this->output( "Dropping table $table... " ); - $this->applyPatch( $patch, $fullpath ); - $this->output( "done.\n" ); + $msg = "Dropping table $table"; + + if ( $patch === false ) { + $this->output( "$msg ..." ); + $this->db->dropTable( $table, __METHOD__ ); + $this->output( "done.\n" ); + } + else { + $this->applyPatch( $patch, $fullpath, $msg ); + } } else { $this->output( "...$table doesn't exist.\n" ); }