Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 84 lines (69 sloc) 2.103 kb
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
1 <?php
2 /**
608c1da @mbabker CodeSniff on base libraries files
mbabker authored
3 * @package Joomla.Platform
0a72863 @LouisLandry Fixing file headers for both unit test and library files.
LouisLandry authored
4 *
4329ba0 @chdemko Tagging 11.4
chdemko authored
5 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
608c1da @mbabker CodeSniff on base libraries files
mbabker authored
6 * @license GNU General Public License version 2 or later; see LICENSE
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
7 */
8
9 // Set the platform root path as a constant if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
10 if (!defined('JPATH_PLATFORM'))
11 {
133d981 @realityking Replace all occurences of dirname(__FILE__) with __DIR__.
realityking authored
12 define('JPATH_PLATFORM', __DIR__);
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
13 }
14
15 // Set the directory separator define if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
16 if (!defined('DS'))
17 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
18 define('DS', DIRECTORY_SEPARATOR);
19 }
20
21 // Detect the native operating system type.
22 $os = strtoupper(substr(PHP_OS, 0, 3));
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
23 if (!defined('IS_WIN'))
24 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
25 define('IS_WIN', ($os === 'WIN') ? true : false);
26 }
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
27 if (!defined('IS_MAC'))
28 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
29 define('IS_MAC', ($os === 'MAC') ? true : false);
30 }
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
31 if (!defined('IS_UNIX'))
32 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
33 define('IS_UNIX', (($os !== 'MAC') && ($os !== 'WIN')) ? true : false);
34 }
35
36 // Import the platform version library if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
37 if (!class_exists('JPlatform'))
38 {
39 require_once JPATH_PLATFORM . '/platform.php';
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
40 }
41
42 // Import the library loader if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
43 if (!class_exists('JLoader'))
44 {
45 require_once JPATH_PLATFORM . '/loader.php';
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
46 }
47
fc5a10c @realityking Unify the style of the JPATH_PLATFORM check.
realityking authored
48 class_exists('JLoader') or die;
49
1a7caa4 @LouisLandry Some minor adjustments to the Joomla Loader class and import file.
LouisLandry authored
50 // Setup the autoloaders.
51 JLoader::setup();
52
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
53 /**
54 * Import the base Joomla Platform libraries.
55 */
56
57 // Import the factory library.
58 JLoader::import('joomla.factory');
59
60 // Import the exception and error handling libraries.
61 JLoader::import('joomla.error.exception');
62
63 /*
64 * If the HTTP_HOST environment variable is set we assume a Web request and
65 * thus we import the request library and most likely clean the request input.
66 */
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
67 if (isset($_SERVER['HTTP_HOST']))
68 {
9969c77 @realityking Don't load JRequest when it isn't used.
realityking authored
69 JLoader::register('JRequest', JPATH_PLATFORM . '/joomla/environment/request.php');
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
70
71 // If an application flags it doesn't want this, adhere to that.
395f192 @realityking Remove fixes for secruity issues that have been fixed in PHP years ago.
realityking authored
72 if (!defined('_JREQUEST_NO_CLEAN') && (bool) ini_get('register_globals'))
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
73 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored
74 JRequest::clean();
75 }
76 }
77
78 // Import the base object library.
79 JLoader::import('joomla.base.object');
80
81 // Register classes that don't follow one file per class naming conventions.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored
82 JLoader::register('JText', JPATH_PLATFORM . '/joomla/methods.php');
83 JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/methods.php');
Something went wrong with that request. Please try again.