public function commit() { $target = str_replace('copy.', '', $this->dir); File::rmdir($target); File::cpdir($this->dir, $target); File::rmdir($this->dir); $this->dir = $target; }
public function reclone($name = null) { $name = is_null($name) ? 'clone_' . $this->table : $name; File::rmdir(str_replace(DS . $name, DS . $this->table, $this->dir)); File::cpdir($this->dir, str_replace(DS . $name, DS . $this->table, $this->dir)); File::rmdir($this->dir); return $this; }
/** * [duplicate description] * * @method duplicate * * @param [type] $to [description] * * @return [type] [description] */ public function duplicate($to) { $dir = $this->store->getDir(); if (fnmatch('*.*', $to)) { list($newDb, $newTable) = explode('.', $to, 2); } else { $newDb = $this->db; $newTable = $to; } $new = new self($newDb, $newTable); $newDir = $new->store->getDir(); File::cpdir($dir, $newDir); return $new; }