Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 68 lines (57 sloc) 1.775 kb
e441c20 @LouisLandry Making some initial adjustments and additions for Phar packaging.
LouisLandry authored
1 <?php
2 /**
3 * @package Joomla.Platform
4 *
5 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
6 * @license GNU General Public License version 2 or later; see LICENSE
7 */
8
9 // Setup the Pharsanity!
10 Phar::interceptFileFuncs();
11
12 // Set the platform root path as a constant if necessary.
13 if (!defined('JPATH_PLATFORM'))
14 {
15 define('JPATH_PLATFORM', 'phar://' . __FILE__);
16 }
17
18 // Detect the native operating system type.
19 $os = strtoupper(substr(PHP_OS, 0, 3));
20 if (!defined('IS_WIN'))
21 {
22 define('IS_WIN', ($os === 'WIN') ? true : false);
23 }
24 if (!defined('IS_MAC'))
25 {
26 define('IS_MAC', ($os === 'MAC') ? true : false);
27 }
28 if (!defined('IS_UNIX'))
29 {
30 define('IS_UNIX', (($os !== 'MAC') && ($os !== 'WIN')) ? true : false);
31 }
32
33 // Import the platform version library if necessary.
34 if (!class_exists('JPlatform'))
35 {
36 require_once JPATH_PLATFORM . '/platform.php';
37 }
38
39 // Import the library loader if necessary.
40 if (!class_exists('JLoader'))
41 {
42 require_once JPATH_PLATFORM . '/loader.php';
43 }
44
45 // Make sure that the Joomla Platform has been successfully loaded.
46 if (!class_exists('JLoader'))
47 {
48 throw new RuntimeException('Joomla Platform not loaded.');
49 }
50
51 // Setup the autoloaders.
52 JLoader::setup();
53
54 // Import the base Joomla Platform libraries.
55 JLoader::import('joomla.factory');
56
0f0beb4 @LouisLandry Adding the compat libraries to the phar package definitions.
LouisLandry authored
57 // Register classes for compatability with PHP 5.3
58 if (version_compare(PHP_VERSION, '5.4.0', '<'))
59 {
60 JLoader::register('JsonSerializable', JPATH_PLATFORM . '/compat/jsonserializable.php');
61 }
62
e441c20 @LouisLandry Making some initial adjustments and additions for Phar packaging.
LouisLandry authored
63 // Register classes that don't follow one file per class naming conventions.
64 JLoader::register('JText', JPATH_PLATFORM . '/joomla/language/text.php');
65 JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/application/route.php');
66
67 // End of the Phar Stub.
68 __HALT_COMPILER();?>
Something went wrong with that request. Please try again.