本文整理汇总了PHP中DatabaseBase::patchPath方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseBase::patchPath方法的具体用法?PHP DatabaseBase::patchPath怎么用?PHP DatabaseBase::patchPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseBase
的用法示例。
在下文中一共展示了DatabaseBase::patchPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyPatch
/**
* Applies a SQL patch
* @param $path String Path to the patch file
* @param $isFullPath Boolean Whether to treat $path as a relative or not
*/
protected function applyPatch($path, $isFullPath = false)
{
if ($isFullPath) {
$this->db->sourceFile($path);
} else {
$this->db->sourceFile($this->db->patchPath($path));
}
}
示例2: applyPatch
/**
* Applies a SQL patch
* @param $path String Path to the patch file
* @param $isFullPath Boolean Whether to treat $path as a relative or not
* @param $msg String Description of the patch
*/
protected function applyPatch($path, $isFullPath = false, $msg = null)
{
if ($msg === null) {
$msg = "Applying {$path} patch";
}
if (!$isFullPath) {
$path = $this->db->patchPath($path);
}
$this->output("{$msg} ...");
$this->db->sourceFile($path);
$this->output("done.\n");
}
示例3: execute
public function execute()
{
$dbw = wfGetDB(DB_MASTER);
foreach ($this->mArgs as $arg) {
$files = array($arg, DatabaseBase::patchPath($arg), DatabaseBase::patchPath("patch-{$arg}.sql"));
foreach ($files as $file) {
if (file_exists($file)) {
$this->output("{$file} ...\n");
$dbw->sourceFile($file);
continue 2;
}
}
$this->error("Could not find {$arg}\n");
}
$this->output("done.\n");
}
示例4: applyPatch
/**
* Applies a SQL patch
*
* @param string $path Path to the patch file
* @param bool $isFullPath Whether to treat $path as a relative or not
* @param string $msg Description of the patch
* @return bool False if patch is skipped.
*/
protected function applyPatch($path, $isFullPath = false, $msg = null)
{
if ($msg === null) {
$msg = "Applying {$path} patch";
}
if ($this->skipSchema) {
$this->output("...skipping schema change ({$msg}).\n");
return false;
}
$this->output("{$msg} ...");
if (!$isFullPath) {
$path = $this->db->patchPath($path);
}
if ($this->fileHandle !== null) {
$this->copyFile($path);
} else {
$this->db->sourceFile($path);
}
$this->output("done.\n");
return true;
}