Exemplo n.º 1
0
 /**
  * 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|false
  * @param $fullpath bool
  */
 public function dropTable($table, $patch = false, $fullpath = false)
 {
     if ($this->db->tableExists($table, __METHOD__)) {
         $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");
     }
 }
Exemplo n.º 2
0
	/**
	 * 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|false
	 * @param $fullpath bool
	 * @return Boolean false if this was skipped because schema changes are skipped
	 */
	public function dropTable( $table, $patch = false, $fullpath = false ) {
		if ( !$this->doTable( $table ) ) {
			return true;
		}

		if ( $this->db->tableExists( $table, __METHOD__ ) ) {
			$msg = "Dropping table $table";

			if ( $patch === false ) {
				$this->output( "$msg ..." );
				$this->db->dropTable( $table, __METHOD__ );
				$this->output( "done.\n" );
			} else {
				return $this->applyPatch( $patch, $fullpath, $msg );
			}
		} else {
			$this->output( "...$table doesn't exist.\n" );
		}

		return true;
	}