]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/init.php
eval() commands replace by improved object factory, user login class stub added
[shipsimu.git] / application / ship-simu / init.php
index b8f232b7f9906e6ac201d611e58ed2b965756cdf..431e4420d37ef526e2f2966178ca76d1b2a25da0 100644 (file)
@@ -8,7 +8,7 @@
  * You can prevent adding this application to the selector by uncommenting the
  * following line:
  *
- * if ((isset($this)) && (is_object($this)) && ($this->isSameClass("ApplicationSelector"))) { return; }
+ * if ((isset($this)) && (is_object($this)) && ($this->isClass("ApplicationSelector"))) { return; }
  *
  * isset() is required to prevent a warning and is_object() is highly required
  * when the application itself is requested in URL (hint: index.php?app=your_app)
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-// Get an instance of the helper
-$eval = sprintf("\$app = %s::getInstance();",
-       FrameworkConfiguration::getInstance()->readConfig("app_helper_class")
+// Generate call-back function
+$callback = sprintf("%s::getInstance",
+       FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
 );
-eval($eval);
+
+// Get an instance of the helper
+$app = call_user_func_array($callback, array());
 
 // Set application name and version
 $app->setAppName("Ship-Simu Schiffsimulator");
-$app->setAppVersion("0.1");
+$app->setAppVersion("0.0.0");
 $app->setAppShortName("ship-simu");
 
 // Initialize output system
-require(PATH . "inc/output.php");
+require(PATH . 'inc/output.php');
 
 // Initialize file i/o system
-require(PATH . "inc/file_io.php");
-$app->setFileIOInstance($io);
+require(PATH . 'inc/file_io.php');
+$app->setFileIoInstance($io);
 
 // Include the language sub-system
-require(PATH . "inc/language.php");
+require(PATH . 'inc/language.php');
 $app->setLanguageInstance($lang);
 
 // This application needs a database connection then we have to simply include
 // the inc/database.php script
-require(PATH . "inc/database.php");
+require(PATH . 'inc/database.php');
 
 // [EOF]
 ?>