Pobiera opublikowaną kategorię po uri
@param string $uri
@return \Cms\Orm\CmsCategoryRecord
@throws \Mmi\Mvc\MvcNotFoundException
553585
protected function _getPublishedCategoryByUri($uri)
    {
        //inicjalizacja zmiennej
        $category = null;
        //próba mapowania uri na ID kategorii z cache
        if (null === $categoryId = \App\Registry::$cache->load($cacheKey = 'category-id-' . md5($uri))) {
            //próba pobrania kategorii po URI
            if (null === $category = (new Orm\CmsCategoryQuery)->getCategoryByUri($uri)) {
                //zapis informacji o braku kategorii w cache
                \App\Registry::$cache->save('-1', $cacheKey, 0);
                //301 (o ile możliwe) lub 404
                $this->_redirectOrNotFound($uri);
            }
            //id kategorii
            $categoryId = $category->id;
            //zapis id kategorii i kategorii w cache 
            \App\Registry::$cache->save($categoryId, $cacheKey, 0) && \App\Registry::$cache->save($category, 'category-' . $categoryId, 0);
        }
        //w buforze jest informacja o braku strony
        if ($categoryId == -1) {
            //301 (o ile możliwe) lub 404
            $this->_redirectOrNotFound($uri);
        }
        //kategoria
        if ($category) {
            return $this->_checkCategory($category);
        }
        //pobranie kategorii z bufora
        if (null === $category = \App\Registry::$cache->load($cacheKey = 'category-' . $categoryId)) {
            //zapis pobranej kategorii w cache
            \App\Registry::$cache->save($category = (new Orm\CmsCategoryQuery)->withType()->findPk($categoryId), $cacheKey, 0);
        }
        //sprawdzanie kategorii
        return $this->_checkCategory($category);
    }
920000
public static function parse(string $uri): URI
    {
        if ($uri == '') {
            return new static();
        }

        $parts = parse_url($uri);
        if ($parts === false) {
            throw new \InvalidArgumentException(sprintf('Cannot parse malformed uri "%s".', $uri));
        }

        if (!isset($parts['scheme'])) {
            throw new \InvalidArgumentException(sprintf('Missing scheme in uri "%s".', $uri));
        }

        if (count($parts) == 1 && isset($parts['scheme'])) {
            throw new \InvalidArgumentException(sprintf('Missing hierarchical segment in uri "%s".', $uri));
        }

        $defaults = [
            'scheme' => '',
            'host' => '',
            'user' => '',
            'pass' => '',
            'port' => null,
            'path' => '',
            'query' => '',
            'fragment' => '',
        ];

        $parts = array_merge($defaults, $parts);

        return new static(
            $parts['scheme'],
            $parts['host'],
            $parts['path'],
            $parts['query'],
            $parts['fragment'],
            $parts['user'],
            $parts['pass'],
            $parts['port']
        );
    }
760446
public function &findPageByUri($uri)
    {
        foreach ($this->getPages() as $page) {
            if ($page->getUrl() == $uri) {
                return $page;
            }
        }

        foreach ($this->getSections() as $section) {
            $found = $section->findPageByUri($uri);
            if (! is_null($found)) {
                return $found;
            }
        }

        return;
    }
1319519
protected function addPrefixToUri($uri)
    {
        if (! isset($this->prefix)) {
            return $uri;
        }

        $uri = trim($uri, '/');

        if (starts_with($uri, $this->prefix)) {
            return $uri;
        }

        return rtrim('/'.trim($this->prefix, '/').'/'.$uri, '/');
    }
944360
public function setUri( $uri )
    {
        $uri = (string) $uri;

        if ( empty( $uri ) )
        {
            $uri = '#';
        }
        else if ( ! preg_match( '(^(' . static::VALID_SCHEMES . '))', $uri ) )
        {
            if ( preg_match( '(^[a-z0-9-]+(\.[a-z0-9-]+)+(/.*)?$)', $uri ) )
            {
                $uri = static::DEFAULT_SCHEME . $uri;
            }
            else
            {
                $uri = '/' . ltrim( $uri, '/' );
            }
        }

        $this->uri = $uri;
        return $this;
    }
1188939
protected function getActualUri( $uri )
	{
		foreach ( $this->rewriteURIs as $prefix => $rewriteUri )
		{
			if ( strpos( $uri, $prefix ) !== 0 ) continue;
			$actualUri =  str_replace( $prefix, $rewriteUri, $uri );
			$actualUri = XBRL::normalizePath( $this->getFirstFolderName() . "/" . XBRL_TaxonomyPackage::metaFolderName . "/" . $actualUri );
			return $actualUri;
		}

		return $uri;
	}
308528
public static function createFromString($uri)
    {
        if (!is_string($uri) && !method_exists($uri, '__toString')) {
            throw new InvalidArgumentException('Uri must be a string');
        }

        return self::createFromParse(parse_url($uri));
    }
469516
public function exportFileMetaAction()
    {
        //wyszukiwanie pliku
        if (null === $files = (new Orm\CmsFileQuery)->whereName()->equals($this->name)
            ->find()) {
            throw new \Mmi\Mvc\MvcNotFoundException('File not found');
        }
        $data = [];
        //iteracja po plikach
        foreach ($files as $file) {
            //spłaszczenie meta-danych
            $file->data = ($file->data && ($file->data instanceof \Mmi\DataObject)) ? json_encode($file->data->toArray()) : null;
            $data[] = $file->toArray();
        }
        //zwrot meta
        return json_encode($data);
    }
69163
public static function get($uri)
	{
		return self::where('uri','=',$uri)
			->where('status','=',Page::APPROVED)
			->where('published_date','<=',\Carbon\Carbon::now())
			->first();
	}
813461
private function getMedia($mediaId)
    {
        $page = $this->getDoctrine()
                ->getRepository('FulgurioLightCMSBundle:Media')
                ->findOneBy(array('id' => $mediaId));
        if ($page)
        {
            return $page;
        }
        throw new NotFoundHttpException(
            $this->get('translator')->trans('fulgurio.lightcms.medias.not_found', array(), 'admin')
        );
    }
666785
public function get(string $uri): Description
    {
        if (!$uri) {
            throw new \InvalidArgumentException("No document URI provided");
        }
        if ($this->basePath) {
            $uri = "$this->basePath/$uri";
        }
        if (!isset($this->specifications[$uri])) {
            $this->specifications[$uri] = $this->load($uri);
        }

        return $this->specifications[$uri];
    }
551428
public function get(string $uri)
    {
        $request = $this->getRequest($uri);

        return $this->send($request);
    }
1348992
static public function getRoute($uri = null)
    {
        $routes = self::$instance->routes;
        if($uri === null) {
            foreach($routes as $i => $route) {
                $routes[$i] = \array_diff_key($routes[$i], [3 => "xy", 4 => "xy", 5 => "xy", 6 => "xy", 7 => "xy", 8 => "xy"]);
                if( !is_string($routes[$i][2]) && is_object($routes[$i][2]) && is_callable($routes[$i][2]) && $routes[$i][2] instanceof \Closure) {
                    $routes[$i][2] = "Closure";
                }
            }
            return $routes;
        }
        else {
            foreach($routes as $i => $route) {
                if($route[1] === "/".ltrim($uri,"/")) {
                    return $route;
                }
            }
        }
    }
308324
public function getResourceByUri($uri)
    {
        // get rid of everything after the ?
        $uri = \strtok($uri, '?');

        $resources = $this->getResourcesAsArray($this->resources);
        foreach ($resources as $resource) {
            \assert($resource instanceof Resource);
            if ($resource->matchesUri($uri)) {
                return $resource;
            }
        }

        throw new ResourceNotFoundException($uri);
    }
682560
public function createRelative($uri = null)
    {
        if (empty($uri)) {
            // Empty uri means baseurl
            return $this->baseUrl;
        } elseif (substr($uri, 0, 7) == "http://"
            || substr($uri, 0, 8) == "https://"
            || substr($uri, 0, 2) == "//"
        ) {
            // Fully qualified, just leave as is.
            return rtrim($uri, '/');
        } elseif ($uri[0] == '/') {
            // Absolute url, prepend with siteUrl
            return rtrim($this->siteUrl . rtrim($uri, '/'), '/');
        }

        $uri = rtrim($uri, '/');
        return $this->baseUrl . '/' . $uri;
    }
1311594
private function getPathFromUri($uri)
    {
        $uriParser = new UriParser($uri);
        // Prepare uri
        $uriParser->encode();
        $uri = $uriParser->stripFragment();
        if (strpos($uri, '/') === 0) {
            // URI is already an path
            return $uri;
        }
        if (!$uriParser->validate()) {
            throw new \InvalidArgumentException('Invalid URI');
        }
        $path = (($path = parse_url($uri, PHP_URL_PATH)) === null) ? '/' : $path;
        $query = (($query = parse_url($uri, PHP_URL_QUERY)) === null) ? '' : '?' . $query;
        return $path . $query;
    }
83231
public function getSubMenu($uri, $all = false)
    {
        $rootUriArray = explode('/', $uri);
        $uri = $rootUriArray[0];
        if (in_array($uri, locales())) {
            if (isset($rootUriArray[1])) {
                $uri .= '/'.$rootUriArray[1]; // add next part of uri in locale
            }
        }

        $repository = Pages::where(column('uri'), '!=', $uri);

        if (!$all) {
            $repository->where(column('status'), '1');
        }

        $models = $repository->orderBy('position', 'asc')
            ->findWhere([column('uri'), 'LIKE', '\"'.$uri.'%'])
            ->noCleaning()
            ->nest();

        return $models;
    }