[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/templates/system/ -> fatal.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Template.system
   6   *
   7   * @copyright   (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
  14  
  15  /**
  16   * Note: This file is only used when unrecoverable errors happen,
  17   * normally at boot up stages, and therefore it cannot be assumed
  18   * that any part of Joomla is available (Eg: a Factory or application)
  19   *
  20   * For "normal" error handling, use error.php not this file.
  21   *
  22   * @var  HtmlErrorRenderer  $this       object containing charset
  23   * @var  string             $statusText exception error message
  24   * @var  string             $statusCode exception error code
  25   */
  26  
  27  // Fallback template
  28  $template = '{{statusCode_statusText}}';
  29  
  30  // Joomla supplied fatal error page
  31  if (file_exists(__DIR__ . '/fatal-error.html')) {
  32      $template = file_get_contents(__DIR__ . '/fatal-error.html');
  33  }
  34  
  35  /**
  36   * User supplied fatal error page.
  37   *
  38   * Allow overriding Joomla supplied page to prevent changes being wiped on Joomla upgrade.
  39   * We allow it to be a PHP file so that any post-processing, alerting etc can happen.
  40   */
  41  if (file_exists(__DIR__ . '/fatal-error.custom.php')) {
  42      require __DIR__ . '/fatal-error.custom.php';
  43  
  44      return;
  45  }
  46  
  47  echo str_replace(
  48      ['{{statusCode_statusText}}', '{{statusCode}}', '{{statusText}}'],
  49      [$statusCode . ' - ' . $statusText, $statusCode, $statusText],
  50      $template
  51  );


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer