[ Index ]

PHP Cross Reference of Documentation Magento

title

Body

[close]

/ -> index.php (source)

   1  <?php
   2  /**
   3   * Magento
   4   *
   5   * NOTICE OF LICENSE
   6   *
   7   * This source file is subject to the Open Software License (OSL 3.0)
   8   * that is bundled with this package in the file LICENSE.txt.
   9   * It is also available through the world-wide-web at this URL:
  10   * http://opensource.org/licenses/osl-3.0.php
  11   * If you did not receive a copy of the license and are unable to
  12   * obtain it through the world-wide-web, please send an email
  13   * to license@magentocommerce.com so we can send you a copy immediately.
  14   *
  15   * DISCLAIMER
  16   *
  17   * Do not edit or add to this file if you wish to upgrade Magento to newer
  18   * versions in the future. If you wish to customize Magento for your
  19   * needs please refer to http://www.magentocommerce.com for more information.
  20   *
  21   * @category   Mage
  22   * @package    Mage
  23   * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
  24   * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  25   */
  26  
  27  if (version_compare(phpversion(), '5.2.0', '<')===true) {
  28      echo  '<div style="font:12px/1.35em arial, helvetica, sans-serif;">
  29  <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
  30  <h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">
  31  Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer.
  32  <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a>
  33   Magento using PHP-CGI as a work-around.</p></div>';
  34      exit;
  35  }
  36  
  37  /**
  38   * Error reporting
  39   */
  40  error_reporting(E_ALL | E_STRICT);
  41  
  42  /**
  43   * Compilation includes configuration file
  44   */
  45  define('MAGENTO_ROOT', getcwd());
  46  
  47  $compilerConfig = MAGENTO_ROOT . '/includes/config.php';
  48  if (file_exists($compilerConfig)) {
  49      include $compilerConfig;
  50  }
  51  
  52  $mageFilename = MAGENTO_ROOT . '/app/Mage.php';
  53  $maintenanceFile = 'maintenance.flag';
  54  
  55  if (!file_exists($mageFilename)) {
  56      if (is_dir('downloader')) {
  57          header("Location: downloader");
  58      } else {
  59          echo $mageFilename." was not found";
  60      }
  61      exit;
  62  }
  63  
  64  if (file_exists($maintenanceFile)) {
  65      include_once dirname(__FILE__) . '/errors/503.php';
  66      exit;
  67  }
  68  
  69  require_once $mageFilename;
  70  
  71  #Varien_Profiler::enable();
  72  
  73  if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
  74      Mage::setIsDeveloperMode(true);
  75  }
  76  
  77  #ini_set('display_errors', 1);
  78  
  79  umask(0);
  80  
  81  /* Store or website code */
  82  $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
  83  
  84  /* Run store or run website */
  85  $mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
  86  
  87  Mage::run($mageRunCode, $mageRunType);


Développement Magento e-commerce Montréal
Generated: Thu Feb 21 16:42:07 2013 Cross-referenced by PHPXref 0.7.1