Skip to content
This repository
Newer
Older
100644 84 lines (70 sloc) 2.081 kb
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
1 <?php
2 /**
0a72863a » LouisLandry
2011-03-20 Fixing file headers for both unit test and library files.
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
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
7 */
8
9 // Set the platform root path as a constant if necessary.
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
10 if (!defined('JPATH_PLATFORM'))
11 {
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
12 define('JPATH_PLATFORM', dirname(__FILE__));
13 }
14
15 // Set the directory separator define if necessary.
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
16 if (!defined('DS'))
17 {
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
18 define('DS', DIRECTORY_SEPARATOR);
19 }
20
21 // Detect the native operating system type.
22 $os = strtoupper(substr(PHP_OS, 0, 3));
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
23 if (!defined('IS_WIN'))
24 {
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
25 define('IS_WIN', ($os === 'WIN') ? true : false);
26 }
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
27 if (!defined('IS_MAC'))
28 {
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
29 define('IS_MAC', ($os === 'MAC') ? true : false);
30 }
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
31 if (!defined('IS_UNIX'))
32 {
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
33 define('IS_UNIX', (($os !== 'MAC') && ($os !== 'WIN')) ? true : false);
34 }
35
36 // Import the platform version library if necessary.
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
37 if (!class_exists('JPlatform'))
38 {
39 require_once JPATH_PLATFORM . '/platform.php';
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
40 }
41
42 // Import the library loader if necessary.
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
43 if (!class_exists('JLoader'))
44 {
45 require_once JPATH_PLATFORM . '/loader.php';
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
46 }
47
fc5a10c5 » realityking
2011-11-09 Unify the style of the JPATH_PLATFORM check.
48 class_exists('JLoader') or die;
49
1a7caa4b » LouisLandry
2011-11-09 Some minor adjustments to the Joomla Loader class and import file.
50 // Setup the autoloaders.
51 JLoader::setup();
52
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
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.error');
62 JLoader::import('joomla.error.exception');
63
64 /*
65 * If the HTTP_HOST environment variable is set we assume a Web request and
66 * thus we import the request library and most likely clean the request input.
67 */
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
68 if (isset($_SERVER['HTTP_HOST']))
69 {
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
70 JLoader::import('joomla.environment.request');
71
72 // If an application flags it doesn't want this, adhere to that.
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
73 if (!defined('_JREQUEST_NO_CLEAN'))
74 {
cb8c4d88 » LouisLandry
2011-02-08 Moving files around.
75 JRequest::clean();
76 }
77 }
78
79 // Import the base object library.
80 JLoader::import('joomla.base.object');
81
82 // Register classes that don't follow one file per class naming conventions.
78e6bc0c » eddieajau
2011-07-29 Code cleaning.
83 JLoader::register('JText', JPATH_PLATFORM . '/joomla/methods.php');
84 JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/methods.php');
Something went wrong with that request. Please try again.