More code merged from ship-simu
[mailer.git] / application / mxchange / init.php
index 7c32b791136d7482dec7f6730eb0b3cdb0d24be1..4dc2e1949a0917bae5709faec1b1363dca135788 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-//
-// Please remember that this include file is being loaded *before* the class
-// loader is loading classes from "exceptions", "interfaces" and "main"!
-//
-// Get an instance of the initializer
-$eval = sprintf("\$app = %s::getInstance();",
-       FrameworkConfiguration::getInstance()->readConfig("app_helper_class")
-);
-eval($eval);
-
-// Set application name and version
-$app->setAppName("MXChange Mailtausch-Skript");
-$app->setAppVersion("0.3.0");
-$app->setAppShortName(FrameworkConfiguration::getInstance()->readConfig("selector_name"));
-
 // Initialize output system
 require(PATH . "inc/output.php");
 
@@ -49,5 +34,23 @@ require(PATH . "inc/language.php");
 // Get the database layer as well
 require(PATH . "inc/database.php");
 
+// Generate call-back function
+$callback = sprintf("%s::getInstance",
+       FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
+);
+
+// Get an instance of the helper
+$app = call_user_func_array($callback, array());
+
+// Set application name and version
+$app->setAppName("MXChange Mailtausch-Skript");
+$app->setAppVersion("0.3.0");
+$app->setAppShortName(FrameworkConfiguration::getInstance()->readConfig("selector_name"));
+
+// Set instances
+$app->setFileIoInstance($io);
+$app->setLanguageInstance($lang);
+$app->setDatabaseInstance($db);
+
 // [EOF]
 ?>