[ Index ]

PHP Cross Reference of Joomla 3.3.0

title

Body

[close]

/libraries/ -> import.php (source)

   1  <?php
   2  /**
   3   * Bootstrap file for the Joomla Platform.  Including this file into your application will make Joomla
   4   * Platform libraries available for use.
   5   *
   6   * @package    Joomla.Platform
   7   *
   8   * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
   9   * @license    GNU General Public License version 2 or later; see LICENSE
  10   */
  11  
  12  // Set the platform root path as a constant if necessary.
  13  if (!defined('JPATH_PLATFORM'))
  14  {
  15      define('JPATH_PLATFORM', __DIR__);
  16  }
  17  
  18  // Detect the native operating system type.
  19  $os = strtoupper(substr(PHP_OS, 0, 3));
  20  
  21  if (!defined('IS_WIN'))
  22  {
  23      define('IS_WIN', ($os === 'WIN') ? true : false);
  24  }
  25  if (!defined('IS_UNIX'))
  26  {
  27      define('IS_UNIX', (IS_WIN === false) ? true : false);
  28  }
  29  
  30  // Import the platform version library if necessary.
  31  if (!class_exists('JPlatform'))
  32  {
  33      require_once  JPATH_PLATFORM . '/platform.php';
  34  }
  35  
  36  // Import the library loader if necessary.
  37  if (!class_exists('JLoader'))
  38  {
  39      require_once  JPATH_PLATFORM . '/loader.php';
  40  }
  41  
  42  // Make sure that the Joomla Platform has been successfully loaded.
  43  if (!class_exists('JLoader'))
  44  {
  45      throw new RuntimeException('Joomla Platform not loaded.');
  46  }
  47  
  48  // Setup the autoloaders.
  49  JLoader::setup();
  50  
  51  // Import the base Joomla Platform libraries.
  52  JLoader::import('joomla.factory');
  53  
  54  // Register classes for compatability with PHP 5.3
  55  if (version_compare(PHP_VERSION, '5.4.0', '<'))
  56  {
  57      JLoader::register('JsonSerializable', JPATH_PLATFORM . '/compat/jsonserializable.php');
  58  }
  59  
  60  // Register classes that don't follow one file per class naming conventions.
  61  JLoader::register('JText', JPATH_PLATFORM . '/joomla/language/text.php');
  62  JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/application/route.php');
  63  
  64  // Register the PasswordHash lib
  65  JLoader::register('PasswordHash', JPATH_PLATFORM . '/phpass/PasswordHash.php');


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