application/blog/.htaccess -text
application/blog/class_ApplicationHelper.php -text
application/blog/config.php -text
+application/blog/data.php -text
application/blog/debug.php -text
application/blog/exceptions.php -text
application/blog/exceptions/.htaccess -text
application/selector/class_ApplicationHelper.php -text
application/selector/class_ApplicationSelector.php -text
application/selector/config.php -text
+application/selector/data.php -text
application/selector/debug.php -text
application/selector/exceptions.php -text
application/selector/init.php -text
application/ship-simu/.htaccess -text
application/ship-simu/class_ApplicationHelper.php -text
application/ship-simu/config.php -text
+application/ship-simu/data.php -text
application/ship-simu/debug.php -text
application/ship-simu/exceptions.php -text
application/ship-simu/exceptions/.htaccess -text
application/shoutbox/.htaccess -text
application/shoutbox/class_ApplicationHelper.php -text
application/shoutbox/config.php -text
+application/shoutbox/data.php -text
application/shoutbox/debug.php -text
application/shoutbox/exceptions.php -text
application/shoutbox/exceptions/.htaccess -text
application/todo/.htaccess -text
application/todo/class_ApplicationHelper.php -text
application/todo/config.php -text
+application/todo/data.php -text
application/todo/debug.php -text
application/todo/exceptions.php -text
application/todo/exceptions/.htaccess -text
--- /dev/null
+<?php
+/**
+ * Application data
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * You can prevent adding this application to the selector by uncommenting the
+ * following line:
+ *
+ * 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)
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Get an instance of the helper
+$app = call_user_func_array(
+ array($cfg->readConfig('app_helper_class'), "getInstance"),
+ array()
+);
+
+// Set application name and version
+$app->setAppName("Nameless Blogging Software");
+$app->setAppVersion("0.0.0");
+$app->setAppShortName("blog");
+
+// [EOF]
+?>
// the inc/database.php script
require($cfg->readConfig('base_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("Nameless Blogging Software");
-$app->setAppVersion("0.0.0");
-$app->setAppShortName("blog");
-
-// Set instances
-$app->setFileIoInstance($io);
-$app->setLanguageInstance($lang);
-$app->setDatabaseInstance($db);
-
// [EOF]
?>
}
/**
- * Load the init.php script of an application and append the application
+ * Load the data.php script of an application and append the application
* instance to $foundApps
*
- * @param $initScript The FQFN of init.php
+ * @param $appData The FQFN of data.php
* @param $appName The application's Uni* name
* @return void
*/
- private function loadInitScript ($initScript, $appName) {
+ private function loadApplicationData ($appData, $appName) {
// Is it a file and readable?
- if ((is_file($initScript)) && (is_readable($initScript))) {
+ if ((is_file($appData)) && (is_readable($appData))) {
// Then include it
- include ($initScript);
+ include ($appData);
// Add the current instance to the list
$this->foundApps->append($app);
// Is this a readable directory? (files will be ignored silently)
if ((is_dir($fqfn)) && (is_readable($fqfn))) {
- // Then get the init.php script for analyzing
- $initScript = sprintf("%s/init.php", $fqfn);
+ // Then get the data.php script for analyzing
+ $appData = sprintf("%s/data.php", $fqfn);
- // Load the application's init.php script and append the
+ // Load the application's data.php script and append the
// application to the ArrayObject
- $this->loadInitScript($initScript, $appName);
-
- } // END - if ((is_dir(...
-
+ $this->loadApplicationData($appData, $appName);
+ } // END - if
} // END - while
// Close directory pointer
--- /dev/null
+<?php
+/**
+ * Application data
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Get an instance of the helper
+$app = call_user_func_array(
+ array($cfg->readConfig('app_helper_class'), "getInstance"),
+ array()
+);
+
+// Set application name and version
+$app->setAppName("Applikationsauswähler");
+$app->setAppVersion("0.1a");
+$app->setAppShortName($cfg->readConfig('selector_name'));
+
+// [EOF]
+?>
// Include the language sub-system
require($cfg->readConfig('base_path') . 'inc/language.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("Applikationsauswähler");
-$app->setAppVersion("0.1a");
-$app->setAppShortName(FrameworkConfiguration::getInstance()->readConfig('selector_name'));
-
-// Set instances
-$app->setFileIoInstance($io);
-$app->setLanguageInstance($lang);
-
// [EOF]
?>
--- /dev/null
+<?php
+/**
+ * Application data
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * You can prevent adding this application to the selector by uncommenting the
+ * following line:
+ *
+ * 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)
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Get an instance of the helper
+$app = call_user_func_array(
+ array($cfg->readConfig('app_helper_class'), "getInstance"),
+ array()
+);
+
+// Set application name and version
+$app->setAppName("Ship-Simu Schiffsimulator");
+$app->setAppVersion("0.0.0");
+$app->setAppShortName("ship-simu");
+
+// [EOF]
+?>
// the inc/database.php script
require($cfg->readConfig('base_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("Ship-Simu Schiffsimulator");
-$app->setAppVersion("0.0.0");
-$app->setAppShortName("ship-simu");
-
-// Set instances
-$app->setFileIoInstance($io);
-$app->setLanguageInstance($lang);
-$app->setDatabaseInstance($db);
-
// [EOF]
?>
--- /dev/null
+<?php
+/**
+ * Application data
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * You can prevent adding this application to the selector by uncommenting the
+ * following line:
+ *
+ * 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)
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Get an instance of the helper
+$app = call_user_func_array(
+ array($cfg->readConfig('app_helper_class'), "getInstance"),
+ array()
+);
+
+// Set application name and version
+$app->setAppName("Nameless Blogging Software");
+$app->setAppVersion("0.0.0");
+$app->setAppShortName("shoutbox");
+
+// [EOF]
+?>
// the inc/database.php script
require($cfg->readConfig('base_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("Nameless Blogging Software");
-$app->setAppVersion("0.0.0");
-$app->setAppShortName("shoutbox");
-
-// Set instances
-$app->setFileIoInstance($io);
-$app->setLanguageInstance($lang);
-$app->setDatabaseInstance($db);
-
// [EOF]
?>
--- /dev/null
+<?php
+/**
+ * Application data
+ *
+ * Please remember that this include file is being loaded *before* the class
+ * loader is loading classes from "exceptions", "interfaces" and "main"!
+ *
+ * You can prevent adding this application to the selector by uncommenting the
+ * following line:
+ *
+ * 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)
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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/>.
+ */
+
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
+// Get an instance of the helper
+$app = call_user_func_array(
+ array($cfg->readConfig('app_helper_class'), "getInstance"),
+ array()
+);
+
+// Set application name and version
+$app->setAppName("OpenToDo");
+$app->setAppVersion("0.0.0");
+$app->setAppShortName("todo");
+
+// [EOF]
+?>
// the inc/database.php script
require($cfg->readConfig('base_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("OpenToDo");
-$app->setAppVersion("0.0.0");
-$app->setAppShortName("todo");
-
-// Set instances
-$app->setFileIoInstance($io);
-$app->setLanguageInstance($lang);
-$app->setDatabaseInstance($db);
-
// [EOF]
?>
private final function initInstance () {
// Is this a system class?
if (!in_array($this->__toString(), $this->systemClasses)) {
+ // Set configuration instance
+ $this->setConfigInstance(FrameworkConfiguration::getInstance());
+
// Add application helper to our class
$this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class');
throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND);
}
- // Then Prepare the call-back function
- $callback = sprintf("%s::create%s",
- $className,
+ // Create method name
+ $methodName = sprintf("create%s",
$className
);
// Run the user function
- $objectInstance = call_user_func_array($callback, $args);
+ $objectInstance = call_user_func_array(array($className, $methodName), $args);
// Count generated objects up
self::$total++;
));
}
+// Is the app variable there and valid?
+if (is_object($app)) $app->setDatabaseInstance($db);
+
// Datenbankobjekt debuggen
if (defined('DEBUG_DATABASE_OBJ')) {
DebugMiddleware::getInstance()->output(sprintf("The database sub-system does now look like this:<br />
// Get the instance
$io = ObjectFactory::createObjectByConfiguredName('file_io_class');
+// Is the app variable there and valid?
+if (is_object($app)) $app->setFileIoInstance($io);
+
// [EOF]
?>
));
}
+// Is the app variable there and valid?
+if (is_object($app)) $app->setLanguageInstance($lang);
+
// [EOF]
?>
$configAppIncludes = array(
sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class
"config", // The application's own configuration
+ "data", // Application data
"init", // The application initializer
"loader", // The application's class loader
"debug", // Some debugging stuff