本文整理汇总了PHP中DatabaseBase::dropTable方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseBase::dropTable方法的具体用法?PHP DatabaseBase::dropTable怎么用?PHP DatabaseBase::dropTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseBase
的用法示例。
在下文中一共展示了DatabaseBase::dropTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dropTable
/**
* 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");
}
}
示例2: dropTable
/**
* 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;
}