‪TYPO3CMS  9.5
PageAccessFailureReasons.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
23 {
24  // Page resolving issues
25  public const ‪NO_PAGES_FOUND = 'page.database.empty';
26  public const ‪PAGE_NOT_FOUND = 'page';
27  public const ‪PAGE_ALIAS_NOT_FOUND = 'page.alias';
28  public const ‪ROOTLINE_BROKEN = 'page.rootline';
29 
30  // Page configuration issues
31  public const ‪RENDERING_INSTRUCTIONS_NOT_FOUND = 'rendering_instructions';
32  public const ‪RENDERING_INSTRUCTIONS_NOT_CONFIGURED = 'rendering_instructions.type';
33 
34  // Validation errors
35  public const ‪CACHEHASH_COMPARISON_FAILED = 'cache_hash.comparison';
36  public const ‪CACHEHASH_EMPTY = 'cache_hash.empty';
37 
38  // Language-related issues
39  public const ‪LANGUAGE_NOT_AVAILABLE = 'language';
40  public const ‪LANGUAGE_NOT_AVAILABLE_STRICT_MODE = 'language.strict';
41  public const ‪LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE = 'language.fallbacks';
42  public const ‪LANGUAGE_DEFAULT_NOT_AVAILABLE = 'language.default';
43 
44  // Access restrictions
45  public const ‪ACCESS_DENIED_GENERAL = 'access';
46  public const ‪ACCESS_DENIED_PAGE_NOT_RESOLVED = 'access.page';
47  public const ‪ACCESS_DENIED_SUBSECTION_NOT_RESOLVED = 'access.subsection';
48  public const ‪ACCESS_DENIED_HOST_PAGE_MISMATCH = 'access.host_mismatch';
49  public const ‪ACCESS_DENIED_INVALID_PAGETYPE = 'access.pagetype';
50 
51  // System errors
52  public const ‪DATABASE_CONNECTION_FAILED = 'system.database';
53 
59  protected ‪$messages = [
60  self::NO_PAGES_FOUND => 'No page on rootlevel found',
61  self::PAGE_NOT_FOUND => 'The requested page does not exist',
62  self::PAGE_ALIAS_NOT_FOUND => 'The requested page alias does not exist',
63 
64  self::RENDERING_INSTRUCTIONS_NOT_FOUND => 'No TypoScript template found',
65  self::RENDERING_INSTRUCTIONS_NOT_CONFIGURED => 'The page is not configured',
66 
67  self::CACHEHASH_COMPARISON_FAILED => 'Request parameters could not be validated (&cHash comparison failed)',
68  self::CACHEHASH_EMPTY => 'Request parameters could not be validated (&cHash empty)',
69 
70  self::LANGUAGE_NOT_AVAILABLE => 'Page is not available in the requested language',
71  self::LANGUAGE_NOT_AVAILABLE_STRICT_MODE => 'Page is not available in the requested language (strict)',
72  self::LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE => 'Page is not available in the requested language (fallbacks did not apply)',
73  self::LANGUAGE_DEFAULT_NOT_AVAILABLE => 'Page is not available in default language',
74 
75  self::ACCESS_DENIED_GENERAL => 'The requested page was not accessible',
76  self::ACCESS_DENIED_PAGE_NOT_RESOLVED => 'ID was not an accessible page',
77  self::ACCESS_DENIED_SUBSECTION_NOT_RESOLVED => 'Subsection was found and not accessible',
78  self::ACCESS_DENIED_HOST_PAGE_MISMATCH => 'ID was outside the domain',
79  self::ACCESS_DENIED_INVALID_PAGETYPE => 'The requested page type cannot be rendered',
80 
81  self::DATABASE_CONNECTION_FAILED => 'Database Connection failed',
82  self::ROOTLINE_BROKEN => 'The requested page did not have a proper connection to the tree-root'
83  ];
84 
89  public function ‪getMessageForReason(string $reasonCode): string
90  {
91  if (!isset($this->messages[$reasonCode])) {
92  throw new \InvalidArgumentException('No message for page access reason code "' . $reasonCode . '" found.', 1529299833);
93  }
94  return $this->messages[$reasonCode];
95  }
96 }
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE
‪const LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:41
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\CACHEHASH_EMPTY
‪const CACHEHASH_EMPTY
Definition: PageAccessFailureReasons.php:36
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_INVALID_PAGETYPE
‪const ACCESS_DENIED_INVALID_PAGETYPE
Definition: PageAccessFailureReasons.php:49
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_GENERAL
‪const ACCESS_DENIED_GENERAL
Definition: PageAccessFailureReasons.php:45
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\$messages
‪string[] $messages
Definition: PageAccessFailureReasons.php:58
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_HOST_PAGE_MISMATCH
‪const ACCESS_DENIED_HOST_PAGE_MISMATCH
Definition: PageAccessFailureReasons.php:48
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_PAGE_NOT_RESOLVED
‪const ACCESS_DENIED_PAGE_NOT_RESOLVED
Definition: PageAccessFailureReasons.php:46
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_DEFAULT_NOT_AVAILABLE
‪const LANGUAGE_DEFAULT_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:42
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_NOT_AVAILABLE
‪const LANGUAGE_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:39
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\PAGE_NOT_FOUND
‪const PAGE_NOT_FOUND
Definition: PageAccessFailureReasons.php:26
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_CONFIGURED
‪const RENDERING_INSTRUCTIONS_NOT_CONFIGURED
Definition: PageAccessFailureReasons.php:32
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_SUBSECTION_NOT_RESOLVED
‪const ACCESS_DENIED_SUBSECTION_NOT_RESOLVED
Definition: PageAccessFailureReasons.php:47
‪TYPO3\CMS\Frontend\Page
Definition: CacheHashCalculator.php:2
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\NO_PAGES_FOUND
‪const NO_PAGES_FOUND
Definition: PageAccessFailureReasons.php:25
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_NOT_AVAILABLE_STRICT_MODE
‪const LANGUAGE_NOT_AVAILABLE_STRICT_MODE
Definition: PageAccessFailureReasons.php:40
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\CACHEHASH_COMPARISON_FAILED
‪const CACHEHASH_COMPARISON_FAILED
Definition: PageAccessFailureReasons.php:35
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\PAGE_ALIAS_NOT_FOUND
‪const PAGE_ALIAS_NOT_FOUND
Definition: PageAccessFailureReasons.php:27
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\getMessageForReason
‪string getMessageForReason(string $reasonCode)
Definition: PageAccessFailureReasons.php:88
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons
Definition: PageAccessFailureReasons.php:23
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ROOTLINE_BROKEN
‪const ROOTLINE_BROKEN
Definition: PageAccessFailureReasons.php:28
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\DATABASE_CONNECTION_FAILED
‪const DATABASE_CONNECTION_FAILED
Definition: PageAccessFailureReasons.php:52
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_FOUND
‪const RENDERING_INSTRUCTIONS_NOT_FOUND
Definition: PageAccessFailureReasons.php:31