Newscoop\Storage::getPath PHP Method

getPath() private method

Get path
private getPath ( string $key, $isRealpath = FALSE ) : mixed
$key string
return mixed
    private function getPath($key, $isRealpath = FALSE)
    {
        $key = ltrim($key, ' /');
        if (preg_match('#\\.\\.(/|$)#', $key)) {
            throw new \InvalidArgumentException($key, self::ERROR_KEY_INVALID);
        }
        $rootpath = "{$this->root}/{$key}";
        // check if is realpath
        if ($isRealpath) {
            $realpath = realpath($rootpath);
            if (!$realpath) {
                return FALSE;
            }
            return $realpath;
        }
        return $rootpath;
    }