Prepare's the URL rewrites that has to be created/updated.

@return void
548162
protected function prepareUrlRewrites()
    {

        // (re-)initialize the array for the URL rewrites and the product category IDs
        $this->urlRewrites = array();
        $this->productCategoryIds = array();

        // load the root category, because we need that to create the default product URL rewrite
        $rootCategory = $this->getRootCategory();

        // at least, add the root category ID to the category => product relations
        $this->productCategoryIds[] = $rootCategory[MemberNames::ENTITY_ID];

        $storeViewCode = $this->getValue(ColumnKeys::STORE_VIEW_CODE);

        // append the category => product relations found
        foreach ($this->getValue(ColumnKeys::CATEGORIES, array(), array($this, 'explode')) as $path) {
            try {
                // try to load the category for the given path
                $category = $this->getCategoryByPath(trim($path), $storeViewCode);
                // resolve the product's categories recursively
                $this->resolveCategoryIds($category[MemberNames::ENTITY_ID], true, $storeViewCode);
            } catch (\Exception $e) {
                // query whether or not debug mode has been enabled
                if ($this->getSubject()->isDebugMode()) {
                    $this->getSubject()
                         ->getSystemLogger()
                         ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
                } else {
                    throw $e;
                }
            }
        }

        // prepare the URL rewrites
        foreach ($this->productCategoryIds as $categoryId) {
            // set the category ID
            $this->categoryId = $categoryId;

            // prepare the attributes for each URL rewrite
            $this->urlRewrites[$categoryId] = $this->prepareAttributes($storeViewCode);
        }
    }
22940
public function updateUrl()
    {
        $this->url = '';
        $this->generateCompleteUrl($this);
        $this->url = $this->prefixPath . $this->url;

        if (strlen($this->slug) > 1) {
            $this->url .= "/{$this->slug}";
        }

        return $this;
    }
436474
public function prepareResponse(): void
    {
        // change default HTTP status code
        $this->response->setStatusCode(200);

        // clear default response headers
        $this->response->resetHeaders();

        // add your response headers
        $this->response->setCharset('UTF-8');
        $this->response->setContentType('text/html');
        $this->response->addHeader(
            'X-Some-Header-Example-Name: headerValueExample'
        ); // add some other headers by this example

        // call here your controller to get real response body
        $body = 'This is an example generated in Route <i>' . get_class($this) . '</i> with a fictive Controller.';

        // set body to response as response body
        $this->response->setBody($body);
    }
1022884
protected function prepare()
    {
        //Force passice mode if not specified
        $this->addOption('passive', true);

        //To make call on different files, we must retrieve the root and apply commands to the path
        $tmp = clone $this->getUrl();
        $tmp->path('');
        $this->addOption('url', $tmp->toString());
    }
924924
private function setUrl() {

		$this -> url = Router :: url($this -> identifier, $this -> params, $this -> domain);

		$url = new URLParser($this -> url);

		if(null === $url -> getScheme() && strlen($this -> url) > 0) {
			$this -> url = '/' . $this -> url;
		}
	}
448248
protected function prepareRequest()
    {
        $this->formatUrl();
        $this->validateInput();
        $this->addHeaders();
        $this->addRequestBody();
        $this->initOptions();
    }
678101
private function prepareRouterData()
    {
        $routers = [];
        $reverse = [];
        $path = Application::getInstance()->getPath() . '/modules/*/controllers/*.php';
        foreach (new \GlobIterator($path) as $file) {
            /* @var \SplFileInfo $file */
            $module = $file->getPathInfo()->getPathInfo()->getBasename();
            $controller = $file->getBasename('.php');
            $controllerInstance = new Controller($module, $controller);
            $meta = $controllerInstance->getMeta();
            if ($routes = $meta->getRoute()) {
                foreach ($routes as $route => $pattern) {
                    if (!isset($reverse[$module])) {
                        $reverse[$module] = [];
                    }

                    $reverse[$module][$controller] = ['route' => $route, 'params' => $meta->getParams()];

                    $rule = [
                        $route => [
                            'pattern' => $pattern,
                            'module' => $module,
                            'controller' => $controller,
                            'params' => $meta->getParams()
                        ]
                    ];

                    // static routers should be first, than routes with variables `$...`
                    // all routes begin with slash `/`
                    if (strpos($route, '$')) {
                        $routers[] = $rule;
                    } else {
                        array_unshift($routers, $rule);
                    }
                }
            }
        }
        $routers = array_merge(...$routers);
        return [$routers, $reverse];
    }
1250523
public function routeHttp()
    {
        if ($this->config->isInitialized() || $this->url->isInstall()) {
            $this->route->process();
        } else {
            $this->url->redirect('install');
        }
    }
1046307
private function prepareURL() {
        $this->url = $_SERVER['REQUEST_URI'];
        $this->rootUrl = false;

        if($this->url == '/api/auth' || $this->url == '/api/auth/' )
            $this->login = true;

        if($this->url == '/api/auth/reset-password' || $this->url == '/api/auth/reset-password/' )
            $this->resetPassword = true;

        $this->urlApi = str_replace('/api', '', $this->url);

        if(strpos($this->url, '?')) 
            strstr($this->url, '?', true);

        if(strpos($this->url, 'api/') !== false)
            $strSearch = 'api/';
        else {
            if (strpos($this->url, 'api') !== false)
                $strSearch = 'api';
            else
                $this->rootUrl = true;
        }

        if($this->login || $this->resetPassword) return;
        if(empty($strSearch)) return;

        $tokens2 = explode($strSearch, $this->url);

        if($tokens2[1] != '') {
            $tokens = explode("/", $tokens2[1]);
            switch(count($tokens)) {
                case 1:
                    $this->model = ucwords(strtolower($tokens[0]));
                    break;
                case 2:
                    $this->model = ucwords(strtolower($tokens[0]));
                    $this->requiredParameter = $tokens[1];
                    break;
                case 3:
                    $this->relationalModel = ucwords(strtolower($tokens[0]));
                    $this->relationalParameter = $tokens[1];
                    $this->model = ucwords(strtolower($tokens[2]));
                    break;
                default:
                    $this->relationalModel = ucwords(strtolower($tokens[0]));
                    $this->relationalParameter = $tokens[1];
                    $this->model = ucwords(strtolower($tokens[2]));
                    $this->requiredParameter = $tokens[3];
                    break;
            }
        } else
            $this->rootUrl = true;
    }
157079
protected function prepareAttributes()
    {

        // load the store ID to use
        $storeId = $this->getRowStoreId();

        // initialize the values
        $entityId = $this->getSubject()->getLastEntityId();
        $requestPath = $this->prepareRequestPath();
        $targetPath = $this->prepareTargetPath();

        // return the prepared URL rewrite
        return $this->initializeEntity(
            array(
                MemberNames::ENTITY_TYPE      => UrlRewriteObserver::ENTITY_TYPE,
                MemberNames::ENTITY_ID        => $entityId,
                MemberNames::REQUEST_PATH     => $requestPath,
                MemberNames::TARGET_PATH      => $targetPath,
                MemberNames::REDIRECT_TYPE    => 0,
                MemberNames::STORE_ID         => $storeId,
                MemberNames::DESCRIPTION      => null,
                MemberNames::IS_AUTOGENERATED => 1,
                MemberNames::METADATA         => null
            )
        );
    }
98263
protected function register_rewrite_tags() {
		if ( ! empty( $this->rewrite_tag ) ) {
			foreach ( $this->rewrite_tag as $param => $value ) {
				\add_rewrite_tag( $param, $value );
			}
		}
	}
523747
protected function prepareHeaders()
    {
        if (!isset($this->headers['Content-Length'])) {

            $content_length = strlen($this->data);

            if ($content_length > 0 || $this->method === 'POST' || $this->method === 'PUT') {
                $this->headers['Content-Length'] = $content_length;
            }
        }

        if (isset($this->uri['user']) && !isset($this->headers['Authorization'])) {
            $pass = isset($this->uri['pass']) ? ':' . $this->uri['pass'] : ':';
            $this->headers['Authorization'] = 'Basic ' . base64_encode($this->uri['user'] . $pass);
        }
    }
594640
protected function prepareRequestUri()
    {
        $requestUri = '';

        if ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) {
            // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem)
            $requestUri = $this->server->get('UNENCODED_URL');
            $this->server->remove('UNENCODED_URL');
            $this->server->remove('IIS_WasUrlRewritten');
        } elseif ($this->server->has('REQUEST_URI')) {
            $requestUri = $this->server->get('REQUEST_URI');

            if ('' !== $requestUri && '/' === $requestUri[0]) {
                // To only use path and query remove the fragment.
                if (false !== $pos = strpos($requestUri, '#')) {
                    $requestUri = substr($requestUri, 0, $pos);
                }
            } else {
                // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path,
                // only use URL path.
                $uriComponents = parse_url($requestUri);

                if (isset($uriComponents['path'])) {
                    $requestUri = $uriComponents['path'];
                }

                if (isset($uriComponents['query'])) {
                    $requestUri .= '?'.$uriComponents['query'];
                }
            }
        } elseif ($this->server->has('ORIG_PATH_INFO')) {
            // IIS 5.0, PHP as CGI
            $requestUri = $this->server->get('ORIG_PATH_INFO');
            if ('' != $this->server->get('QUERY_STRING')) {
                $requestUri .= '?'.$this->server->get('QUERY_STRING');
            }
            $this->server->remove('ORIG_PATH_INFO');
        }

        // normalize the request URI to ease creating sub-requests from this request
        $this->server->set('REQUEST_URI', $requestUri);

        return $requestUri;
    }
279513
public function prepareList()
    {
        $this->setRequestParameters();

        $this->setPerPage();

        $this->setCurrentPage();

        $this->setTotalCount();

        $this->setPagination();

        $this->setQueryOrder();

        $this->setQueryOffset();

        $this->setResultRows();

        $this->setFinalParameters();
    }
894442
public function flush_rewrite_rules() {

		// Only run $wp_rewrite->flush_rules() in an admin context.
		if ( ! is_admin() ) {
			return;
		}

		$flush = (int) pods_transient_get( 'pods_flush_rewrites' );

		if ( 1 === $flush ) {
			/**
			 * @var $wp_rewrite WP_Rewrite
			 */
			global $wp_rewrite;
			$wp_rewrite->flush_rules();
			$wp_rewrite->init();

			pods_transient_set( 'pods_flush_rewrites', 0 );
		}
	}
759936
protected function register_rewrite_rules() {
		if ( ! empty( $this->rewrite_rule ) ) {
			foreach ( $this->rewrite_rule as $value ) {
				\add_rewrite_rule( $value['regex'], $value['replace'], $value['type'] );
			}
		}
	}
438605
protected function prepareRequestPath()
    {

        // load the category URL suffix to use
        $urlSuffix = $this->getSubject()->getCoreConfigData(CoreConfigDataKeys::CATALOG_SEO_CATEGORY_URL_SUFFIX, '.html');

        // prepare and return the category URL
        return sprintf('%s%s', $this->getValue(ColumnKeys::URL_PATH), $urlSuffix);
    }