]> git.mxchange.org Git - hub.git/blob - application/hub/init.php
New starter/init style applied
[hub.git] / application / hub / init.php
1 <?php
2 /**
3  * Application initializer
4  *
5  * Please remember that this include file is being loaded *before* the class
6  * loader is loading classes from "exceptions", "interfaces" and "main"!
7  *
8  * You can prevent adding this application to the selector by uncommenting the
9  * following line:
10  *
11  * if ((isset($this)) && (is_object($this)) && ($this->isClass("ApplicationSelector"))) { return; }
12  *
13  * isset() is required to prevent a warning and is_object() is highly required
14  * when the application itself is requested in URL (hint: index.php?app=your_app)
15  *
16  * @author              Roland Haeder <webmaster@ship-simu.org>
17  * @version             0.0
18  * @copyright   Copyright(c) 2007, 2008 Roland Haeder, this is free software
19  * @license             GNU GPL 3.0 or any newer version
20  *
21  * This program is free software: you can redistribute it and/or modify
22  * it under the terms of the GNU General Public License as published by
23  * the Free Software Foundation, either version 3 of the License, or
24  * (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29  * GNU General Public License for more details.
30  *
31  * You should have received a copy of the GNU General Public License
32  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
33  */
34
35 // Initialize output system
36 require(PATH . "inc/output.php");
37
38 // Initialize file i/o system
39 require(PATH . "inc/file_io.php");
40
41 // Include the language sub-system
42 require(PATH . "inc/language.php");
43
44 // This application needs a database connection then we have to simply include
45 // the inc/database.php script
46 require(PATH . "inc/database.php");
47
48 // Generate call-back function
49 $callback = sprintf("%s::getInstance",
50         FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
51 );
52
53 // Get an instance of the helper
54 $app = call_user_func_array($callback, array());
55
56 // Set application name and version
57 $app->setAppName("MXChange Hub");
58 $app->setAppVersion("0.0.0");
59 $app->setAppShortName("mxhub");
60
61 // Get's our IP address
62 $_SERVER['SERVER_ADDR'] = ConsoleTools::aquireSelfIPAddress();
63
64 // Set instances
65 $app->setFileIoInstance($io);
66 $app->setLanguageInstance($lang);
67 $app->setDatabaseInstance($db);
68
69 // [EOF]
70 ?>