Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
import.php
Aller à la documentation de ce fichier.
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 - 2013 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.
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');