Rename file in path.

@param string $path

@return string
351208
public function transformFilename($path)
    {
        $pathTransformed = str_replace('object', strtolower(Str::singular($this->module)), $path);
        $pathTransformed = str_replace('Object', Str::singular($this->module), $pathTransformed);

        return $pathTransformed;
    }
321431
public static function normalize(string $path): string {
		if (!(false === strpos($path, '://'))) {
			$ex = explode("://", $path);

			return $ex[0] . "://" . "/" . ltrim(Util::normalizePath("/" . ltrim($ex[1], "/")));
		}

		return "/" . ltrim(Util::normalizePath($path), "/");
	}
1237536
public static function purifyPath($path)
    {
        $path = (string)$path;
        $path = trim($path);
        $path = rtrim($path, '\\/');

        return $path;
    }
985166
public function changePath($path)
    {
        $pathname = $this->createPathname($path, $this->getBasename(), $this->getExtension());

        return new static($pathname);
    }
624677
public static function convertPathForDisplay($path)
    {
        $pathForDisplay = preg_replace('/-\d+' . self::PATH_SEPARATOR . '/', ' / ', $path);

        if ($pathForDisplay !== null && strlen($pathForDisplay) > 0) {
            $pathForDisplay = substr_replace($pathForDisplay, "", -3);
        }

        return $pathForDisplay;
    }
1075945
protected function formatPath($path)
    {
        $path = trim($path, '/') . '/';
        if (strlen($path) > 1) {
            $path = '/' . $path;
        }

        return $path;
    }
833143
public function normalizePath($path)
    {
        $realpath = realpath($path);
        if ($realpath) {
            $path = $realpath;
        }

        $path = str_replace('\\', '/', $path);
        $path = rtrim($path, '/');
        if (substr($path, 1, 1) === ':') {
            $path = lcfirst($path);
        }

        return $path;
    }
254965
public function rename($name)
    {
        $name = Str::slug($name);
        if ($this->isFile()) {
            return $this->renameFile($name, $this->getMetaData()->getExtension());
        }

        return $this->renameFolder($name);
    }
1276050
public static function getFilename($path)
    {
        $name = pathinfo($path, PATHINFO_FILENAME);

        $ext = pathinfo($path, PATHINFO_EXTENSION);

        if ($ext) {
            $name .= '.' . $ext;
        }

        return $name;
    }
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);
    }
424896
private function renameDirectory($path, $rename)
    {
        if ($this->isSFTP()) {
            $renamed = @$this->ftp->rename($path, $rename);
        } else {
            $renamed = @ftp_rename($this->ftp, $path, $rename);
        }
        if (!$renamed) {
            $this->fail("couldn't rename directory {$path} to {$rename}");
        }
        $this->debug("Renamed directory: {$path} to {$rename}");
    }
859811
public function setPath($path)
    {
        static $pathReplace = array(' ' => '%20', '?' => '%3F');
        if (is_array($path)) {
            $path = '/' . implode('/', $path);
        }

        $this->path = strtr($path, $pathReplace);

        return $this;
    }
533481
public static function clean_path($path)
	{
		static $search = array(APPPATH, COREPATH, PKGPATH, DOCROOT, '\\');
		static $replace = array('APPPATH/', 'COREPATH/', 'PKGPATH/', 'DOCROOT/', '/');
		return str_ireplace($search, $replace, $path);
	}
1289185
public static function formatPath($path)
    {
        if ($path == DIRECTORY_SEPARATOR) {
            return $path;
        }
        return trim($path) ? rtrim(trim($path), DIRECTORY_SEPARATOR) : '';
    }
907762
public static function normalizePath(string $path): string
    {
        $path = \str_replace('/./', '/', \str_replace('\\', '/', $path));
        $m = null;
        
        while (\preg_match("'/([^/]+/\.\./)'", $path, $m)) {
            $path = \str_replace($m[1], '', $path);
        }
        
        return $path;
    }
1333361
private function relativizePaths($path)
    {
        if (!$this->basePath) {
            return $path;
        }

        return str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
    }
601517
private function normalizePath($path)
    {
        $path = str_replace(\DIRECTORY_SEPARATOR, '/', $path);
        if ('/' !== $path[0]) {
            $path = getcwd() . '/' . $path;
        }

        return $path;
    }