Gets the destenation path.

@param string $path

@return string
557928
protected function getDestenationPath($path)
    {
        if (!empty($path)) {
            $path = Helpers::getPathWithSlash($path);
        }

        return Config::getViewsPath() . $path;
    }
554953
protected function _findPath($path)
    {
        $path = $this->_unifyPath($path);
        $dirs = $this->_dirs;

        $file = null;

        foreach ($dirs as $dir) {
            if (is_readable(realpath($dir.DS.$path))) {
                $file = $dir.DS.$path;
                break;
            }
        }

        return $file;
    }
951838
public static function normalizePath( $path )
    {
        if ( '\\' == DIRECTORY_SEPARATOR )
        {
            if ( isset( $path, $path[1], $path[2] ) && ':' === $path[1] && '\\' === $path[2] )
            {
                if ( false !== strpos( $path, '/' ) )
                {
                    $path = str_replace( '/', DIRECTORY_SEPARATOR, $path );
                }
            }
        }

        return $path;
    }
329211
public function inCakePath($path = '')
    {
        deprecationWarning('Folder::inCakePath() is deprecated. Use Folder::inPath() instead.');
        $dir = substr(Folder::slashTerm(ROOT), 0, -1);
        $newdir = $dir . $path;

        return $this->inPath($newdir);
    }
468930
protected function getLicense(string $path): string
    {
        if (isset($this->licenseMap[$path])) {
            return $this->licenseMap[$path];
        }

        if (!file_exists($path . '.license')) {
            $this->licenseMap[$path] = '';
            return '';
        }

        $license = (string)file_get_contents($path . '.license');
        $this->licenseMap[$path] = $license;

        return $license;
    }
884779
public function path($path = null)
    {
        if ($path !== null) {
            $this->path = $path;
        }

        return (string) $this->path;
    }
389216
protected function cleanPathInternal($path)
    {
        if ($this->isVirtual($path)) {
            return $this->cleanPath($path);
        }

        if ($this->hasCDBack($path)) {
            $realpath = $this->cleanPath(realpath($path));
            return $realpath ?: null;
        }

        return $this->cleanPath($path);
    }
1332184
protected function normalizePath($path)
    {
        if (preg_match("/^id:.*|^rev:.*|^(ns:[0-9]+(\/.*)?)/", $path) === 1) {
            return $path;
        }

        $path = (trim($path, '/') === '') ? '' : '/'.$path;

        return str_replace('//', '/', $path);
    }
860156
public static function getStoragePath($path = '')
	{
		if (function_exists('storage_path'))
		{
			return storage_path($path);
		}
		else
		{
			return (__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '../storage') . ($path ? DIRECTORY_SEPARATOR . $path : $path);
		}
	}
1143610
public function dest($path)
    {
        return $this->iterate(function ($distFile) use ($path) {
            $dir = $path;

            /** @var DistFile $distFile */
            $filename = $distFile->getDistpathname();
            $dsPos = strrpos($filename, DIRECTORY_SEPARATOR);

            if ($dsPos) {
                $dir .= DIRECTORY_SEPARATOR . substr($filename, 0, $dsPos);
            }

            if (!file_exists($dir)) {
                mkdir($dir, 0777, true);
            }

            file_put_contents(
                $path . DIRECTORY_SEPARATOR . $filename,
                $distFile->getContent()
            );
        });
    }
1364794
public static function getTransformPathForPath($path): string
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        $hashPath = $config->hashPath;
        $pathParts = pathinfo($path);

        if ($hashPath) {
            return FileHelper::normalizePath('/' . md5($pathParts['dirname']));
        }

        return FileHelper::normalizePath($pathParts['dirname']);
    }
640770
public static function realPath($path)
    {
        if (self::isPhar($path) === false) {
            return realpath($path);
        }

        preg_match('/^(phar:\/{0,2})?(.*)?/u', $path, $matches);

        $path = self::resolveRelativeToGlobal($matches[2]);
        $path = self::resolveDots($path);

        return self::PHAR_PREFIX . $path;
    }
1124704
protected function relativeJoomlaTargetPath($path)
    {
        if (strpos($path, JPATH_ROOT) === 0) {
            return substr($path, strlen(JPATH_ROOT) + 1);
        }

        return $path;
    }
1344369
public static function slashPath($path) {
		if (UString::startswith ( $path, "/" ) === false)
			$path = "/" . $path;
		if (! UString::endswith ( $path, "/" ))
			$path = $path . "/";
		return $path;
	}
1198283
public static function normalizePath(string $path): string
    {
        if (substr($path, 0, 1) == DIRECTORY_SEPARATOR) {
            return $path;
        }

        return getcwd().DIRECTORY_SEPARATOR.$path;
    }
1164392
protected static function _realpath($path)
    {
        $realPath = realpath($path);
        if ($realPath !== false) {
            $path = $realPath;
        }

        return rtrim($path, '/\\');
    }
869910
protected function cleanPath($path)
    {
        $lastDot = strrpos(
            $path,
            '.'
        );

        $replace = [
            '.',
            ','
        ];

        $string = str_replace(
                      $replace,
                      '',
                      substr(
                          $path,
                          0,
                          $lastDot
                      )
                  ) . substr(
                      $path,
                      $lastDot
                  );

        return $string;
    }