[ Index ]

PHP Cross Reference of Joomla 3.3.0

title

Body

[close]

/includes/ -> framework.php (source)

   1  <?php
   2  /**
   3   * @package    Joomla.Site
   4   *
   5   * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   7   */
   8  
   9  defined('_JEXEC') or die;
  10  
  11  // Joomla system checks.
  12  @ini_set('magic_quotes_runtime', 0);
  13  
  14  // Installation check, and check on removal of the install directory.
  15  if (!file_exists(JPATH_CONFIGURATION . '/configuration.php')
  16      || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || file_exists(JPATH_INSTALLATION . '/index.php'))
  17  {
  18      if (file_exists(JPATH_INSTALLATION . '/index.php'))
  19      {
  20          header('Location: ' . substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'index.php')) . 'installation/index.php');
  21  
  22          exit;
  23      }
  24      else
  25      {
  26          echo 'No configuration file found and no installation code available. Exiting...';
  27  
  28          exit;
  29      }
  30  }
  31  
  32  // System includes
  33  require_once JPATH_LIBRARIES . '/import.legacy.php';
  34  
  35  // Set system error handling
  36  JError::setErrorHandling(E_NOTICE, 'message');
  37  JError::setErrorHandling(E_WARNING, 'message');
  38  JError::setErrorHandling(E_ERROR, 'callback', array('JError', 'customErrorPage'));
  39  
  40  // Bootstrap the CMS libraries.
  41  require_once JPATH_LIBRARIES . '/cms.php';
  42  
  43  // Pre-Load configuration. Don't remove the Output Buffering due to BOM issues, see JCode 26026
  44  ob_start();
  45  require_once JPATH_CONFIGURATION . '/configuration.php';
  46  ob_end_clean();
  47  
  48  // System configuration.
  49  $config = new JConfig;
  50  
  51  // Set the error_reporting
  52  switch ($config->error_reporting)
  53  {
  54      case 'default':
  55      case '-1':
  56          break;
  57  
  58      case 'none':
  59      case '0':
  60          error_reporting(0);
  61  
  62          break;
  63  
  64      case 'simple':
  65          error_reporting(E_ERROR | E_WARNING | E_PARSE);
  66          ini_set('display_errors', 1);
  67  
  68          break;
  69  
  70      case 'maximum':
  71          error_reporting(E_ALL);
  72          ini_set('display_errors', 1);
  73  
  74          break;
  75  
  76      case 'development':
  77          error_reporting(-1);
  78          ini_set('display_errors', 1);
  79  
  80          break;
  81  
  82      default:
  83          error_reporting($config->error_reporting);
  84          ini_set('display_errors', 1);
  85  
  86          break;
  87  }
  88  
  89  define('JDEBUG', $config->debug);
  90  
  91  unset($config);
  92  
  93  // System profiler
  94  if (JDEBUG)
  95  {
  96      $_PROFILER = JProfiler::getInstance('Application');
  97  }


Generated: Fri May 2 13:54:24 2014 Cross-referenced by PHPXref 0.7.1