3 * A class holding general data about the application and some methods for
4 * the management including the entry point.
10 * You need to create a folder in the folder "application" named "my_app"
11 * (without the quotes) and create a include file called
12 * class_ApplicationHelper.php. You have to write the same class for your
13 * application and implement the same interface called ManageableApplication
14 * because this class include file will be searched for.
16 * It is good when you avoid more GET parameters to keep URLs short and sweet.
17 * But sometimes you need some GET paramerers e.g. for your imprint or info page
18 * or other linked pages which you have to create and state some informations.
20 * Please remember that this include file is being loaded *before* the class
21 * loader is loading classes from "exceptions", "interfaces" and "main"!
23 * @author Roland Haeder <webmaster@ship-simu.org>
25 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
26 * @license GNU GPL 3.0 or any newer version
27 * @link http://www.ship-simu.org
29 * This program is free software: you can redistribute it and/or modify
30 * it under the terms of the GNU General Public License as published by
31 * the Free Software Foundation, either version 3 of the License, or
32 * (at your option) any later version.
34 * This program is distributed in the hope that it will be useful,
35 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 * GNU General Public License for more details.
39 * You should have received a copy of the GNU General Public License
40 * along with this program. If not, see <http://www.gnu.org/licenses/>.
42 class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication {
44 * The version number of this application
46 private $appVersion = "";
49 * The human-readable name for this application
51 private $appName = "";
54 * The short uni*-like name of this application
56 private $shortName = "";
59 * An instance of this class
61 private static $thisInstance = null;
66 private $masterTemplate = "mxchange_main";
73 protected function __construct () {
74 // Call parent constructor
75 parent::__construct(__CLASS__);
78 $this->removeSystemArray();
79 $this->removeNumberFormaters();
83 * Getter for an instance of this class
85 * @return $thisInstance An instance of this class
87 public final static function getInstance () {
88 // Is the instance there?
89 if (is_null(self::$thisInstance)) {
90 self::$thisInstance = new ApplicationHelper();
93 // Return the instance
94 return self::$thisInstance;
98 * Getter for the version number
100 * @return $appVersion The application's version number
102 public final function getAppVersion () {
103 return $this->appVersion;
107 * Setter for the version number
109 * @param $appVersion The application's version number
112 public final function setAppVersion ($appVersion) {
114 $this->appVersion = (string) $appVersion;
118 * Getter for human-readable name
120 * @return $appName The application's human-readable name
122 public final function getAppName () {
123 return $this->appName;
127 * Setter for human-readable name
129 * @param $appName The application's human-readable name
132 public final function setAppName ($appName) {
134 $this->appName = (string) $appName;
138 * Getter for short uni*-like name
140 * @return $shortName The application's short uni*-like name
142 public final function getAppShortName () {
143 return $this->shortName;
147 * Setter for short uni*-like name
149 * @param $shortName The application's short uni*-like name
152 public final function setAppShortName ($shortName) {
154 $this->shortName = (string) $shortName;
158 * Launcher for the mxchange mailexchange script
162 public final function entryPoint () {
163 // Not yet implemented
164 trigger_error(__METHOD__.": Not yet implemented!");
168 * Builds the master template's name
170 * @return $masterTemplateName Name of the master template
172 public final function buildMasterTemplateName () {
173 return $this->masterTemplate;
177 * Handle the indexed array of fatal messages and puts them out in an
180 * @param $messageList An array of fatal messages
183 public function handleFatalMessages (array $messageList) {
184 // Walk through all messages
185 foreach ($messageList as $message) {
186 die("MSG:".$message);