‪TYPO3CMS  10.4
PageAccessFailureReasons.php
Go to the documentation of this file.
1 <?php
2 
3 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 
19 
25 {
26  // Page resolving issues
27  public const ‪NO_PAGES_FOUND = 'page.database.empty';
28  public const ‪PAGE_NOT_FOUND = 'page';
29  public const ‪ROOTLINE_BROKEN = 'page.rootline';
30 
31  // Page configuration issues
32  public const ‪RENDERING_INSTRUCTIONS_NOT_FOUND = 'rendering_instructions';
33  public const ‪RENDERING_INSTRUCTIONS_NOT_CONFIGURED = 'rendering_instructions.type';
34 
35  // Validation errors
36  public const ‪INVALID_PAGE_ARGUMENTS = 'page.invalid_arguments';
37  public const ‪CACHEHASH_COMPARISON_FAILED = 'cache_hash.comparison';
38  public const ‪CACHEHASH_EMPTY = 'cache_hash.empty';
39 
40  // Language-related issues
41  public const ‪LANGUAGE_NOT_AVAILABLE = 'language';
42  public const ‪LANGUAGE_NOT_AVAILABLE_STRICT_MODE = 'language.strict';
43  public const ‪LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE = 'language.fallbacks';
44  public const ‪LANGUAGE_DEFAULT_NOT_AVAILABLE = 'language.default';
45 
46  // Access restrictions
47  public const ‪ACCESS_DENIED_GENERAL = 'access';
48  public const ‪ACCESS_DENIED_PAGE_NOT_RESOLVED = 'access.page';
49  public const ‪ACCESS_DENIED_SUBSECTION_NOT_RESOLVED = 'access.subsection';
50  public const ‪ACCESS_DENIED_HOST_PAGE_MISMATCH = 'access.host_mismatch';
51  public const ‪ACCESS_DENIED_INVALID_PAGETYPE = 'access.pagetype';
52 
53  // System errors
54  public const ‪DATABASE_CONNECTION_FAILED = 'system.database';
55 
61  protected ‪$messages = [
62  self::NO_PAGES_FOUND => 'No page on rootlevel found',
63  self::PAGE_NOT_FOUND => 'The requested page does not exist',
64 
65  self::RENDERING_INSTRUCTIONS_NOT_FOUND => 'No TypoScript template found',
66  self::RENDERING_INSTRUCTIONS_NOT_CONFIGURED => 'The page is not configured',
67 
68  self::INVALID_PAGE_ARGUMENTS => 'Page Arguments could not be resolved',
69  self::CACHEHASH_COMPARISON_FAILED => 'Request parameters could not be validated (&cHash comparison failed)',
70  self::CACHEHASH_EMPTY => 'Request parameters could not be validated (&cHash empty)',
71 
72  self::LANGUAGE_NOT_AVAILABLE => 'Page is not available in the requested language',
73  self::LANGUAGE_NOT_AVAILABLE_STRICT_MODE => 'Page is not available in the requested language (strict)',
74  self::LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE => 'Page is not available in the requested language (fallbacks did not apply)',
75  self::LANGUAGE_DEFAULT_NOT_AVAILABLE => 'Page is not available in default language',
76 
77  self::ACCESS_DENIED_GENERAL => 'The requested page was not accessible',
78  self::ACCESS_DENIED_PAGE_NOT_RESOLVED => 'ID was not an accessible page',
79  self::ACCESS_DENIED_SUBSECTION_NOT_RESOLVED => 'Subsection was found and not accessible',
80  self::ACCESS_DENIED_HOST_PAGE_MISMATCH => 'ID was outside the domain',
81  self::ACCESS_DENIED_INVALID_PAGETYPE => 'The requested page type cannot be rendered',
82 
83  self::DATABASE_CONNECTION_FAILED => 'Database Connection failed',
84  self::ROOTLINE_BROKEN => 'The requested page did not have a proper connection to the tree-root'
85  ];
86 
91  public function ‪getMessageForReason(string $reasonCode): string
92  {
93  if (!isset($this->messages[$reasonCode])) {
94  throw new \InvalidArgumentException('No message for page access reason code "' . $reasonCode . '" found.', 1529299833);
95  }
96  return $this->messages[$reasonCode];
97  }
98 }
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE
‪const LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:43
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\INVALID_PAGE_ARGUMENTS
‪const INVALID_PAGE_ARGUMENTS
Definition: PageAccessFailureReasons.php:36
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\CACHEHASH_EMPTY
‪const CACHEHASH_EMPTY
Definition: PageAccessFailureReasons.php:38
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_INVALID_PAGETYPE
‪const ACCESS_DENIED_INVALID_PAGETYPE
Definition: PageAccessFailureReasons.php:51
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_GENERAL
‪const ACCESS_DENIED_GENERAL
Definition: PageAccessFailureReasons.php:47
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\$messages
‪string[] $messages
Definition: PageAccessFailureReasons.php:60
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_HOST_PAGE_MISMATCH
‪const ACCESS_DENIED_HOST_PAGE_MISMATCH
Definition: PageAccessFailureReasons.php:50
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_PAGE_NOT_RESOLVED
‪const ACCESS_DENIED_PAGE_NOT_RESOLVED
Definition: PageAccessFailureReasons.php:48
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_DEFAULT_NOT_AVAILABLE
‪const LANGUAGE_DEFAULT_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:44
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_NOT_AVAILABLE
‪const LANGUAGE_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:41
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\PAGE_NOT_FOUND
‪const PAGE_NOT_FOUND
Definition: PageAccessFailureReasons.php:28
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_CONFIGURED
‪const RENDERING_INSTRUCTIONS_NOT_CONFIGURED
Definition: PageAccessFailureReasons.php:33
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_SUBSECTION_NOT_RESOLVED
‪const ACCESS_DENIED_SUBSECTION_NOT_RESOLVED
Definition: PageAccessFailureReasons.php:49
‪TYPO3\CMS\Frontend\Page
Definition: LegacyClassesForIde.php:20
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\NO_PAGES_FOUND
‪const NO_PAGES_FOUND
Definition: PageAccessFailureReasons.php:27
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_NOT_AVAILABLE_STRICT_MODE
‪const LANGUAGE_NOT_AVAILABLE_STRICT_MODE
Definition: PageAccessFailureReasons.php:42
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\CACHEHASH_COMPARISON_FAILED
‪const CACHEHASH_COMPARISON_FAILED
Definition: PageAccessFailureReasons.php:37
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\getMessageForReason
‪string getMessageForReason(string $reasonCode)
Definition: PageAccessFailureReasons.php:90
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons
Definition: PageAccessFailureReasons.php:25
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ROOTLINE_BROKEN
‪const ROOTLINE_BROKEN
Definition: PageAccessFailureReasons.php:29
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\DATABASE_CONNECTION_FAILED
‪const DATABASE_CONNECTION_FAILED
Definition: PageAccessFailureReasons.php:54
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_FOUND
‪const RENDERING_INSTRUCTIONS_NOT_FOUND
Definition: PageAccessFailureReasons.php:32