[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/includes/ -> app.php (source)

   1  <?php
   2  
   3  /**
   4   * @package    Joomla.Site
   5   *
   6   * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  defined('_JEXEC') or die;
  11  
  12  // Saves the start time and memory usage.
  13  $startTime = microtime(1);
  14  $startMem  = memory_get_usage();
  15  
  16  if (file_exists(dirname(__DIR__) . '/defines.php')) {
  17      include_once dirname(__DIR__) . '/defines.php';
  18  }
  19  
  20  if (!defined('_JDEFINES')) {
  21      define('JPATH_BASE', dirname(__DIR__));
  22      require_once  JPATH_BASE . '/includes/defines.php';
  23  }
  24  
  25  // Check for presence of vendor dependencies not included in the git repository
  26  if (!file_exists(JPATH_LIBRARIES . '/vendor/autoload.php') || !is_dir(JPATH_ROOT . '/media/vendor')) {
  27      echo file_get_contents(JPATH_ROOT . '/templates/system/build_incomplete.html');
  28  
  29      exit;
  30  }
  31  
  32  require_once  JPATH_BASE . '/includes/framework.php';
  33  
  34  // Set profiler start time and memory usage and mark afterLoad in the profiler.
  35  JDEBUG && \Joomla\CMS\Profiler\Profiler::getInstance('Application')->setStart($startTime, $startMem)->mark('afterLoad');
  36  
  37  // Boot the DI container
  38  $container = \Joomla\CMS\Factory::getContainer();
  39  
  40  /*
  41   * Alias the session service keys to the web session service as that is the primary session backend for this application
  42   *
  43   * In addition to aliasing "common" service keys, we also create aliases for the PHP classes to ensure autowiring objects
  44   * is supported.  This includes aliases for aliased class names, and the keys for aliased class names should be considered
  45   * deprecated to be removed when the class name alias is removed as well.
  46   */
  47  $container->alias('session.web', 'session.web.site')
  48      ->alias('session', 'session.web.site')
  49      ->alias('JSession', 'session.web.site')
  50      ->alias(\Joomla\CMS\Session\Session::class, 'session.web.site')
  51      ->alias(\Joomla\Session\Session::class, 'session.web.site')
  52      ->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');
  53  
  54  // Instantiate the application.
  55  $app = $container->get(\Joomla\CMS\Application\SiteApplication::class);
  56  
  57  // Set the application as global app
  58  \Joomla\CMS\Factory::$application = $app;
  59  
  60  // Execute the application.
  61  $app->execute();


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