source: sourcecode/application/third_party/MX/Ci.php @ 1

Last change on this file since 1 was 1, checked in by dungnv, 11 years ago
File size: 2.0 KB
Line 
1<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
2
3/* load MX core classes */
4require_once dirname(__FILE__).'/Lang.php';
5require_once dirname(__FILE__).'/Config.php';
6
7/**
8 * Modular Extensions - HMVC
9 *
10 * Adapted from the CodeIgniter Core Classes
11 * @link        http://codeigniter.com
12 *
13 * Description:
14 * This library creates a CI class which allows the use of modules in an application.
15 *
16 * Install this file as application/third_party/MX/Ci.php
17 *
18 * @copyright   Copyright (c) 2011 Wiredesignz
19 * @version     5.4
20 *
21 * Permission is hereby granted, free of charge, to any person obtaining a copy
22 * of this software and associated documentation files (the "Software"), to deal
23 * in the Software without restriction, including without limitation the rights
24 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 * copies of the Software, and to permit persons to whom the Software is
26 * furnished to do so, subject to the following conditions:
27 *
28 * The above copyright notice and this permission notice shall be included in
29 * all copies or substantial portions of the Software.
30 *
31 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37 * THE SOFTWARE.
38 **/
39class CI
40{
41        public static $APP;
42       
43        public function __construct() {
44               
45                /* assign the application instance */
46                self::$APP = CI_Controller::get_instance();
47               
48                global $LANG, $CFG;
49               
50                /* re-assign language and config for modules */
51                if ( ! is_a($LANG, 'MX_Lang')) $LANG = new MX_Lang;
52                if ( ! is_a($CFG, 'MX_Config')) $CFG = new MX_Config;
53        }
54}
55
56/* create the application object */
57new CI;
Note: See TracBrowser for help on using the repository browser.