Resolver
in package
Takes an URL and tries to find the Page.
Tags
Table of Contents
Properties
- $additionalPath : string
- Passed path after the resolved page's path
- $aliaspage : Page
- Aliaspage if we resolve an alias
- $command : string
- Contains the resolved module command (if any, empty string if none)
- $em : mixed
- $fallbackLanguages : array<string|int, mixed>
- Maps language ids to fallback language ids.
- $forceInternalRedirection : mixed
- $headers : array<string|int, mixed>
- List of headers set by resolver
- $historyId : int
- Contains the history id to revert the page to an older version.
- $isPreviewPageRequested : bool
- Will be set to `true` by {@see static::resolvePage()} if the current request is on a page preview from Content Manager.
- $isRedirection : bool
- Remembers if we've come across a redirection while resolving the URL.
- $lang : int
- language id.
- $logRepo : mixed
- $nodeRepo : mixed
- Doctrine NodeRepository
- $originalUrl : Url
- $page : Page
- the page we found.
- $pagePreview : bool
- Remembers if it's a page preview.
- $pageRepo : mixed
- Doctrine Cx\Core\ContentManager\Model\Repository\PageRepository
- $path : mixed
- $pathOffset : mixed
- $previewPage : Page
- Will be set to the preview page from the Content Manager.
- $resolveStack : array<string|int, mixed>
- List of pages that have been resolved
- $section : string
- Contains the resolved module name (if any, empty string if none)
- $sessionPage : array<string|int, mixed>
- Holds the data of the page to preview from the Content Manager
- $url : mixed
- $urlPage : Page
Methods
- __construct() : mixed
- checkPageFrontendProtection() : mixed
- Checks if this page can be displayed in frontend, redirects to login of not
- getAdditionalPath() : string
- Returns the passed path additional to the resolved page's path
- getCmd() : string
- Returns the resolved module command (if any, empty string if none)
- getFallbackPage() : mixed
- getHeaders() : array<string|int, mixed>
- Returns the headers set by this class
- getPage() : mixed
- getPreviewPage() : Page
- Returns the preview page built from the session page array.
- getSection() : string
- Returns the resolved module name (if any, empty string if none)
- getURL() : mixed
- handleFallbackContent() : mixed
- Checks whether $page is of type 'fallback'. Loads fallback content if yes.
- init() : mixed
- isPreviewPageRequested() : bool
- Check if the preview page has been requested.
- legacyResolve() : mixed
- redirectToCorrectLanguageDir() : mixed
- resolve() : mixed
- resolveAlias() : Page
- Checks for alias request
- resolvePage() : mixed
- Does the resolving work, extends $this->url with targetPath and params.
- setSection() : mixed
- Sets the value of the resolved module name and command This should not be called from any (core_)module! For legacy requests only!
- resolveToErrorPage() : Page
- Resolve the current request the Error application page
Properties
$additionalPath
Passed path after the resolved page's path
protected
string
$additionalPath
= ''
$aliaspage
Aliaspage if we resolve an alias
protected
Page
$aliaspage
= null
$command
Contains the resolved module command (if any, empty string if none)
protected
string
$command
= ''
$em
protected
mixed
$em
= null
$fallbackLanguages
Maps language ids to fallback language ids.
protected
array<string|int, mixed>
$fallbackLanguages
= null
($languageId => $fallbackLanguageId)
$forceInternalRedirection
protected
mixed
$forceInternalRedirection
$headers
List of headers set by resolver
protected
array<string|int, mixed>
$headers
= array()
$historyId
Contains the history id to revert the page to an older version.
protected
int
$historyId
= 0
$isPreviewPageRequested
Will be set to `true` by {@see static::resolvePage()} if the current request is on a page preview from Content Manager.
protected
bool
$isPreviewPageRequested
= false
$isRedirection
Remembers if we've come across a redirection while resolving the URL.
protected
bool
$isRedirection
= false
This allow to properly redirect.
$lang
language id.
protected
int
$lang
= null
$logRepo
protected
mixed
$logRepo
$nodeRepo
Doctrine NodeRepository
protected
mixed
$nodeRepo
= null
$originalUrl
protected
Url
$originalUrl
= null
$page
the page we found.
protected
Page
$page
= null
$pagePreview
Remembers if it's a page preview.
protected
bool
$pagePreview
= false
$pageRepo
Doctrine Cx\Core\ContentManager\Model\Repository\PageRepository
protected
mixed
$pageRepo
= null
$path
protected
mixed
$path
$pathOffset
protected
mixed
$pathOffset
$previewPage
Will be set to the preview page from the Content Manager.
protected
Page
$previewPage
= null
$resolveStack
List of pages that have been resolved
protected
array<string|int, mixed>
$resolveStack
= array()
This is used to detect infinite internal redirection loops
$section
Contains the resolved module name (if any, empty string if none)
protected
string
$section
= ''
$sessionPage
Holds the data of the page to preview from the Content Manager
protected
array<string|int, mixed>
$sessionPage
= array()
$url
protected
mixed
$url
= null
$urlPage
protected
Page
$urlPage
= null
Methods
__construct()
public
__construct(Url $url, int $lang, mixed $entityManager, string $pathOffset, array<string|int, mixed> $fallbackLanguages[, bool $forceInternalRedirection = false ]) : mixed
Parameters
- $url : Url
-
the url to resolve
- $lang : int
-
the language Id
- $entityManager : mixed
- $pathOffset : string
-
ASCMS_PATH_OFFSET
- $fallbackLanguages : array<string|int, mixed>
-
(languageId => fallbackLanguageId)
- $forceInternalRedirection : bool = false
-
does not redirect for internal redirections if set to true. this is used mainly for testing currently. IMPORTANT: Do insert new parameters before this one if you need to and correct the tests.
checkPageFrontendProtection()
Checks if this page can be displayed in frontend, redirects to login of not
public
checkPageFrontendProtection(Page $page[, int $history = 0 ]) : mixed
Parameters
- $page : Page
-
Page to check
- $history : int = 0
-
(optional) Revision of page to use, 0 means current, default 0
getAdditionalPath()
Returns the passed path additional to the resolved page's path
public
getAdditionalPath() : string
Return values
string —Offset path without leading slash
getCmd()
Returns the resolved module command (if any, empty string if none)
public
getCmd() : string
Return values
string —Module command
getFallbackPage()
public
getFallbackPage(mixed $page) : mixed
Parameters
- $page : mixed
getHeaders()
Returns the headers set by this class
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —key=>value style array
getPage()
public
getPage() : mixed
getPreviewPage()
Returns the preview page built from the session page array.
public
getPreviewPage([bool $init = true ]) : Page
Parameters
- $init : bool = true
-
If set to
true
, then the preview page will be initialized.
Tags
Return values
Page —$page
getSection()
Returns the resolved module name (if any, empty string if none)
public
getSection() : string
Return values
string —Module name
getURL()
public
getURL() : mixed
handleFallbackContent()
Checks whether $page is of type 'fallback'. Loads fallback content if yes.
public
handleFallbackContent(Doctrine $page[, bool $requestedPage = true ]) : mixed
Parameters
- $page : Doctrine
- $requestedPage : bool = true
-
Set to TRUE (default) if the $page passed by $page is the first resolved page (actual requested page)
Tags
init()
public
init(Url $url, int $lang, mixed $entityManager, string $pathOffset, array<string|int, mixed> $fallbackLanguages[, bool $forceInternalRedirection = false ]) : mixed
Parameters
- $url : Url
-
the url to resolve
- $lang : int
-
the language Id
- $entityManager : mixed
- $pathOffset : string
-
ASCMS_PATH_OFFSET
- $fallbackLanguages : array<string|int, mixed>
-
(languageId => fallbackLanguageId)
- $forceInternalRedirection : bool = false
-
does not redirect for internal redirections if set to true. this is used mainly for testing currently. IMPORTANT: Do insert new parameters before this one if you need to and correct the tests.
isPreviewPageRequested()
Check if the preview page has been requested.
public
isPreviewPageRequested() : bool
Return values
bool —Whether the current request is made to the preview page of the Content Manager.
legacyResolve()
public
legacyResolve(mixed $url, mixed $section, mixed $command) : mixed
Parameters
- $url : mixed
- $section : mixed
- $command : mixed
redirectToCorrectLanguageDir()
public
redirectToCorrectLanguageDir() : mixed
resolve()
public
resolve() : mixed
resolveAlias()
Checks for alias request
public
resolveAlias() : Page
Return values
Page —or null
resolvePage()
Does the resolving work, extends $this->url with targetPath and params.
public
resolvePage([mixed $internal = false ]) : mixed
Parameters
- $internal : mixed = false
setSection()
Sets the value of the resolved module name and command This should not be called from any (core_)module! For legacy requests only!
public
setSection(string $section[, mixed $command = '' ]) : mixed
Parameters
- $section : string
-
Module name
- $command : mixed = ''
Tags
resolveToErrorPage()
Resolve the current request the Error application page
protected
resolveToErrorPage() : Page
In case there does not exists a published application page of component Error, then an InstanceException with HTTP status code 502 Bad Gateway is thrown.
Tags
Return values
Page —The resolved Error application page