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