rename() public method

Relocates a path from a location to a new location
public rename ( string $path, string $target )
$path string
$target string
Exemplo n.º 1
0
 /**
  * Renames an uploaded file
  *
  * @param  string $filepath
  * @param  string $newpath
  * @return void
  */
 public function renameUploadedFile($filepath, $newpath)
 {
     if ($this->Caption->exists($this->basepath . $filepath)) {
         $oldCptPath = $this->MediaPaths->imageCaptionPath($this->basepath . $filepath);
         $newCptPath = $this->MediaPaths->imageCaptionPath($this->basepath . $newpath);
         $this->Filesystem->rename($oldCptPath, $newCptPath);
     }
     return $this->Filesystem->rename($this->basepath . $filepath, $this->basepath . $newpath);
 }
Exemplo n.º 2
0
 /**
  * Renames an uploaded file
  *
  * @param  string $filepath
  * @param  string $newpath
  * @return void
  */
 public function renameUploadedFile($filepath, $newpath)
 {
     return $this->Filesystem->rename($this->basepath . $filepath, $this->basepath . $newpath);
 }