Autoloads the URL map only allowing a single execution.
@return array Returns the URL map.
162130
protected function getRouterObject()
    {
        if ($this->routerObj !== null) {
            return $this->routerObj;
        }

        /*
         * Load up each route rule
         */
        $router = new RainRouter();
        foreach ($this->getUrlMap() as $pageInfo) {
            $router->route($pageInfo['file'], $pageInfo['pattern']);
        }

        /*
         * Sort all the rules
         */
        $router->sortRules();

        return $this->routerObj = $router;
    }
121929
public function load()
    {
        $data = [];

        if (is_file($this->filePath)) {
            $data = json_decode(file_get_contents($this->filePath), true);
        }

        return $data;
    }
10355
public static function defaultUrlParams() {
		$defaults = ['plugin' => false];
		$prefixes = (array)Configure::read('Routing.prefixes');
		foreach ($prefixes as $prefix) {
			$defaults[$prefix] = false;
		}
		return $defaults;
	}
1228617
public function getRewriteMapsAsArray()
    {

        // initialize the array for the rewrite maps
        $rewriteMaps = array();

        // iterate over the rewriteMaps nodes and sort them into an array
        foreach ($this->getRewriteMaps() as $rewriteMapNode) {
            $rewriteMaps[$rewriteMapNode->getType()] = $rewriteMapNode->getParamsAsArray();
        }

        // return the array
        return $rewriteMaps;
    }
695339
private function getAjaxLoadUrl()
    {
        $qsParams = ['filterName' => $this->getFilter()->getRequestVar()];

        $currentCategory = $this->getFilter()->getLayer()->getCurrentCategory();

        if ($currentCategory && $currentCategory->getId() && $currentCategory->getLevel() > 1) {
            $qsParams['cat'] = $currentCategory->getId();
        }

        $urlParams = ['_current' => true, '_query' => $qsParams];

        return $this->_urlBuilder->getUrl('catalog/navigation_filter/ajax', $urlParams);
    }
119469
protected function loadMapRow()
    {
        $ret = [
            "cnt" => 0,
            "rec" => [],
            "dat" => []
            ];
        if (sizeof($this->datMap) > 0) {
            foreach ($this->datMap as $let => $d) {
                $ret["dat"][$let] = [
                    "sum" => 0,
                    "avg" => 0,
                    "ids" => []
                    ];
            }
        }
        return $ret;
    }
506128
private function setAutoLoading()
    {
        // set auto-loading for restler
        $autoload = PATH_site . 'typo3conf/ext/restler/vendor/autoload.php';
        if (file_exists($autoload)) {
            require_once $autoload;
        }

        // set auto-loading for extBase/TYPO3-classes
        $objectManager = $this->objectManager;
        Scope::$resolver = function ($className) use ($objectManager) {
            return $objectManager->get($className);
        };
    }
1285694
protected function getRequestedUrls()
    {
        $oInput = Factory::service('Input');
        $sUrls  = $oInput->get('urls') ?: $oInput->header('X-Cdn-Urls');
        $aUrls  = !is_array($sUrls) ? explode(',', $sUrls) : $sUrls;
        $aUrls  = array_map('strtolower', $aUrls);

        //  Filter out any which don't follow the format {digit}x{digit}-{scale|crop} || raw
        foreach ($aUrls as &$sDimension) {

            if (!is_string($sDimension)) {
                $sDimension = null;
                continue;
            }

            preg_match_all('/^(\d+?)x(\d+?)-(scale|crop)$/i', $sDimension, $aMatches);

            if (empty($aMatches[0])) {
                $sDimension = null;
            } else {
                $sDimension = [
                    'width'  => !empty($aMatches[1][0]) ? $aMatches[1][0] : null,
                    'height' => !empty($aMatches[2][0]) ? $aMatches[2][0] : null,
                    'type'   => !empty($aMatches[3][0]) ? $aMatches[3][0] : 'crop',
                ];
            }
        }

        return array_filter($aUrls);
    }
256714
public function load()
    {
        $this->raw = $this->exists() ? (string) file_get_contents($this->filename) : '';
        $this->content = null;

        return $this->raw;
    }
343523
public function activeUrl() {
        $this->check_role = 'activeUrl';
        $result = checkdnsrr($this->value);
        $this->checkResult($result);
        return $this;
    }
677024
public function getRoutesWithCache()
    {
        if ($this->cacheService == null) {
            // Retrieve the split parts
            return $this->getRoutesWithoutCache();
        } else {
            $routes = $this->cacheService->get('splashWordpressRoutes');
            if ($routes == null) {
                // No value in cache, let's get the URL nodes
                $routes = $this->getRoutesWithoutCache();
                $this->cacheService->set('splashWordpressRoutes', $routes);
            }

            return $routes;
        }
    }
772741
public function load()
    {
        $debuggeeId = null;
        $breakpoints = [];

        // Acquire a read lock (non-blocking). If we fail (file is locked
        // for writing), then we return an empty list of breakpoints and
        // skip debugging for this request.
        try {
            $contents = $this->getLock()->synchronize(function () {
                return file_get_contents($this->filename);
            }, [
                'blocking' => false
            ]);
            $data = unserialize($contents);
            $debuggeeId = $data['debuggeeId'];
            $breakpoints = $data['breakpoints'];
        } catch (\RuntimeException $e) {
            // Do nothing
        }
        return [$debuggeeId, $breakpoints];
    }
1173814
public function getSplashActionsList(): array
    {
        $urls = array();

        foreach ($this->routeProviders as $routeProvider) {
            /* @var $routeProvider UrlProviderInterface */
            $tmpUrlList = $routeProvider->getUrlsList(null);
            $urls = array_merge($urls, $tmpUrlList);
        }

        return $urls;
    }
649634
protected function initUrlSegments () {
		$this->portDefined = FALSE;
		$this->port = '';
		$this->path = '';
		$this->query = '';
		$this->fragment = '';

		$uri = $this->GetScheme() . '//'
			. $this->globalServer['HTTP_HOST'];
		if (isset($this->globalServer['UNENCODED_URL'])) {
			$uri .= rawurldecode($this->globalServer['UNENCODED_URL']);
		} else if (isset($this->globalServer['UNENCODED_URL'])) {
			$uri .= rawurldecode($this->globalServer['UNENCODED_URL']);
		} else {
			$uri .= rawurldecode($this->globalServer['REQUEST_URI']);
		}

		$firstColonPos = mb_strpos($uri, ':');
		if ($firstColonPos !== FALSE) 
			$uri = mb_substr($uri, $firstColonPos + 1);
		
		if (mb_substr($uri, 0, 2) === '//') {
			$nextSlashPos = mb_strpos($uri, '/', 2);
			if ($nextSlashPos !== FALSE) {
				$authority = mb_substr($uri, 2, $nextSlashPos - 2);
				$uri = mb_substr($uri, $nextSlashPos);
				$colonsCount = mb_substr_count($authority, ':');
				if ($colonsCount === 1) {
					$colonPos = mb_strpos($authority, ':');
					$this->port = mb_substr($authority, $colonPos + 1);
					if ($this->port !== '') 
						$this->portDefined = TRUE;
				}
			} else {
				return;
			}
		}

		$basePath = $this->GetBasePath();
		$uri = mb_substr($uri, mb_strlen($basePath));
		
		$questionMarkPos = mb_strpos($uri, '?');
		$hashPos = mb_strpos($uri, '#');
		$questionMarkContained = $questionMarkPos !== FALSE;
		$hashContained = $hashPos !== FALSE;
		if (!$questionMarkContained && !$hashContained) {
			// path, no query, no hash
			$this->path = $uri;
		} else if ($questionMarkContained && !$hashContained) {
			// path, query and no hash
			$this->path = mb_substr($uri, 0, $questionMarkPos);
			$this->query = trim(mb_substr($uri, $questionMarkPos + 1), '&');
		} else if (!$questionMarkContained && $hashContained) {
			// path, no query and hash
			$this->path = mb_substr($uri, 0, $hashPos);
			$this->fragment = mb_substr($uri, $hashPos + 1);
		} else if ($questionMarkContained && $hashContained && $questionMarkPos < $hashPos) {
			// path, query and hash
			$this->path = mb_substr($uri, 0, $questionMarkPos);
			$this->query = trim(mb_substr($uri, $questionMarkPos + 1, $questionMarkPos + 1 - $hashPos), '&');
			$this->fragment = mb_substr($uri, $hashPos + 1);
		} else {
			// path, no query and hash containing question mark
			$this->path = mb_substr($uri, 0, $questionMarkPos);
			$this->fragment = mb_substr($uri, $hashPos + 1);
		}
	}
120370
public function getRoutesWithoutCache()
    {
        $urlsList = array();

        foreach ($this->routeProviders as $routeProvider) {
            /* @var $routeProvider UrlProviderInterface */
            $tmpUrlList = $routeProvider->getUrlsList(null);
            $urlsList = array_merge($urlsList, $tmpUrlList);
        }

        $items = array();

        foreach ($urlsList as $urlCallback) {
            /* @var $urlCallback SplashCallback */

            $url = $urlCallback->url;
            // remove trailing slash
            $url = rtrim($url, '/');

            $title = null;
            if ($urlCallback->title !== null) {
                $title = $urlCallback->title;
            }

            //////////////// Let's analyze the URL for parameter ////////////////////
            $trimmedUrl = trim($url, '/');
            $urlParts = explode('/', $trimmedUrl);
            $urlPartsNew = array();
            $parametersList = array();
                        // We will store the number of parameters for a URL
                        $nbParam = 0;

            for ($i = 0; $i < count($urlParts); ++$i) {
                $urlPart = $urlParts[$i];
                if (strpos($urlPart, '{') === 0 && strpos($urlPart, '}') === strlen($urlPart) - 1) {
                    $nbParam += 1;
                    // Parameterized URL element
                    $varName = substr($urlPart, 1, strlen($urlPart) - 2);

                    $parametersList[$varName] = $i;
                    $urlPartsNew[] = '([^/]*?)';
                } else {
                    $urlPartsNew[] = $urlPart;
                }
            }

            // Let's rewrite the URL, but replacing the {var} parameters with a regexp wildcard
            $url = '^'.implode('/', $urlPartsNew).'$';
            ///////////////// End URL analysis ////////////////////

            $httpMethods = $urlCallback->httpMethods;
            if (empty($httpMethods)) {
                $httpMethods['default'] = 'moufpress_execute_action';
            } else {
                foreach ($httpMethods as $httpMethod) {
                    $httpMethods[strtoupper($httpMethod)] = 'moufpress_execute_action';
                }
            }

            foreach ($httpMethods as $httpMethod) {
                $item = array(
                        'path' => $url,

                        'page_callback' => $httpMethods,
                        // First argument passed to execute_action as the instance name, second argument is the method.
                        'page_arguments' => array($urlCallback->controllerInstanceName, $urlCallback->methodName, $parametersList, $urlCallback->parameters, $urlCallback->filters),
                        'access_callback' => true,
                                                 // We store the number of parameters for an item
                                                'nbParam' => $nbParam,
                        //'page arguments' => array(array($httpMethod => array("instance"=>$urlCallback->controllerInstanceName, "method"=>$urlCallback->methodName, "urlParameters"=>$parametersList))),
                );

                if ($title) {
                    $item['title'] = $title;
                }

                $items[] = $item;
            }
        }

                /*
                 * We sort the tableOfURLS with the one with the fewer parameters coming first
                 */
                usort($items, function (array $a, array $b) {
                    return $a['nbParam'] - $b['nbParam'];
                });

        return $items;
    }
387195
public function uris()
    {
        $uri = (string) $this->uri;

        $exists = isset($this->data['permalink']);

        $exists && $uri = $this->data['permalink'];

        $items = explode('/', (string) $uri);

        $items = array_filter((array) $items);

        return (array) array_values($items);
    }
1274790
public function actionLoadBucketData()
    {
        $this->requirePostRequest();
        $this->requireAcceptsJson();

        $request = Craft::$app->getRequest();
        $keyId = Craft::parseEnv($request->getRequiredBodyParam('keyId'));
        $secret = Craft::parseEnv($request->getRequiredBodyParam('secret'));

        try {
            return $this->asJson(Volume::loadBucketList($keyId, $secret));
        } catch (\Throwable $e) {
            return $this->asErrorJson($e->getMessage());
        }
    }