Renombra un archivo
@param string $nameold
@param string $namenew
@param string $path
@return void
328094
public function rename($nameold,$namenew,$path){
        if($this->validNameFile($nameold,false) && $this->validNameFile($namenew,false)){
            $fullpath = $this->getFullPath().$path;
            $nameold = $this->clearNameFile($nameold);
            $namenew = $this->clearNameFile($namenew);

            $file = new Filesystem;
            if($file->exists($fullpath.$nameold)){
                if( $this->config['debug'] ) $this->_log('$fullpath.$nameold - '.$fullpath.$nameold);
                if(is_dir($fullpath.$nameold)){
                    $namenew = $this->sanitizeNameFolder($namenew);
                    if($file->exists($fullpath.$namenew)==false){
                        $file->rename($fullpath.$nameold,$fullpath.$namenew);
                        $result = array("query"=>"BE_RENAME_MODIFIED","params"=>array());
                        $this->setInfo(array("msg"=>$result,"data"=>array("namefile" => $namenew )));

                    }else{
                        $result = array("query"=>"BE_RENAME_EXISTED","params"=>array());
                        $this->setInfo(array("msg"=>$result,"status"=>0));
                    }
                }elseif(is_file($fullpath.$nameold)){
                    if($this->validExt($nameold)){
                        $extold = $this->getExtension($nameold);
                        $namenew = $namenew.'.'.$extold;
                        if($file->exists($fullpath.$namenew)==false){
                            $file2 = new \SplFileInfo($fullpath.$nameold);
                            if(in_array($file2->getExtension(), $this->config['images']['images_ext'])){
                                $filename = $file2->getFilename();
                                foreach ($this->config['images']['resize'] as $key => $value) {
                                    $image_info = $this->imageSizeName($path,$filename,$value);
                                    $filename_old = $image_info['name'];
                                    $fullpaththumb_name = $this->getFullPath().'/'.$this->config['folder_thumb'].$path.$filename_old;
                                    $file->remove($fullpaththumb_name);
                                }
                            }
                            $file->rename($fullpath.$nameold,$fullpath.$namenew);
                            $file3 = new \SplFileInfo($fullpath.$namenew);
                            $this->createThumb($file3,$path);
                            $result = array("query"=>"BE_RENAME_MODIFIED","params"=>array());
                            $this->setInfo(array("msg"=>$result,"data"=>array("namefile" => $namenew )));
                        }else{
                            $result = array("query"=>"BE_RENAME_EXISTED","params"=>array());
                            $this->setInfo(array("msg"=>$result,"status"=>0));
                        }
                    }else{
                        $result = array("query"=>"BE_RENAME_FILENAME_NOT_VALID","params"=>array());
                        $this->setInfo(array("msg"=>$result, "status"=>0));
                    }
                }
            }else{
                $result = array("query"=>"BE_RENAME_NOT_EXISTS","params"=>array());
                $this->setInfo(array("msg"=>$result, "status"=>0));
            }
        }else{
           $result = array("query"=>"BE_RENAME_FILENAME_NOT_VALID","params"=>array());
           $this->setInfo(array("msg"=>$result, "status"=>0));
       }
   }
655246
protected function _unlink($path, $name)
    {
        //pętla po wszystkich plikach
        foreach (glob($path . '/*') as $file) {
            if (is_dir($file)) {
                //rekurencyjnie schodzi katalog niżej
                $this->_unlink($file, $name);
                continue;
            }
            //kasowanie pliku jeśli nazwa jest zgodna z wzorcem
            if (basename($file) == $name) {
                unlink($file);
            }
        }
    }
1365714
public function addPath(string $path, string $namespace = self::DEFAULT_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = $this->errorCache = [];

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
747428
public function load($nameOrPath)
    {
        $template = $this->factory->get($nameOrPath);

        /** @var Transformation $transformation */
        foreach ($template as $transformation) {
            /** @var WriterAbstract $writer */
            $writer = $this->writerCollection[$transformation->getWriter()];
            if ($writer) {
                $writer->checkRequirements();
            }
        }

        $this[$template->getName()] = $template;
    }
1141113
public function copy($path, $newpath)
    {
        $this->writeStream(static::normalizerPath($newpath), $this->readStream(static::normalizerPath($path))['stream'], new Config() );

        return true;
    }
1350094
public function subtree($path, &$name, $create = false)
  {
    $parts = $this->split($path);

    $_name = array_shift($parts);
    if (!sizeof($parts)) {
      $name = $_name;
      $subtree = $this;
    } else {

      $exists = isset($this->_subTrees[$_name]);
      if (!$exists && !$create) {
        $subtree = null;
        $name = null;
      } else {
        if (!$exists && $create) {
          $this->_subTrees[$_name] = new self();
        }
        $subtree = $this->_subTrees[$_name]->subtree($parts, $name, $create);
      }

    }
    return $subtree;
  }
832161
public function rename($path, $newPath)
    {
        $this->recursiveCreateDir(Util::dirname($newPath));

        $location = $this->applyPathPrefix($path);
        $destination = $this->applyPathPrefix($newPath);

        try {
            $this->share->rename($location, $destination);
        } catch (NotFoundException $e) {
            return false;
        } catch (AlreadyExistsException $e) {
            return false;
        }

        return true;
    }
974327
public function rename($path, $newpath)
    {
        $location = $this->applyPathPrefix($path);
        $destination = $this->applyPathPrefix($newpath);
        $this->ossClient->copyObject($this->bucket, $location, $this->bucket, $destination);
        $this->ossClient->deleteObject($this->bucket, $location);
        return true;
    }
333863
public static function set($namespace, $path)
    {
        $namespace = trim($namespace, '\\');
        $path = rtrim($path, '/');

        if (!isset(self::$_namespace_list[$namespace])) {
            self::$_namespace_list[$namespace] = [];
        }

        self::$_namespace_list[$namespace][] = $path;
    }
729687
public function rename($path, $newpath)
    {
        $err = Qiniu_RS_Move($this->getClient(), $this->bucket, $path, $this->bucket, $newpath);
        return $err === null;
    }
1046257
public static function init($path, $name = 'log', $minimumLevel = self::DEBUG)
    {
        if($path === 'php://output')
        {
            self::$active = true;
        }
        else if(is_writable($path))
        {
            self::$active = true;
        }
        else 
        {
            self::$active = false;
        }
        
        self::$backend = null;
        self::$stream = null;
        self::$name = $name;
        self::$logFilePath = $path;
        self::$minimumLevel = $minimumLevel;
    }
1365687
public function renameFile($name, $newName)
    {
        foreach ($this->getAllFields() as $field) {
            $path = $this->getFilePath($field, $name);
            $newPath = $this->getFilePath($field, $newName);
            if (file_exists($newPath)) {
                throw new \Exception("File {$newName} already exists");
            }
            rename($path, $newPath);
        }
        if ($name == $this->owner->getAttribute($this->fileField)
            && ($files = $this->getFileList())
        ) {
            $this->owner->updateAttributes([$this->fileField => $newName]);
        }
        return true;
    }
787266
public function addAsset($name, $path)
    {
        if (!is_file($path)) {
            throw new \RuntimeException('The asset file "' . $path . '" does not exist.');
        }
        $this->assets[$name] = $path;
    }
676955
public function rename($path, $originalFileName, $newFileName)
    {
        $path = $this->cleanFolder($path);
        $nameName = $path.DIRECTORY_SEPARATOR.$newFileName;
        if ($this->disk->exists($nameName)) {
            $this->errors[] = 'The file "'.$newFileName.'" already exists in this folder.';

            return false;
        }

        return $this->disk->getDriver()->rename(($path.DIRECTORY_SEPARATOR.$originalFileName), $nameName);
    }
1023927
public function addScript($name, $path)
    {
        if (isset($this->scripts->$name)) {
            $this->scripts->$name[] = $path;
        } else {
            $this->scripts->$name = [$path];
        }

        return $this;
    }
973243
public function rename($path, $newpath)
    {
        $newpath = static::normalizerPath($newpath);

        $this->writeStream($newpath, $this->readStream($path)['stream'], new Config() );

        $this->delete($path);

        return true;
    }
323697
public static function delete($name, $path = "/") {
		if (isset ( $_COOKIE [$name] )) {
			unset ( $_COOKIE [$name] );
		}
		\setcookie ( $name, "", \time () - 3600, $path );
	}