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 <roland __NOSPAM__ [at] __REMOVE_ME__ mxchange [dot] org>
26 class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication {
28 * The version number of this application
30 private $appVersion = "";
33 * The human-readable name for this application
35 private $appName = "";
38 * The short uni*-like name for this application
40 private $shortName = "";
43 * An instance of this class
45 private static $thisInstance = null;
52 private function __construct () {
53 // Call parent constructor
54 parent::constructor(__CLASS__);
57 $this->setPartDescr("Application-Helper");
59 // Create an unique ID
60 $this->createUniqueID();
63 $this->removeSystemArray();
67 * Getter for an instance of this class
69 * @return $thisInstance An instance of this class
71 public final static function getInstance () {
72 // Is the instance there?
73 if (is_null(self::$thisInstance)) {
74 self::$thisInstance = new ApplicationHelper();
77 // Return the instance
78 return self::$thisInstance;
82 * Getter for the version number
84 * @return $appVersion The application's version number
86 public final function getAppVersion () {
87 return $this->appVersion;
90 * Setter for the version number
92 * @param $appVersion The application's version number
95 public final function setAppVersion ($appVersion) {
97 $appVersion = (string) $appVersion;
98 $this->appVersion = $appVersion;
102 * Getter for human-readable name
104 * @return $appName The application's human-readable name
106 public final function getAppName () {
107 return $this->appName;
111 * Setter for human-readable name
113 * @param $appName The application's human-readable name
116 public final function setAppName ($appName) {
118 $appName = (string) $appName;
119 $this->appName = $appName;
123 * Getter for short uni*-like name
125 * @return $shortName The application's short uni*-like name
127 public final function getAppShortName () {
128 return $this->shortName;
132 * Setter for short uni*-like name
134 * @param $shortName The application's short uni*-like name
137 public final function setAppShortName ($shortName) {
139 $shortName = (string) $shortName;
140 $this->shortName = $shortName;
144 * Launches the hub system
148 public final function entryPoint () {
149 // Get a core loop instance
150 $hubInstance = HubCoreLoop::createHubCoreLoop();
153 $hubInstance->outputIntro();
155 // Contact the master hub
156 $hubInstance->contactMasterHub();
158 // The main loop begins here
159 $hubInstance->coreLoop();
162 $hubInstance->shutdownHub();