@param string $innerPath The path to append to the theme directory without leading slash

@return string The absolute path to the theme (with provided relative path appended and without trailing slash)
764476
public static function theme($innerPath = '')
    {
        $path = untrailingslashit(apply_filters('baobab/urls/theme', get_stylesheet_directory_uri()));

        if (!empty($innerPath)) {
            $innerPath = untrailingslashit($innerPath);
            $path .= '/' . $innerPath;
        }

        return $path;
    }
1210273
protected function normaliseFilename($absolutePath) {
		$regex = sprintf(
			'#^%s#',
			addslashes(BASE_PATH) . DIRECTORY_SEPARATOR
		);
		return preg_replace($regex, '', $absolutePath);
	}
949376
public static function toAbsolutePath(string $path, string $base, bool $useIncludePath = false) : string
    {
        if (self::isAbsolutePath($path)) {
            return $path;
        }

        $file = $base . DIRECTORY_SEPARATOR . $path;

        if ($useIncludePath && !file_exists($file)) {
            $includePathFile = stream_resolve_include_path($path);
            if ($includePathFile) {
                $file = $includePathFile;
            }
        }
        return $file;
    }
516763
protected function _abspath($path) {
		return $path == $this->separator ? $this->root : $this->root.$this->separator.$path;
	}
841748
public function basePath($path = '')
    {
        return $this->getFilesystem()->dirname($this->path()) . ($path ? DIRECTORY_SEPARATOR . $path : $path);
    }
389636
public function getUrl(string $path = '')
    {
        if (is_multisite() && defined(SUBDOMAIN_INSTALL) && SUBDOMAIN_INSTALL) {
            return sprintf(
                '%s/%s/themes/%s',
                get_home_url(),
                CONTENT_DIR,
                $this->getDirectory()
            ).($path ? '/'.$path : $path);
        }

        return get_template_directory_uri().($path ? '/'.$path : $path);
    }
1020361
public static function relativePath($path)
    {
        $base = self::normalizePath(Director::baseFolder());
        
        return substr($path, strlen($base));
    }
1016201
public function prependPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        $path = rtrim($path, '/\\');

        if (!isset($this->paths[$namespace])) {
            $this->paths[$namespace][] = $path;
        } else {
            array_unshift($this->paths[$namespace], $path);
        }
    }
797887
protected function getDynamicPath($fullPath) {
        // empty string makes FM to use connector path for preview instead of absolute path
        // COMMENTED: due to it prevents to build absolute URL when "serverRoot" is "false" and "fileRoot" is provided
        // as well as "previewUrl" value in the JSON configuration file is set to the correct URL
//        if(empty($this->dynamic_fileroot)) {
//            return '';
//        }
        $path = $this->dynamic_fileroot . '/' . $this->getRelativePath($fullPath);
        return $this->cleanPath($path);
    }
116995
private String internalCategoryRootPath(String basePath, String categoryPath) {

        if (categoryPath.startsWith("/") && basePath.endsWith("/")) {
            // one slash too much
            return basePath + categoryPath.substring(1);
        } else if (!categoryPath.startsWith("/") && !basePath.endsWith("/")) {
            // one slash too less
            return basePath + "/" + categoryPath;
        } else {
            return basePath + categoryPath;
        }
    }
1220572
public function resolvePath(string $relativePath): string
    {
        $path     = [];
        $absolute = (strpos($relativePath, '/') === 0);
        foreach (explode('/', $relativePath) as $part) {
            // ignore parts that have no value
            if (empty($part) || $part === '.') {
                continue;
            }

            if ($part !== '..') {
                $path[] = $part;
                continue;
            }
            if (count($path) > 0) {
                // going back up? sure
                array_pop($path);
                continue;
            }
            throw new \RuntimeException('Relative path resolves above root path.');
        }

        $return = implode('/', $path);
        if ($absolute) {
            $return = "/$return";
        }

        return $return;
    }
411430
public static function baobabFramework($innerPath = '')
    {
        $path = untrailingslashit(dirname(dirname(dirname(dirname(__FILE__)))));

        if (!empty($innerPath)) {
            $innerPath = untrailingslashit($innerPath);
            $path .= '/' . $innerPath;
        }

        return $path;
    }
1114421
private static function normalizerPath($path, $isfolder = False) {

		if (preg_match('/^\//', $path) == 0) {
            $path = '/' . $path;
        }
		
		if ($isfolder == True)
		{
			if (preg_match('/\/$/', $path) == 0) {
				$path = $path . '/';
			}
		}

		return $path;
	}
760816
protected function makeSurePathIsAbsolute($path): string
    {
        $site_url = rtrim($this->getParameter('site_url'), '/') . '/';

        if (0 !== strpos($path, 'http')) {
            return $site_url . ltrim($path, '/');
        } else {
            return $path;
        }
    }
1137021
public static function baobabFramework($innerPath = '')
    {
        $baobabPath = Paths::baobabFramework();
        $themePath= Paths::theme();
        $path = str_replace($themePath, '', $baobabPath);

        if (!empty($innerPath)) {
            $innerPath = untrailingslashit($innerPath);
            $path .= '/' . $innerPath;
        }

        return apply_filters('baobab/urls/storage', self::theme($path), $innerPath);
    }
1165500
protected function getPath($path)
	{
		$rootPath = $this->option('path');

		return $rootPath.'/'.strtolower($this->getTheme()).'/' . $path;
	}
282654
public function HashPath($path, $theme = true)
    {
        $filepath = $this->getPath($path, $theme);
        $path_parts = pathinfo($filepath);

        return sprintf(
            self::$format,
            str_replace(BASE_PATH . (self::$relativeLinks ? '/' : ''), '', $path_parts['dirname']),
            basename($path, ".{$path_parts['extension']}"),
            $this->HashFile($filepath, false),
            $path_parts['extension']
        );
    }