Get the fullpath to the Exports folder.
Create if not there. Create .htaccess protection if missing.

@return string fullpath
336214
static function getExportFolder() {

		$path = \Pressbooks\Utility\get_media_prefix() . 'exports/';
		if ( ! file_exists( $path ) ) {
			wp_mkdir_p( $path );
		}

		$path_to_htaccess = $path . '.htaccess';
		if ( ! file_exists( $path_to_htaccess ) ) {
			// Restrict access
			\Pressbooks\Utility\put_contents( $path_to_htaccess, "deny from all\n" );
		}

		/**
		 * @since 5.3.0
		 *
		 * Filters the export folder path
		 * Use this hook to change the location of the export folder.
		 *
		 * @param string $path The path to the Pressbooks export folder
		 */
		$path = apply_filters( 'pb_get_export_folder', $path );

		return $path;
	}
985569
private function getFilePath()
    {
        $fullname = $this->fullName;
        $rootPath = $_SERVER['DOCUMENT_ROOT'];

        if (substr($fullname, 0, 1) != '/') {
            $fullname = '/' . $fullname;
        }

        return $rootPath . $fullname;
    }
699439
public function full_url() {
		$query = $this->getQueryString();

		$question = ( $this->getBaseUrl() . $this->getPathInfo() ) === '/' ? '/?' : '?';

		return $query ? ( $this->url() . $question . $query ) : $this->url();
	}
211315
private function getCurrentUrlPath()
    {
        if ($this->path) {
            return $this->path;
        }

        /**
         * check if the path is empty otherwise
         * set it with the server variable and if there's no server variable set it as the default delimiter [/] the root
         */
        $this->path = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null;
        $this->urlPart = $this->parsePath($this->path);

        return $this->path;
    }
903442
private function getPathInfo()
    {
        $requestURI = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';

        $this->validateRequestURI($requestURI);

        if (empty($requestURI)) {
            return;
        }

        $request = $requestURI;

        $this->fullRequest = $this->currentRequest = $request;
        $this->addDebugMessage("Full request " . $this->fullRequest);

        $secure = !empty($_SERVER['HTTPS']);
        $this->addDebugMessage($secure ? "Secure routing." : "Non-secure routing.");

        $this->baseHREF = "http" . ($secure ? 's' : '') . '://' . $_SERVER['SERVER_NAME'];

        $this->currentHREF = $this->baseHREF . $request;

        $queryStringIndex = strpos($request, '?');

        $startsWithSlash = ($request[0] == '/' ? 1 : 0);

        if ($queryStringIndex !== false) {
            $this->currentRequest = substr($request, 0, $queryStringIndex);

            $request = substr($request, $startsWithSlash, $queryStringIndex - 1);
        } else {
            $request = substr($request, $startsWithSlash);
        }

        if (!empty($request)) {
            $this->segments = explode('/', $request);
        }

        $this->isHomepage = (empty($request) || $request == '/');

        $this->checkForTrailingSlashRedirect();
    }
1352139
public function getCachePath(): string
    {
        $path = $this->getRuntimePath() . DIRECTORY_SEPARATOR . 'cache';
        FileHelper::createDirectory($path);
        return $path;
    }
1317303
public function path()
    {
        $dirname = $this->dirname();

        if ($this->parent instanceof Root) { //at root

            return $dirname.$this->basename();
        }

        return sprintf('%s/%s', $dirname, $this->basename());

    }
794036
protected function getFilePath()
    {
        $path = $this->cachePath . DIRECTORY_SEPARATOR . $this->cacheDirectory . DIRECTORY_SEPARATOR;
        $path = str_replace(['\\\\', '//'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $path);

        return $path;
    }
619227
private function getFilePath()
    {
        $fullname = $this->fullName;
        $rootPath = yii::getAlias('@uploads/article/ueditor');

        if (substr($fullname, 0, 1) != '/') {
            $fullname = '/' . $fullname;
        }

        return $rootPath . $fullname;
    }
393017
protected function urlPath() {
		$dir = str_replace( Container::get( 'Styles' )->getDir(), '', pathinfo( $this->exportStylePath, PATHINFO_DIRNAME ) );
		$dir = ltrim( $dir, '/' );
		$url_path = trailingslashit( get_stylesheet_directory_uri() ) . $dir;
		$url_path = set_url_scheme( $url_path );

		return $url_path;
	}
1318548
public function fullUrl()
    {
        $query = $this->getQueryString();

        $question = $this->getBaseUrl().$this->getPathInfo() === '/' ? '/?' : '?';

        return $query ? $this->url().$question.$query : $this->url();
    }
540006
public function getExternalPath() {
        if (true === $this->_config->getConfigData('development_environment')) {
            $extPath = EXT_ROOT . $this->_config->getConfigData('base_path_dev');
        } else {
            $extPath = EXT_ROOT . $this->_config->getConfigData('base_path');
        }
        return $extPath;
    }
210853
public function getWebPath() : string
    {
        if ($this->fullWebPath !== null) {
            return $this->fullWebPath;
        }

        $path = rtrim($this->getSetting('webPath'), '/');

        if (filter_var($path, FILTER_VALIDATE_URL) !== false) {
            return $this->fullWebPath = $path;
        }

        if (Str::startsWith($path, '//')) {
            return $this->fullWebPath = $path;
        }

        return $this->fullWebPath = urlTo(ltrim($path, '/'));
    }
637108
public function getPath()
    {
        $path = parent::getPath();
        if ('' == $path)
        {
            $path = '/';
        }
        if ($this->siteRoot)
        {
            $path = substr($path, strlen($this->siteRoot));
        }
        return $path;
    }
1278694
protected function generateFullPath()
    {
        return $this->fullPath = $this->pathGenerator
            ->generatePath($this->page, $this->path ?: '')
        ;
    }
78639
private function getFilePath()
    {
        $fullname = $this->fullName;
        $rootPath = Yii::getAlias('@webroot');

        if (substr($fullname, 0, 1) != '/') {
            $fullname = '/' . $fullname;
        }

        return $rootPath . $fullname;
    }
1167761
public static function getCurrentScriptPath()
    {
        $queryString = self::getCurrentScriptName();

        //add a fake letter case /test/test2/ returns /test which is not expected
        $urlDir = dirname($queryString . 'x');
        $urlDir = str_replace('\\', '/', $urlDir);
        // if we are in a subpath we add a trailing slash
        if (strlen($urlDir) > 1) {
            $urlDir .= '/';
        }
        return $urlDir;
    }