Ejemplo n.º 1
0
 public function commit()
 {
     $target = str_replace('copy.', '', $this->dir);
     File::rmdir($target);
     File::cpdir($this->dir, $target);
     File::rmdir($this->dir);
     $this->dir = $target;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 /**
  * [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;
 }