inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php -text
inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php -text
inc/classes/exceptions/template/class_ViewHelperNotFoundException.php -text
+inc/classes/exceptions/user/.htaccess -text
+inc/classes/exceptions/user/class_UsernameMissingException.php -text
inc/classes/interfaces/.htaccess -text
inc/classes/interfaces/application/.htaccess -text
inc/classes/interfaces/application/class_ManageableApplication.php -text
inc/classes/interfaces/template/.htaccess -text
inc/classes/interfaces/template/class_CompileableTemplate.php -text
inc/classes/interfaces/template/view/class_ViewHelper.php -text
+inc/classes/interfaces/user/.htaccess -text
+inc/classes/interfaces/user/class_ManageableUser.php -text
inc/classes/main/.htaccess -text
inc/classes/main/class_ -text
inc/classes/main/class_BaseFrameworkSystem.php -text
inc/classes/main/factories/objects/.htaccess -text
inc/classes/main/factories/objects/class_ObjectFactory.php -text
inc/classes/main/factories/web/.htaccess -text
-inc/classes/main/factories/web/class_NewsFactory.php -text
+inc/classes/main/factories/web/class_WebNewsFactory.php -text
inc/classes/main/filter/.htaccess -text
inc/classes/main/filter/class_ -text
inc/classes/main/filter/class_AbstractFilterDecorator.php -text
inc/classes/main/response/class_HttpResponse.php -text
inc/classes/main/template/.htaccess -text
inc/classes/main/template/class_TemplateEngine.php -text
+inc/classes/main/user/.htaccess -text
+inc/classes/main/user/class_User.php -text
inc/classes/middleware/.htaccess -text
inc/classes/middleware/class_BaseMiddleware.php -text
inc/classes/middleware/compressor/.htaccess -text
// Get a resolver
$resolverInstance = WebControllerResolver::createWebControllerResolver($commandName, $this);
- // Get a new controller instance as well
+ // Get a controller instance as well
$this->controllerInstance = $resolverInstance->resolveCommandController();
// Handle the request
* @return void
*/
public function handleFatalMessages (array $messageList) {
- die("<pre>".print_r($messageList, true)."</pre>");
+ // Walk through all messages
+ foreach ($messageList as $message) {
+ die("MSG:".$message);
+ }
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A class for non-existing usernames
+ *
+ * @author Roland Haeder <webmaster@mxchange.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/>.
+ */
+class UsernameMissingException extends FrameworkException {
+ /**
+ * The super constructor for all exceptions
+ *
+ * @param $msgArray The non-optional message for the exception
+ * @param $code An optional code for better debugging
+ * @return void
+ */
+ public function __construct(array $msgArray, $code = 0) {
+ // Create the message
+ $message = sprintf("[%s:%d] Username <u>%s</u> was not found.",
+ $msgArray[0]->__toString(),
+ $this->getLine(),
+ $msgArray[1]
+ );
+
+ // Make sure everything is assigned properly
+ parent::__construct($message, $code);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for manageable users
+ *
+ * @author Roland Haeder <webmaster@mxchange.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/>.
+ */
+interface ManageableUser extends FrameworkInterface {
+}
+
+//
+?>
parent::__construct(__CLASS__);
// Set special description
- $this->setObjectDescription("DoForm-Command");
+ $this->setObjectDescription("Command for handling forms on a centralized place");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set special description
- $this->setObjectDescription("Home-Command");
+ $this->setObjectDescription("Command for the "home" page");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set special description
- $this->setObjectDescription("Anmeldeformular-Command");
+ $this->setObjectDescription("Command for the registration form");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("BZIP2-Kompressor");
+ $this->setObjectDescription("BZIP2 compressor");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("GZIP-Kompressor");
+ $this->setObjectDescription("GZIP compressor");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Null-Kompressor");
+ $this->setObjectDescription("Null compressor");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Console-Tools");
+ $this->setObjectDescription("General console tools");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Standart-Controller für alle übrigen Anfragen");
+ $this->setObjectDescription("Default controller for all other requests");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Standart-Controller mit News-Auflistung");
+ $this->setObjectDescription("Default controller with news");
// Create unique ID number
$this->createUniqueID();
*/
private function loadNewsByRequest (Requestable $requestInstance) {
// Generate a new news object but not carring about which concrete we have
- $newsInstance = NewsFactory::createFactoryByRequest($requestInstance)->createNewsObject();
+ $newsInstance = WebNewsFactory::createFactoryByRequest($requestInstance)->createNewsObject();
}
}
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Dateidatenbankschicht");
+ $this->setObjectDescription("Class for local file databases");
// Create unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Debug-Ausgabe auf Konsole");
+ $this->setObjectDescription("Debug output for the console");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Debug-Ausgabe in error_log()");
+ $this->setObjectDescription("Debug output to error_log()");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Debug-Ausgabe auf Konsole");
+ $this->setObjectDescription("Debug output for webpages");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Limitierungsobjekt");
+ $this->setObjectDescription("Class for "limiting" other classes. See description for details.");
// Create unique ID number
$this->createUniqueID();
* @return $containerInstance An instance of SerializationContainer
* @throws GetterNotFoundException If a getter was not found
*/
- public final static function createSerializationContainer (ObjectLimits $limitInstance, $object) {
+ public final static function createSerializationContainer (ObjectLimits $limitInstance, FrameworkInterface $object) {
// Get an instance
$containerInstance = new SerializationContainer();
parent::__construct(__CLASS__);
// Set object description
- $this->setObjectDescription("Objekte-Fabrik");
+ $this->setObjectDescription("Simple generic object factory");
}
/**
+++ /dev/null
-<?php
-/**
- * A news factory for web pages
- *
- * @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/>.
- */
-class NewsFactory extends BaseFactory {
- /**
- * Instance of a request class
- */
- private $requestInstance = null;
-
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set part description
- $this->setObjectDescription("News-Fabrik für Webseiten");
- }
-
- /**
- * Singleton getter for a special factory instance depending on the given
- * request
- *
- * @param $requestInstance An instance of a request class
- * @return $factoryInstance An instance of a NewsFactory class
- */
- public final static function createFactoryByRequest (Requestable $requestInstance) {
- // Generate the new instance
- $factoryInstance = new NewsFactory();
-
- // Get the element name from configuration
- $element = FrameworkConfiguration::getInstance()->readConfig('app_selector_get');
-
- // Analyze the request, first get the Uni* application name (short one from URL)
- $appName = $requestInstance->getRequestElement($element);
-
- // Initialize some variables
- $className = "";
- $className2 = $appName;
-
- // Then construct the class name
- foreach (array("_", "-") as $exp) {
- $array = explode($exp, $className2);
- foreach ($array as $el) {
- $className .= ucfirst(strtolower($el));
- }
-
- // Copy it back and clear the class name
- $className2 = $className;
- $className = "";
- }
-
- // After all is done, copy it back and add this class' name
- $className = $className2 . $factoryInstance->__toString();
-
- // Once we have that name, try to load initialize it
- $realFactoryInstance = ObjectFactory::createObjectByName($className);
-
- // And assign it with the factory
- $factoryInstance->setRealFactoryInstance($realFactoryInstance);
-
- // Remember the request we have used for later usage
- $factoryInstance->setRequestInstance($requestInstance);
-
- // Return the prepared factory instance
- return $factoryInstance;
- }
-
- /**
- * Setter for the request instance
- *
- * @param $requestInstance An instance of a request object
- * @return void
- */
- public final function setRequestInstance (Requestable $requestInstance) {
- $this->requestInstance = $requestInstance;
- }
-
- /**
- * Creates a new object instance and returns it
- *
- * @return $newsInstance An instance of a news object
- */
- public function createNewsObject () {
- // Ask the real factory class for doing this
- $newsInstance = $this->getRealFactoryInstance()->createNewObject($this->requestInstance);
-
- // And return it
- return $newsInstance;
- }
-}
-
-// [EOF]
-?>
--- /dev/null
+<?php
+/**
+ * A news factory for web pages
+ *
+ * @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/>.
+ */
+class NewsFactory extends BaseFactory {
+ /**
+ * Instance of a request class
+ */
+ private $requestInstance = null;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("News-Fabrik für Webseiten");
+ }
+
+ /**
+ * Singleton getter for a special factory instance depending on the given
+ * request
+ *
+ * @param $requestInstance An instance of a request class
+ * @return $factoryInstance An instance of a NewsFactory class
+ */
+ public final static function createFactoryByRequest (Requestable $requestInstance) {
+ // Generate the new instance
+ $factoryInstance = new NewsFactory();
+
+ // Get the element name from configuration
+ $element = FrameworkConfiguration::getInstance()->readConfig('app_selector_get');
+
+ // Analyze the request, first get the Uni* application name (short one from URL)
+ $appName = $requestInstance->getRequestElement($element);
+
+ // Initialize some variables
+ $className = "";
+ $className2 = $appName;
+
+ // Then construct the class name
+ foreach (array("_", "-") as $exp) {
+ $array = explode($exp, $className2);
+ foreach ($array as $el) {
+ $className .= ucfirst(strtolower($el));
+ }
+
+ // Copy it back and clear the class name
+ $className2 = $className;
+ $className = "";
+ }
+
+ // After all is done, copy it back and add this class' name
+ $className = $className2 . $factoryInstance->__toString();
+
+ // Once we have that name, try to load initialize it
+ $realFactoryInstance = ObjectFactory::createObjectByName($className);
+
+ // And assign it with the factory
+ $factoryInstance->setRealFactoryInstance($realFactoryInstance);
+
+ // Remember the request we have used for later usage
+ $factoryInstance->setRequestInstance($requestInstance);
+
+ // Return the prepared factory instance
+ return $factoryInstance;
+ }
+
+ /**
+ * Setter for the request instance
+ *
+ * @param $requestInstance An instance of a request object
+ * @return void
+ */
+ public final function setRequestInstance (Requestable $requestInstance) {
+ $this->requestInstance = $requestInstance;
+ }
+
+ /**
+ * Creates a new object instance and returns it
+ *
+ * @return $newsInstance An instance of a news object
+ */
+ public function createNewsObject () {
+ // Ask the real factory class for doing this
+ $newsInstance = $this->getRealFactoryInstance()->createNewObject($this->requestInstance);
+
+ // And return it
+ return $newsInstance;
+ }
+}
+
+// [EOF]
+?>
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("");
+ $this->setObjectDescription("A filter chain class");
// Create unique ID number
$this->createUniqueID();
// Abort here
return false;
- } elseif (!$this->ifUserNameIsValid($userName)) {
- // Regular expression check failed!
- $requestInstance->requestIsValid(false);
-
- // Set a message for the response
- $responseInstance->addFatalMessage('username_invalid');
-
- // Abort here
- return false;
- } elseif (!$this->ifUserNameIsTaken($userName)) {
+ } elseif ($this->ifUserNameIsTaken($userName)) {
// Username is already taken
$requestInstance->requestIsValid(false);
return false;
}
}
+
+ /**
+ * Check wether the username as already been taken
+ *
+ * @param $userName Username to check for existence
+ * @return $alreadyTaken Wether the username has been taken
+ */
+ private function ifUserNameIsTaken ($userName) {
+ // Default is already taken
+ $alreadyTaken = true;
+
+ // Try to create a user instance
+ try {
+ // If this instance is created then the username *does* exist
+ $userInstance = User::createUserByUsername($userName);
+ } catch (UsernameMissingException $e) {
+ // Okay, this user is missing!
+ $alreadyTaken = false;
+ } catch (FrameworkException $e) {
+ // Something bad happend
+ ApplicationEntryPoint::app_die(sprintf("Exception: %s", $e->__toString()));
+ }
+
+ // Return the result
+ return $alreadyTaken;
+ }
}
// [EOF]
// Call parent constructor
parent::__construct($className);
- // Create unique ID number
- $this->createUniqueID();
-
// Clean up a little
$this->removeNumberFormaters();
$this->removeSystemArray();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("HTML-Formularhilfsklasse");
+ $this->setObjectDescription("Helper class for HTML forms");
+
+ // Create unique ID number
+ $this->createUniqueID();
}
/**
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class FileIOStream extends BaseFrameworkSystem implements FileInputStreamer, FileOutputStreamer {
+class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, FileOutputStreamer {
/**
* Protected constructor
*/
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Universal Datei-Ein-/Ausgabesystem");
+ $this->setObjectDescription("Universal file I/O stream system");
// Create unique ID
$this->createUniqueID();
* Create a file IO stream. This is a class for performing all actions
* on files like creating, deleting and loading them.
*
- * @return $ioInstance An instance of FileIOStream
+ * @return $ioInstance An instance of FileIoStream
*/
- public final static function createFileIOStream () {
+ public final static function createFileIoStream () {
// Create new instance
- $ioInstance = new FileIOStream();
+ $ioInstance = new FileIoStream();
// Return the instance
return $ioInstance;
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Verzeichnis-Handler");
+ $this->setObjectDescription("Helper for handling directories");
// Create unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Dateiausgabe-Handler");
+ $this->setObjectDescription("Handler for reading from files");
// Create unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Dateiausgabe-Handler");
+ $this->setObjectDescription("Handler for writing to files");
// Create unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Sprachsystem");
+ $this->setObjectDescription("Language sub-system");
// Create unique ID number
$this->createUniqueID();
/**
* Creates an instance of the class LanguageSystem and prepares it for usage
*
- * @param $basePath The local base path for all language strings
+ * @param $basePath The local base path for all language strings
* @return $langInstance An instance of LanguageSystem
* @throws LanguagePathIsEmptyException If the provided $basePath is empty
* @throws InvalidLanguagePathStringException If $basePath is no string
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Console-Ausgabe-Handler");
+ $this->setObjectDescription("Console output class");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set description
- $this->setObjectDescription("Web-Ausgabe-Handler");
+ $this->setObjectDescription("Class for web output e.g. XHTML code");
// Create an unique ID
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("HTTP-Anfrage");
+ $this->setObjectDescription("HTTP request");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Lokaler Kommandoauflöser");
+ $this->setObjectDescription("Resolver for local web commands");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("");
+ $this->setObjectDescription("Resolver for local web controllers");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("HTTP-Antwort");
+ $this->setObjectDescription("HTTP response");
// Create unique ID number
$this->createUniqueID();
parent::__construct(__CLASS__);
// Set part description
- $this->setObjectDescription("Template-Engine");
+ $this->setObjectDescription("Web template engine");
// Create unique ID number
$this->createUniqueID();
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A generic class for handling users
+ *
+ * @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/>.
+ */
+class User extends BaseFrameworkSystem implements ManageableUser {
+ /**
+ * Username
+ */
+ private $username = "";
+
+ // Exceptions
+ const EXCEPTION_USERNAME_NOT_FOUND = 0xd00;
+
+ /**
+ * Private constructor
+ *
+ * @return void
+ */
+ protected function __construct ($class = "") {
+ // Is the class name empty? Then this is not a specialized user class
+ if (empty($class)) $class = __CLASS__;
+
+ // Call parent constructor
+ parent::__construct($class);
+
+ // Set part description
+ $this->setObjectDescription("Generic user class");
+
+ // Create unique ID number
+ $this->createUniqueID();
+
+ // Clean up a little
+ $this->removeNumberFormaters();
+ $this->removeSystemArray();
+ }
+
+ /**
+ * Creates an instance of this user class by a provided username. This
+ * factory method will check if the username is already taken and if not
+ * so it will throw an exception.
+ *
+ * @param $username Username we need a class instance for
+ * @return $userInstance An instance of this user class
+ * @throws UsernameMissingException If the username does not exist
+ */
+ public final static function createUserByUsername ($userName) {
+ // Get a new instance
+ $userInstance = new User();
+
+ // Set the username
+ $userInstance->setUsername($userName);
+
+ // Check if the username exists
+ if (!$userInstance->ifUsernameExists()) {
+ // Throw an exception here
+ throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
+ }
+
+ // Return the instance
+ return $userInstance;
+ }
+
+ /**
+ * Setter for username
+ *
+ * @param $userName The username to set
+ * @return void
+ */
+ protected final function setUsername ($userName) {
+ $this->userNane = $userName;
+ }
+
+ /**
+ * Getter for username
+ *
+ * @return $userName The username to set
+ */
+ public final function getUsername () {
+ return $this->userNane;
+ }
+}
+
+// [EOF]
+?>
// CFG: DATABASE-TYPE
$cfg->defineDatabaseType('local');
+// CFG: LOCAL-DB-PATH
+$cfg->setConfigEntry('local_db_path', 'db/');
+
// CFG: TIME-ZONE
$cfg->setDefaultTimezone("Europe/Berlin");
// CFG: SELECTOR-GET
$cfg->setConfigEntry('app_selector_get', "app");
+// CFG: SELECTOR-PATH
+$cfg->setConfigEntry('selector_path', "selector");
+
// CFG: APPLICATION-HELPER
$cfg->setConfigEntry('app_helper_class', "ApplicationHelper");
-// CFG: SELECTOR-PATH
-$cfg->setConfigEntry('selector_path', "selector");
+// CFG: LAUNCH-METHOD
+$cfg->setConfigEntry('entry_method', "entryPoint");
// CFG: TEMPLATE-BASE-PATH
$cfg->setConfigEntry('tpl_base_path', "templates/"); // DON'T MISS THE TRAILING SLASH!
// CFG: META-DESCRIPTION
$cfg->setConfigEntry('meta_description', "A lame description for an application framework");
-// CFG: LAUNCH-METHOD
-$cfg->setConfigEntry('entry_method', "entryPoint");
-
// CFG: SELECTOR-MAIN-TEMPLATE
$cfg->setConfigEntry('selector_main_tpl', "selector_main");
// Zum Testen speichern wir in lokale Dateien (LocalFileDatabase)
try {
- $layer = LocalFileDatabase::createLocalFileDatabase(PATH . 'db/', FileIoHandler::getInstance());
+ $layer = LocalFileDatabase::createLocalFileDatabase(PATH . FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance());
} catch (SavePathIsEmptyException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Debug-Instanz konnte nicht gesetzt werden. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
$e->getMessage()
));
} catch (SavePathNotFoundException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Debug-Instanz konnte nicht gesetzt werden. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
$e->getMessage()
));
} catch (SavePathIsNoDirectoryException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Debug-Instanz konnte nicht gesetzt werden. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
$e->getMessage()
));
} catch (SavePathReadProtectedException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Debug-Instanz konnte nicht gesetzt werden. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
$e->getMessage()
));
} catch (SavePathWriteProtectedException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] Debug-Instanz konnte nicht gesetzt werden. Reason: <strong>%s</strong><br />\n",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong><br />\n",
$e->getMessage()
));
}