Skip to content
Newer
Older
100644 82 lines (68 sloc) 1.98 KB
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 8, 2011
1 <?php
2 /**
0a72863 @LouisLandry Fixing file headers for both unit test and library files.
LouisLandry authored Mar 20, 2011
3 * @package Joomla.Platform
4 *
5 * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
6 * @license GNU General Public License version 2 or later; see LICENSE
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
7 */
8
9 defined('_JEXEC') or die;
10
11 // Set the platform root path as a constant if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
12 if (!defined('JPATH_PLATFORM'))
13 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
14 define('JPATH_PLATFORM', dirname(__FILE__));
15 }
16
17 // Set the directory separator define if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
18 if (!defined('DS'))
19 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
20 define('DS', DIRECTORY_SEPARATOR);
21 }
22
23 // Detect the native operating system type.
24 $os = strtoupper(substr(PHP_OS, 0, 3));
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
25 if (!defined('IS_WIN'))
26 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
27 define('IS_WIN', ($os === 'WIN') ? true : false);
28 }
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
29 if (!defined('IS_MAC'))
30 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
31 define('IS_MAC', ($os === 'MAC') ? true : false);
32 }
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
33 if (!defined('IS_UNIX'))
34 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
35 define('IS_UNIX', (($os !== 'MAC') && ($os !== 'WIN')) ? true : false);
36 }
37
38 // Import the platform version library if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
39 if (!class_exists('JPlatform'))
40 {
41 require_once JPATH_PLATFORM . '/platform.php';
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
42 }
43
44 // Import the library loader if necessary.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
45 if (!class_exists('JLoader'))
46 {
47 require_once JPATH_PLATFORM . '/loader.php';
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
48 }
49
50 /**
51 * Import the base Joomla Platform libraries.
52 */
53
54 // Import the factory library.
55 JLoader::import('joomla.factory');
56
57 // Import the exception and error handling libraries.
58 JLoader::import('joomla.error.error');
59 JLoader::import('joomla.error.exception');
60
61 /*
62 * If the HTTP_HOST environment variable is set we assume a Web request and
63 * thus we import the request library and most likely clean the request input.
64 */
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
65 if (isset($_SERVER['HTTP_HOST']))
66 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
67 JLoader::import('joomla.environment.request');
68
69 // If an application flags it doesn't want this, adhere to that.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
70 if (!defined('_JREQUEST_NO_CLEAN'))
71 {
cb8c4d8 @LouisLandry Moving files around.
LouisLandry authored Feb 9, 2011
72 JRequest::clean();
73 }
74 }
75
76 // Import the base object library.
77 JLoader::import('joomla.base.object');
78
79 // Register classes that don't follow one file per class naming conventions.
78e6bc0 @eddieajau Code cleaning.
eddieajau authored Jul 29, 2011
80 JLoader::register('JText', JPATH_PLATFORM . '/joomla/methods.php');
81 JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/methods.php');
Something went wrong with that request. Please try again.