inc/classes.php -text
inc/classes/.htaccess -text
inc/classes/exceptions/.htaccess -text
+inc/classes/exceptions/auth/.htaccess -text
+inc/classes/exceptions/auth/class_UserAuthorizationException.php -text
+inc/classes/exceptions/class_ -text
inc/classes/exceptions/class_FrameworkException.php -text
inc/classes/exceptions/compressor/.htaccess -text
inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php -text
inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php -text
inc/classes/exceptions/database/wrapper/.htaccess -text
inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php -text
+inc/classes/exceptions/filter/.htaccess -text
+inc/classes/exceptions/filter/class_FilterChainException.php -text
inc/classes/exceptions/helper/.htaccess -text
inc/classes/exceptions/helper/class_FormClosedException.php -text
inc/classes/exceptions/helper/class_FormGroupClosedException.php -text
inc/classes/interfaces/.htaccess -text
inc/classes/interfaces/application/.htaccess -text
inc/classes/interfaces/application/class_ManageableApplication.php -text
+inc/classes/interfaces/auth/.htaccess -text
+inc/classes/interfaces/auth/class_Authorizeable.php -text
inc/classes/interfaces/cache/.htaccess -text
inc/classes/interfaces/cache/class_Cacheable.php -text
inc/classes/interfaces/class_ -text
inc/classes/interfaces/language/class_ManageableLanguage.php -text
inc/classes/interfaces/login/.htaccess -text
inc/classes/interfaces/login/class_LoginableUser.php -text
+inc/classes/interfaces/reader/.htaccess -text
+inc/classes/interfaces/reader/class_ReadableNews.php -text
inc/classes/interfaces/registration/.htaccess -text
inc/classes/interfaces/registration/class_UserRegister.php -text
inc/classes/interfaces/registry/.htaccess -text
inc/classes/main/actions/class_BaseAction.php -text
inc/classes/main/actions/post_registration/.htaccess -text
inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php -text
+inc/classes/main/auth/.htaccess -text
+inc/classes/main/auth/class_CookieAuth.php -text
inc/classes/main/cache/.htaccess -text
inc/classes/main/cache/class_MemoryCache.php -text
inc/classes/main/class_ -text
inc/classes/main/controller/default/class_WebDefaultNewsController.php -text
inc/classes/main/controller/form/.htaccess -text
inc/classes/main/controller/form/class_WebDoFormController.php -text
+inc/classes/main/controller/login/.htaccess -text
+inc/classes/main/controller/login/class_WebLoginAreaController.php -text
inc/classes/main/criteria/.htaccess -text
inc/classes/main/criteria/class_DataSetCriteria.php -text
inc/classes/main/criteria/class_SearchCriteria.php -text
inc/classes/main/factories/web/.htaccess -text
inc/classes/main/factories/web/class_WebNewsFactory.php -text
inc/classes/main/filter/.htaccess -text
+inc/classes/main/filter/auth/.htaccess -text
+inc/classes/main/filter/auth/class_UserAuthFilter.php -text
inc/classes/main/filter/checkboxes/.htaccess -text
inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php -text
inc/classes/main/filter/class_ -text
inc/classes/main/filter/class_AbstractFilterDecorator.php -text
+inc/classes/main/filter/class_BaseFilter.php -text
inc/classes/main/filter/class_FilterChain.php -text
inc/classes/main/filter/decorator/.htaccess -text
+inc/classes/main/filter/news/.htaccess -text
+inc/classes/main/filter/news/class_NewsDownloadFilter.php -text
+inc/classes/main/filter/news/class_NewsProcessFilter.php -text
inc/classes/main/filter/null/.htaccess -text
inc/classes/main/filter/null/class_NullFilter.php -text
inc/classes/main/filter/validator/.htaccess -text
inc/classes/main/io/class_FrameworkFileOutputPointer.php -text
inc/classes/main/language/.htaccess -text
inc/classes/main/language/class_LanguageSystem.php -text
-inc/classes/main/login/.htaccess -text
-inc/classes/main/login/class_CookieLogin.php -text
inc/classes/main/output/.htaccess -text
inc/classes/main/output/class_ConsoleOutput.php -text
inc/classes/main/output/class_WebOutput.php -text
+inc/classes/main/reader/.htaccess -text
+inc/classes/main/reader/class_DefaultNewsReader.php -text
inc/classes/main/registration/.htaccess -text
inc/classes/main/registration/class_BaseRegistration.php -text
inc/classes/main/registry/.htaccess -text
// Remember this template and the application for later usage
$this->loadedTemplates->append(array(
- 'tpl_engine' => $tplEngine,
+ 'template_class' => $tplEngine,
'app_instance' => $appInstance
));
}
} elseif (count($curr) != 2) {
// Not expected count of entries
throw new InvalidArrayCountException(array($this, "curr", count($curr), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
- } elseif (!isset($curr['tpl_engine']) || (!isset($curr['app_instance']))) {
+ } elseif (!isset($curr['template_class']) || (!isset($curr['app_instance']))) {
// Expected entries missing
- throw new MissingArrayElementsException(array($this, "curr", array('tpl_engine', 'app_instance')), self::EXCEPTION_ARRAY_ELEMENTS_MISSING);
+ throw new MissingArrayElementsException(array($this, "curr", array('template_class', 'app_instance')), self::EXCEPTION_ARRAY_ELEMENTS_MISSING);
}
die("<pre>".print_r($curr, true)."</pre>");
// Call user function
call_user_func_array(array($app, FrameworkConfiguration::getInstance()->readConfig('entry_method')), array());
} catch (FrameworkException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched for the follwing reason: <strong>%s</strong>",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> has been terminated due to a thrown exception: <strong>%s</strong>",
$application,
$e->getMessage()
));
// ... and a new response object
$responseInstance = HttpResponse::createHttpResponse($this);
- // Get command parameter
- $commandPara = $this->getConfigInstance()->readConfig('command_parameter');
-
// Get the parameter from the request
- $commandName = $requestInstance->getRequestElement($commandPara);
+ $commandName = $requestInstance->getRequestElement("page");
// If it is null then get default command
if (is_null($commandName)) {
$commandName = $this->getConfigInstance()->readConfig('default_command');
- }
+ } // END - if
// Get a resolver
$resolverInstance = WebControllerResolver::createWebControllerResolver($commandName, $this);
// CFG: CHAT-ENABLED-MSN
$cfg->setConfigEntry('chat_enabled_msn', "Y");
-// CFG: COMMAND-PARAMETER
-$cfg->setConfigEntry('command_parameter', "page");
-
// CFG: USER-REGISTRATION
-$cfg->setConfigEntry('user_registration', "ShipSimuRegistration");
+$cfg->setConfigEntry('user_registration_class', "ShipSimuRegistration");
// CFG: LOGIN-USER
-$cfg->setConfigEntry('login_user', "ShipSimuUserLogin");
+$cfg->setConfigEntry('user_login_class', "ShipSimuUserLogin");
// CFG: USER-STATUS-REGISTER
$cfg->setConfigEntry('user_status_register', "UNCONFIRMED");
// CFG: LOGIN-HELPER
-$cfg->setConfigEntry('login_helper', "ShipSimuLoginHelper");
+$cfg->setConfigEntry('login_helper_class', "ShipSimuLoginHelper");
// CFG: LOGIN-METHOD
-$cfg->setConfigEntry('login_method', "cookie");
+$cfg->setConfigEntry('auth_method_class', "CookieAuth");
// CFG: APP-LOGIN-URL
$cfg->setConfigEntry('app_login_url', "index.php?app=ship-simu&page=login_area");
+// CFG: LOGIN-DEFAULT-ACTION
+$cfg->setConfigEntry('login_default_action', "welcome");
+
+// CFG: NEWS-READER-CLASS
+$cfg->setConfigEntry('news_reader_class', "DefaultNewsReader");
+
+// CFG: NEWS-DOWNLOAD-FILTER
+$cfg->setConfigEntry('news_download_class', "NewsDownloadFilter");
+
+// CFG: NEWS-PROCESS-FILTER
+$cfg->setConfigEntry('news_process_class', "NewsProcessFilter");
+
+// CFG: USER-AUTH-FILTER
+$cfg->setConfigEntry('user_auth_class', "UserAuthFilter");
+
// [EOF]
?>
$controllerInstance = $resolverInstance->getControllerInstance();
// @TODO Add some more pre/post filters to the controller
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator'));
- $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
// Return the prepared instance
return $commandInstance;
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// First get a UserRegistration instance
- $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration');
+ $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration_class');
// First set request and response instance
$registerInstance->setRequestInstance($requestInstance);
* @param $requestInstance An instance of a Requestable class
* @param $responseInstance An instance of a Responseable class
* @return void
- * @throws UserLoginMethodException If wether username nor email login
+ * @throws UserAuthMethodException If wether username nor email login
* was detected
* @throws MissingMethodException If a method was not found in the
* User class
// Is a method detected?
if (is_null($method)) {
// Then abort here
- throw new UserLoginMethodException($this, self::EXCEPTION_MISSING_METHOD);
+ throw new UserAuthMethodException($this, self::EXCEPTION_MISSING_METHOD);
} elseif (!method_exists($this->getConfigInstance()->readConfig('user_class'), $method)) {
// The method is invalid!
throw new MissingMethodException(array($this, $method), self::EXCEPTION_MISSING_METHOD);
// Now do the real login. This can be cookie- or session-based login
// which depends on the admins setting then on the user's taste.
// 1) Get a login helper instance
- $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper', array($requestInstance));
+ $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper_class', array($requestInstance));
// 2) Execute the login. This will now login...
$helperInstance->executeLogin($responseInstance);
/**
* The login method we shall choose
*/
- private $loginMethod = "";
+ private $authMethod = "";
/**
* Instance for a request class
private $requestInstance = null;
// Exception constants
- const EXCEPTION_INVALID_USER_INSTANCE = 0xf00;
+ const EXCEPTION_INVALID_USER_INSTANCE = 0x080;
/**
* Protected constructor
throw new UserInstanceMissingException (array($helperInstance, 'user'), self::EXCEPTION_INVALID_USER_INSTANCE);
} // END - if
- // Get the login method from request
- $methodRequest = $requestInstance->getRequestElement('login_method');
-
- // Now, if that wents fine we can check if the request includes a login method entry
- if ((!is_null($methodRequest)) && ($methodRequest != "default") && ($methodRequest != $userInstance->getLoginMethod())) {
- // Okay, the login method has been choosen by user so remember it
- $helperInstance->setLoginMethod($methodRequest);
-
- // Remeber that we need to update the user account as well
- $userInstance->addUpdateData('login_method', $methodRequest);
- } elseif (($methodRequest == "default") && (is_string($userInstance->getLoginMethod()))) {
- // Choose default method from user
- $helperInstance->setLoginMethod($userInstance->getLoginMethod());
- } else {
- // Set default login method from config
- $helperInstance->setDefaultLoginMethod();
- }
+ // Set default login method from config
+ $helperInstance->setDefaultAuthMethod();
// Set request instance
$helperInstance->setRequestInstance($requestInstance);
*
* @return void
*/
- protected function setDefaultLoginMethod () {
- $this->loginMethod = $this->getConfigInstance()->readConfig('login_method');
+ protected function setDefaultAuthMethod () {
+ $this->authMethod = $this->getConfigInstance()->readConfig('auth_method_class');
}
/**
* @return void
*/
public function executeLogin (Responseable $responseInstance) {
- // First create the requested login method name
- $loginMethodClass = ucfirst(strtolower($this->loginMethod)) . "Login";
-
- // Then try to get an instance from it
- $loginInstance = ObjectFactory::createObjectByName($loginMethodClass, array($responseInstance));
+ // Get an instance from the login method
+ $loginInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance));
// Set user cookie
$loginInstance->setUserAuth($this->requestInstance->getRequestElement('username'));
// 1.: Get the plain password
$plainPassword = $this->getRequestInstance()->getRequestElement($requestKey);
// 2. Get a crypto helper and hash the password
- $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_heler')->hashPassword($plainPassword);
+ $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashPassword($plainPassword);
// 3. Store the hash back in the request
$this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword);
}
*/
public function registerNewUser () {
// Get a user database wrapper
- $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper');
+ $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
// Use this instance to insert the whole registration instance
$wrapperInstance->insertRegistrationObject($this);
*/
public function doPostAction () {
// Get an action instance from our factory
- $actionInstance = ObjectFactory::createObjectByConfiguredName('post_registration_action');
+ $actionInstance = ObjectFactory::createObjectByConfiguredName('post_registration_class');
// Execute the action
$actionInstance->execute($this->getRequestInstance(), $this->getResponseInstance());
// Call user function
call_user_func_array(array($app, FrameworkConfiguration::getInstance()->readConfig('entry_method')), array());
} catch (FrameworkException $e) {
- ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched for the follwing reason: <strong>%s</strong>",
+ ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> has been terminated due to a thrown exception: <strong>%s</strong>",
$application,
$e->getMessage()
));
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @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 UserAuthorizationException extends FrameworkException {
+ /**
+ * The super constructor for all exceptions
+ *
+ * @param $filterInstance An instance of the filter throwing this exception
+ * @param $code Error code
+ * @return void
+ */
+ public function __construct(Filterable $filterInstance, $code) {
+ // Construct the message
+ $message = sprintf("[%s:%d] Authorization has failed. Error code <u>%s</u>",
+ $filterInstance->__toString(),
+ $this->getLine(),
+ $this->getHexCode($code)
+ );
+
+ // Call parent exception constructor
+ parent::__construct($message, $code);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @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 ???Exception extends FrameworkException {
+ /**
+ * The super constructor for all exceptions
+ *
+ * @param $message Error message
+ * @param $code Error code
+ * @return void
+ */
+ public function __construct($message, $code) {
+ // Call parent exception constructor
+ parent::__construct($message, $code);
+ }
+}
+
+// [EOF]
+?>
$message = (string) $message;
$code = (int) $code;
- // make sure everything is assigned properly
+ // Make sure everything is assigned properly
parent::__construct($message, $code);
}
/**
* Getter for hex-decimal code
*
+ * @param $code Integer code to encode in hex
* @return $hexCode The exception code in hex-decimal format
*/
- public final function getHexCode () {
+ public final function getHexCode ($code = null) {
// Get the decimal code
- $code = $this->getCode();
+ if (is_null($code)) $code = $this->getCode();
// Format it to hex-decimal, 0x as prefix and 3 chars
$hexCode = sprintf("0x%03s", dechex($code));
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An exception thrown in a filter chain to stop processing further filters
+ *
+ * @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 FilterChainException extends FrameworkException {
+ /**
+ * The super constructor for all exceptions
+ *
+ * @param $filterInstance Instance of a filter class
+ * @param $code Exception code for better debugging
+ * @return void
+ */
+ public function __construct(Filterable $filterInstance, $code) {
+ // Construct the message
+ $message = sprintf("[%s:%d] Filter chain interruppted by fatal error in filter.",
+ $filterInstance->__toString(),
+ $this->getLine()
+ );
+
+ // Call the parent exception
+ parent::__construct($message, $code);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for authorization methods
+ *
+ * @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/>.
+ */
+interface Authorizeable extends FrameworkInterface {
+ /**
+ * Destroy the authorization data
+ *
+ * @return void
+ */
+ function destroyAuthData();
+}
+
+//
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for news reader
+ *
+ * @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/>.
+ */
+interface ReadableNews extends FrameworkInterface {
+ /**
+ * Initializes the news reader class. This is very reader-dependent
+ *
+ * @return void
+ */
+ function initializeReader();
+}
+
+//
+?>
* @return void
*/
function requestIsValid ($isValid = true);
+
+ /**
+ * Reads a cookie and returns it's value or null if not found
+ *
+ * @param $cookieName Name of cookie we shall read
+ * @return $cookieValue Value of cookie or null if not found
+ */
+ function readCookie ($cookieName);
}
//
* @throws ResponseHeadersAlreadySentException If headers are already sent
*/
function redirectToConfiguredUrl ($configEntry);
+
+ /**
+ * Expires the given cookie if it is set
+ *
+ * @param $cookieName Cookie to expire
+ * @return void
+ */
+ function expireCookie ($cookieName);
}
//
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get a login class from factory
- $loginInstance = ObjectFactory::createObjectByConfiguredName('login_user');
+ $loginInstance = ObjectFactory::createObjectByConfiguredName('user_login_class');
// Login the user by the request instance
$loginInstance->doLogin($requestInstance, $responseInstance);
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A cookie-bases authorization class
+ *
+ * @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 CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Cookie-based login");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Clean up a little
+ $this->removeNumberFormaters();
+ $this->removeSystemArray();
+ }
+
+ /**
+ * Creates an instance of this class by the given response instance
+ *
+ * @param $responseInstance An instance of a Responseable class
+ * @return $loginInstance An instance of this login class
+ */
+ public final static function createCookieAuth (Responseable $responseInstance) {
+ // Get a new instance
+ $loginInstance = new CookieAuth();
+
+ // Set the response instance
+ $loginInstance->setResponseInstance($responseInstance);
+
+ // Return the prepared instance
+ return $loginInstance;
+ }
+
+ /**
+ * "Setter" for username auth data
+ *
+ * @param $userName The username from request we shall set
+ * @return void
+ */
+ public function setUserAuth ($userName) {
+ $this->getResponseInstance()->addCookie('username', $userName);
+ }
+
+ /**
+ * "Setter" for password hash auth data
+ *
+ * @param $passHash The hashed password from request we shall set
+ * @return void
+ */
+ public function setPasswordAuth ($passHash) {
+ $this->getResponseInstance()->addCookie('u_hash', $passHash, true);
+ }
+
+ /**
+ * Getter for user auth cookie
+ *
+ * @return $userName Username to get from cookie
+ */
+ public function getUserAuth () {
+ // Get the username from cookie
+ $userName = $this->getRequestInstance()->readCookie('username');
+
+ // Return the username
+ return $userName;
+ }
+
+ /**
+ * Getter for password hash auth cookie
+ *
+ * @return $passHash Password hash to get from cookie
+ */
+ public function getPasswordAuth () {
+ // Get the username from cookie
+ $passHash = $this->getRequestInstance()->readCookie('u_hash');
+
+ // Return the username
+ return $passHash;
+ }
+
+ /**
+ * Destroy the authorization data
+ *
+ * @return void
+ */
+ public function destroyAuthData () {
+ // Expire both cookies
+ $this->getResponseInstance()->expireCookie('username');
+ $this->getResponseInstance()->expireCookie('u_hash');
+ }
+}
+
+// [EOF]
+?>
* The language instance for the template loader
*/
private static $langInstance = null;
+ /**
+ * Instance of a request class
+ */
+ private $requestInstance = null;
+
+ /**
+ * Instance of a response class
+ */
+ private $responseInstance = null;
/**
* The real class name
$this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class');
// Set debug instance
- $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig('debug_engine')));
+ $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig('debug_class')));
// Get output instance and set it
$outputInstance = ObjectFactory::createObjectByConfiguredName('web_engine', array($this->getConfigInstance()->readConfig('web_content_type')));
self::$applicationInstance = $applicationInstance;
}
+ /**
+ * Setter for request instance
+ *
+ * @param $requestInstance An instance of a Requestable class
+ * @return void
+ */
+ public final function setRequestInstance (Requestable $requestInstance) {
+ $this->requestInstance = $requestInstance;
+ }
+
+ /**
+ * Getter for request instance
+ *
+ * @return $requestInstance An instance of a Requestable class
+ */
+ public final function getRequestInstance () {
+ return $this->requestInstance;
+ }
+
+ /**
+ * Setter for response instance
+ *
+ * @param $responseInstance An instance of a Responseable class
+ * @return void
+ */
+ public final function setResponseInstance (Responseable $responseInstance) {
+ $this->responseInstance = $responseInstance;
+ }
+
+ /**
+ * Getter for response instance
+ *
+ * @return $responseInstance An instance of a Responseable class
+ */
+ public final function getResponseInstance () {
+ return $this->responseInstance;
+ }
+
/**
* Getter for $realClass
*
}
// Initialize the template engine
- $tplEngine = ObjectFactory::createObjectByConfiguredName('tpl_engine', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
+ $tplEngine = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
// Return the prepared instance
return $tplEngine;
* @return $className Generated class name
*/
public function convertToClassName ($str) {
+ // Init class name
$className = "";
+
+ // Convert all dashes in underscores
+ $str = str_replace("-", "_", $str);
+
+ // Now use that underscores to get classname parts for hungarian style
foreach (explode("_", $str) as $strPart) {
+ // Make the class name part lower case and first upper case
$className .= ucfirst(strtolower($strPart));
- }
+ } // END - foreach
+
+ // Return class name
return $className;
}
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // TODO Add basic check on authorization data here
-
// Default action is the one from configuration
$action = sprintf("login_%s", $this->getConfigInstance()->readConfig('login_default_action'));
$this->removeSystemArray();
// Initialize both filter chains
- $this->preFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain');
- $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain');
+ $this->preFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+ $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
}
/**
// Set the command resolver
$controllerInstance->setResolverInstance($resolverInstance);
+ // Add news filters to this controller
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class'));
+
// Return the prepared instance
return $controllerInstance;
}
* @return void
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+ // Run the pre filters
+ $this->executePreFilters($requestInstance, $responseInstance);
+
// Get the command instance from the resolver by sending a request instance to the resolver
$commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
- // Load the news here
- $this->loadNewsByRequest($requestInstance);
-
// This request was valid! :-D
$requestInstance->requestIsValid();
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
+ // Run the pre filters
+ $this->executePostFilters($requestInstance, $responseInstance);
+
// Flush the response out
$responseInstance->flushBuffer();
}
-
- /**
- * Loads news by a given request
- *
- * @param $requestInstance An instance of a request class
- * @return void
- */
- private function loadNewsByRequest (Requestable $requestInstance) {
- // Generate a new news object but not carring about which concrete we have
- $newsInstance = WebNewsFactory::createFactoryByRequest($requestInstance)->createNewsObject();
- }
}
// [EOF]
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * Controller for login area with news
+ *
+ * @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 WebLoginAreaController extends BaseController implements Controller {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Default controller with news");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $resolverInstance An instance of a command resolver class
+ * @return $controllerInstance A prepared instance of this class
+ */
+ public final static function createWebLoginAreaController (CommandResolver $resolverInstance) {
+ // Create the instance
+ $controllerInstance = new WebLoginAreaController();
+
+ // Set the command resolver
+ $controllerInstance->setResolverInstance($resolverInstance);
+
+ // Add some filters to this controller
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class'));
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class'));
+
+ // Return the prepared instance
+ return $controllerInstance;
+ }
+
+ /**
+ * Handles the given request and response
+ *
+ * @param $requestInstance An instance of a request class
+ * @param $responseInstance An instance of a response class
+ * @return void
+ */
+ public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+ // Run the pre filters
+ $this->executePreFilters($requestInstance, $responseInstance);
+
+ // Get the command instance from the resolver by sending a request instance to the resolver
+ $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+
+ // This request was valid! :-D
+ $requestInstance->requestIsValid();
+
+ // Execute the command
+ $commandInstance->execute($requestInstance, $responseInstance);
+
+ // Run the pre filters
+ $this->executePostFilters($requestInstance, $responseInstance);
+
+ // Flush the response out
+ $responseInstance->flushBuffer();
+ }
+}
+
+// [EOF]
+?>
*/
abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface, LimitableObject {
// Constants for exceptions
- const EXCEPTION_SQL_QUERY = 0xc00;
+ const EXCEPTION_SQL_QUERY = 0x050;
/**
* The limiter instance
class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontendInterface {
// Constants for MySQL backward-compatiblity (PLEASE FIX THEM!)
- const DB_CODE_TABLE_MISSING = 0x000;
- const DB_CODE_TABLE_UNWRITEABLE = 0x001;
+ const DB_CODE_TABLE_MISSING = 0x010;
+ const DB_CODE_TABLE_UNWRITEABLE = 0x011;
/**
* Save path for "file database"
private $cacheInstance = null;
// Constants for exceptions
- const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0xe00;
+ const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x070;
// Constants for database columns
const DB_COLUMN_USERNAME = "username";
*/
public function insertRegistrationObject (UserRegister $registrationInstance) {
// Generate a data set for the request
- $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria');
+ $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class');
$dataSetInstance->setTableName(self::DB_TABLE_USER);
// Add registration elements to the dataset
*/
public function createConfiguredCache () {
// Read the config entry
- $cacheType = $this->getConfigInstance()->readConfig("cache_type");
+ $cacheType = $this->getConfigInstance()->readConfig("cache_class");
// And get a new instance
$cacheInstance = ObjectFactory::createObjectByName($cacheType);
* @throws EmptyVariableException If a variable is empty unexpectly
*/
public final static function createObjectByName ($className, array $args=array()) {
- // First get an instance of this factory
- $factoryInstance = new ObjectFactory();
-
// Is the class name valid and is the class there?
if (empty($className)) {
+ // First get an instance of this factory
+ $factoryInstance = new ObjectFactory();
+
// Throw an exception here
throw new EmptyVariableException(array($factoryInstance, 'className'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (!class_exists($className)) {
+ // First get an instance of this factory
+ $factoryInstance = new ObjectFactory();
+
// Then throw an exception
throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND);
}
* @return $factoryInstance An instance of a WebNewsFactory class
*/
public final static function createFactoryByRequest (Requestable $requestInstance) {
- // Generate the new instance
- $factoryInstance = new WebNewsFactory();
-
- // 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();
+ // Get the news reader class name from config
+ $className = $requestInstance->getConfigInstance()->readConfig('news_reader_class');
// Once we have that name, try to load initialize it
- $realFactoryInstance = ObjectFactory::createObjectByName($className);
-
- // And assign it with the factory
- $factoryInstance->setRealFactoryInstance($realFactoryInstance);
+ $newsInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
- // Remember the request we have used for later usage
- $factoryInstance->setRequestInstance($requestInstance);
+ // Initialize the reader
+ $newsInstance->initializeReader();
// 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;
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A filter for checking user permissions
+ *
+ * @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 UserAuthFilter extends BaseFilter implements Filterable {
+ // Exception constants
+ const EXCEPTION_AUTH_DATA_INVALID = 0x0a0;
+
+ /**
+ * The login method we shall choose
+ */
+ private $authMethod = "";
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("A user authorization filter");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createUserAuthFilter () {
+ // Get a new instance
+ $filterInstance = new UserAuthFilter();
+
+ // Set default auth method
+ $filterInstance->setDefaultAuthMethod();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Setter for default login method from config
+ *
+ * @return void
+ */
+ protected function setDefaultAuthMethod () {
+ $this->authMethod = $this->getConfigInstance()->readConfig('auth_method_class');
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ * @throws UserAuthorizationException If the auth login was not found or if it was invalid
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Then get an auth instance for checking and updating the auth cookies
+ $authInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance));
+
+ // Set request instance
+ $authInstance->setRequestInstance($requestInstance);
+
+ // Now, get the auth data for comparison
+ $authLogin = $authInstance->getUserAuth();
+ $authHash = $authInstance->getPasswordAuth();
+
+ // If one is empty stop here
+ if ((empty($authLogin)) || (empty($authHash))) {
+ // Destroy the auth data
+ $authInstance->destroyAuthData();
+
+ // Mark the request as invalid
+ $requestInstance->requestIsValid(false);
+
+ // Add fatal message
+ $responseInstance->addFatalMessage('auth_data_incomplete');
+
+ // Stop here
+ throw new UserAuthorizationException($this, self::EXCEPTION_AUTH_DATA_INVALID);
+ }
+
+ // Destroy safely the auth instance
+ unset($authInstance);
+ }
+}
+
+// [EOF]
+?>
* 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 RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable {
+class RulesAcceptedFilter extends BaseFilter implements Filterable {
/**
* Protected constructor
*
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
// Add a message to the response
$responseInstance->addFatalMessage('rules_unchecked');
- // Abort here
+ // Skip further processing
return false;
}
}
--- /dev/null
+<?php
+/**
+ * A general filter class
+ *
+ * @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 BaseFilter extends BaseFrameworkSystem {
+ // Exception constants
+ const EXCEPTION_FILTER_CHAIN_ABORTED = 0x090;
+
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the filter class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+
+ // Clean up a little
+ $this->removeNumberFormaters();
+ $this->removeSystemArray();
+ }
+}
+
+// [EOF]
+?>
// Run all filters
//* DEBUG */ echo "COUNT=".count($this->filters)."<br />\n";
foreach ($this->filters as $filterInstance) {
- // Execute this filter
- //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing started.<br />\n";
+ // Try to execute this filter
+ try {
+ //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing started.<br />\n";
$filterInstance->execute($requestInstance, $responseInstance);
- //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing ended.<br />\n";
- }
+ //* DEBUG */ echo "FILTER: ".$filterInstance->__toString().": Processing ended.<br />\n";
+ } catch (FilterChainException $e) {
+ // This exception can be thrown to just skip any further processing
+ break;
+ }
+ } // END - foreach
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A pre-filter for downloading news from a source. This can be a XML feed or
+ * the local database. You *can* register this filter as post filter but for
+ * output on web pages it makes no sense.
+ *
+ * @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 NewsDownloadFilter extends BaseFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("A filter for downloading news");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createNewsDownloadFilter () {
+ // Get a new instance
+ $filterInstance = new NewsDownloadFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ // Get a news instance
+ $newsInstance = WebNewsFactory::createFactoryByRequest($requestInstance);
+
+ // TODO Need to extend/rewrite this
+ $this->partialStub("Unfinished work.");
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A post-filter for processing downloaded news. This will prepare the news fir
+ * output to the template engine.
+ *
+ * @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 NewsProcessFilter extends BaseFilter implements Filterable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("A filter for processing news");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+ }
+
+ /**
+ * Creates an instance of this filter class
+ *
+ * @return $filterInstance An instance of this filter class
+ */
+ public final static function createNewsProcessFilter () {
+ // Get a new instance
+ $filterInstance = new NewsProcessFilter();
+
+ // Return the instance
+ return $filterInstance;
+ }
+
+ /**
+ * Executes the filter with given request and response objects
+ *
+ * @param $requestInstance An instance of a class with an Requestable interface
+ * @param $responseInstance An instance of a class with an Responseable interface
+ * @return void
+ */
+ public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+ $this->partialStub("Unfinished work.");
+ }
+}
+
+// [EOF]
+?>
* 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 NullFilter extends BaseFrameworkSystem implements Filterable {
+class NullFilter extends BaseFilter implements Filterable {
/**
* Protected constructor
*
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
* 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 EmailValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class EmailValidatorFilter extends BaseFilter implements Filterable {
/**
* Protected constructor
*
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
* 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 PasswordValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class PasswordValidatorFilter extends BaseFilter implements Filterable {
/**
* Protected constructor
*
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
* 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 UserNameValidatorFilter extends BaseFrameworkSystem implements Filterable {
+class UserNameValidatorFilter extends BaseFilter implements Filterable {
/**
* Protected constructor
*
// Create unique ID number
$this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
private $subGroupName = "";
// Class Constants
- const EXCEPTION_FORM_NAME_INVALID = 0xb00;
- const EXCEPTION_CLOSED_FORM = 0xb01;
- const EXCEPTION_OPENED_FORM = 0xb02;
- const EXCEPTION_UNEXPECTED_CLOSED_GROUP = 0xb03;
+ const EXCEPTION_FORM_NAME_INVALID = 0x030;
+ const EXCEPTION_CLOSED_FORM = 0x031;
+ const EXCEPTION_OPENED_FORM = 0x032;
+ const EXCEPTION_UNEXPECTED_CLOSED_GROUP = 0x033;
/**
* Protected constructor
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * A cookie-bases login class
- *
- * @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 CookieLogin extends BaseFrameworkSystem implements Registerable {
- /**
- * Response instance
- */
- private $responseInstance = null;
-
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set part description
- $this->setObjectDescription("Cookie-based login");
-
- // Create unique ID number
- $this->generateUniqueId();
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
- }
-
- /**
- * Creates an instance of this class by the given response instance
- *
- * @param $responseInstance An instance of a Responseable class
- * @return $loginInstance An instance of this login class
- */
- public final static function createCookieLogin (Responseable $responseInstance) {
- // Get a new instance
- $loginInstance = new CookieLogin();
-
- // Set the response instance
- $loginInstance->setResponseInstance($responseInstance);
-
- // Return the prepared instance
- return $loginInstance;
- }
-
- /**
- * Setter for login instance
- *
- * @param $responseInstance An instance of a Responseable class
- * @return void
- */
- protected final function setResponseInstance (Responseable $responseInstance) {
- $this->responseInstance = $responseInstance;
- }
-
- /**
- * "Setter" for username auth data
- *
- * @param $userName The username from request we shall set
- * @return void
- */
- public function setUserAuth ($userName) {
- $this->responseInstance->addCookie('username', $userName);
- }
-
- /**
- * "Setter" for password hash auth data
- *
- * @param $passHash The hashed password from request we shall set
- * @return void
- */
- public function setPasswordAuth ($passHash) {
- $this->responseInstance->addCookie('u_hash', $passHash, true);
- }
-}
-
-// [EOF]
-?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A default news reader class reads news from database layer
+ *
+ * @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 DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set part description
+ $this->setObjectDescription("Default news reader");
+
+ // Create unique ID number
+ $this->generateUniqueId();
+
+ // Clean up a little
+ $this->removeNumberFormaters();
+ $this->removeSystemArray();
+ }
+
+ /**
+ * Creates an instance of this reader by a provided request instance
+ *
+ * @param $requestInstance An instance of a Requestable class
+ * @return $readerInstance An instance of this reader class
+ */
+ public final static function createDefaultNewsReader (Requestable $requestInstance) {
+ // Get a new instance
+ $readerInstance = new DefaultNewsReader();
+
+ // Set request instance
+ $readerInstance->setRequestInstance($requestInstance);
+
+ // Return prepared instance
+ return $readerInstance;
+ }
+
+ /**
+ * Initializes this reader class by pre-fetching news depending on "page"
+ * (outside or login area), which amount of news and how much to skip
+ *
+ * @return void
+ */
+ public function initializeReader () {
+ // TODO Need to implement this method
+ }
+}
+
+// [EOF]
+?>
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseRegistration extends BaseFrameworkSystem implements UserRegister {
- /**
- * Instance of a request class
- */
- private $requestInstance = null;
-
- /**
- * Instance of a response class
- */
- private $responseInstance = null;
-
/**
* Pre-registration filter chain
*/
*/
protected function initFilterChains () {
// Pre/post-registration filters
- $this->preRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain');
- $this->postRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain');
- }
-
- /**
- * Setter for request instance
- *
- * @param $requestInstance An instance of a Requestable class
- * @return void
- */
- public final function setRequestInstance (Requestable $requestInstance) {
- $this->requestInstance = $requestInstance;
- }
-
- /**
- * Getter for request instance
- *
- * @return $requestInstance An instance of a Requestable class
- */
- public final function getRequestInstance () {
- return $this->requestInstance;
- }
-
- /**
- * Setter for response instance
- *
- * @param $responseInstance An instance of a Responseable class
- * @return void
- */
- public final function setResponseInstance (Responseable $responseInstance) {
- $this->responseInstance = $responseInstance;
- }
-
- /**
- * Getter for response instance
- *
- * @return $responseInstance An instance of a Responseable class
- */
- public final function getResponseInstance () {
- return $this->responseInstance;
+ $this->preRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
+ $this->postRegistrationFilter = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
}
/**
if (!isset($this->requestData[$element])) {
// Then throw an exception
throw new MissingArrayElementsException(array($this, 'requestData', $element), self::EXCEPTION_MISSING_ELEMENT);
- }
+ } // END - if
// All clear
return true;
try {
if ($this->isRequestElementSet($element)) {
$value = $this->requestData[$element];
- }
+ } // END - if
} catch (MissingArrayElementsException $e) {
// Do nothing here
}
// Does this header exist?
if (isset($_SERVER[$name])) {
$headerValue = $_SERVER[$name];
- }
+ } // END - if
// Return the value
return $headerValue;
/**
* Sets wether the request was valid (default: true)
*
- * @param $isValid Wether the request is valid
+ * @param $isValid Wether the request is valid
* @return void
*/
public final function requestIsValid ($isValid = true) {
public final function isRequestValid () {
return $this->requestIsValid;
}
+
+ /**
+ * Reads a cookie and returns it's value or null if not found
+ *
+ * @param $cookieName Name of cookie we shall read
+ * @return $cookieValue Value of cookie or null if not found
+ */
+ public final function readCookie ($cookieName) {
+ // Default is no cookie with that name found
+ $cookieValue = null;
+
+ // Is the cookie set?
+ if (isset($_COOKIE[$cookieName])) {
+ // Then get it
+ $cookieValue = $_COOKIE[$cookieName];
+ } // END - if
+
+ // Return the value
+ return $cookieValue;
+ }
}
// [EOF]
// Still not found?
throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND);
}
- }
+ } // END - if
// Initiate the command
$commandInstance = ObjectFactory::createObjectByName($className, array($this));
}
/**
- * "Loads" a given controller and instances it if not yet cached
+ * "Loads" a given controller and instances it if not yet cached. If the
+ * controller was not found one of the default controllers will be used
+ * depending on wether news shall be displayed.
*
* @param $commandName A controller name we shall look for
* @return $controllerInstance A loaded controller instance
$class = "WebDefaultController";
// Generate the class name
+ //* DEBUG: */ echo __METHOD__.": Command=".$commandName;
if ($commandName != $defaultCommand) {
// Create controller class name
$class = sprintf("Web%sController",
// No nes at "home" page
$class = "WebDefaultController";
}
+ //* DEBUG: */ echo ", controller=".$class."<br />\n";
// Is this class loaded?
if (!class_exists($class)) {
} // END - if
// Initiate the resolver and controller
- $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver', array($commandName, $this->getApplicationInstance()));
+ $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver_class', array($commandName, $this->getApplicationInstance()));
$controllerInstance = ObjectFactory::createObjectByName($class, array($resolverInstance));
// Remove resolver
* @param $cookieName Cookie's name
* @param $cookieValue Value to store in the cookie
* @param $encrypted Do some extra encryption on the value
+ * @param $expires Timestamp of expiration (default: configured)
* @return void
* @throws ResponseHeadersAlreadySentException If headers are already sent
*/
- public function addCookie ($cookieName, $cookieValue, $encrypted = false) {
+ public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
// Are headers already sent?
if (headers_sent()) {
// Throw an exception here
// For slow browsers set the cookie array element first
$_COOKIE[$cookieName] = $cookieValue;
- // Get a config entries
- $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
+ // Get all config entries
+ if (is_null($expires)) {
+ $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
+ } // END - if
+
$path = $this->getConfigInstance()->readConfig('cookie_path');
$domain = $this->getConfigInstance()->readConfig('cookie_domain');
// All done here...
exit();
}
+
+ /**
+ * Expires the given cookie if it is set
+ *
+ * @param $cookieName Cookie to expire
+ * @return void
+ */
+ public function expireCookie ($cookieName) {
+ // Is the cookie there?
+ if (isset($_COOKIE[$cookieName])) {
+ // Then expire it with 20 minutes past
+ $this->addCookie($cookieName, "", false, (time() - 1200));
+
+ // Remove it from array
+ unset($_COOKIE[$cookieName]);
+ } // END - if
+ }
}
// [EOF]
private $helpers = array();
// Exception codes for the template engine
- const EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED = 0xa00;
- const EXCEPTION_TEMPLATE_CONTAINS_INVALID_VAR = 0xa01;
- const EXCEPTION_INVALID_VIEW_HELPER = 0xa02;
+ const EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED = 0x020;
+ const EXCEPTION_TEMPLATE_CONTAINS_INVALID_VAR = 0x021;
+ const EXCEPTION_INVALID_VIEW_HELPER = 0x022;
/**
* Protected constructor
private $email = "";
// Exceptions
- const EXCEPTION_USERNAME_NOT_FOUND = 0xd00;
- const EXCEPTION_USER_EMAIL_NOT_FOUND = 0xd01;
- const EXCEPTION_USER_PASS_MISMATCH = 0xd02;
+ const EXCEPTION_USERNAME_NOT_FOUND = 0x060;
+ const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x061;
+ const EXCEPTION_USER_PASS_MISMATCH = 0x062;
/**
* Protected constructor
$exists = false;
// Get a UserDatabaseWrapper instance
- $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper');
+ $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
// Create a search criteria
- $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria');
+ $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
// Add the username as a criteria and set limit to one entry
$criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUsername());
$exists = false;
// Get a UserDatabaseWrapper instance
- $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper');
+ $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
// Create a search criteria
- $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria');
+ $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
// Add the username as a criteria and set limit to one entry
$criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_EMAIL, $this->getEmail());
$matches = false;
// Get a UserDatabaseWrapper instance
- $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper');
+ $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
// Create a search criteria
- $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria');
+ $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
// Add the username as a criteria and set limit to one entry
$criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
$ioHandler = new FileIoHandler();
// Set the *real* file IO instances (both the same)
- $ioHandler->setInputStream(ObjectFactory::createObjectByConfiguredName('file_input_stream'));
- $ioHandler->setOutputStream(ObjectFactory::createObjectByConfiguredName('file_output_stream'));
+ $ioHandler->setInputStream(ObjectFactory::createObjectByConfiguredName('file_input_class'));
+ $ioHandler->setOutputStream(ObjectFactory::createObjectByConfiguredName('file_output_class'));
// Return instance
return $ioHandler;
// CFG: CODE-TEMPLATE-EXTENSION
$cfg->setConfigEntry('code_template_extension', ".ctp");
-// CFG: SELECTOR-GET
-$cfg->setConfigEntry('app_selector_get', "app");
-
// CFG: SELECTOR-PATH
$cfg->setConfigEntry('selector_path', "selector");
$cfg->setConfigEntry('compile_output_path', "templates/_compiled/"); // DON'T MISS THE TRAILING SLASH!
// CFG: TEMPLATE-ENGINE
-$cfg->setConfigEntry('tpl_engine', "TemplateEngine");
+$cfg->setConfigEntry('template_class', "TemplateEngine");
// CFG: DEBUG-ENGINE
-$cfg->setConfigEntry('debug_engine', "DebugWebOutput");
+$cfg->setConfigEntry('debug_class', "DebugWebOutput");
// CFG: DEFAULT-LANGUAGE
$cfg->setConfigEntry('default_lang', "de"); // A two-char language string: de for german, en for english and so on
$cfg->setConfigEntry('verbose_level', 0);
// CFG: CACHE-TYPE
-$cfg->setConfigEntry('cache_type', "MemoryCache");
+$cfg->setConfigEntry('cache_class', "MemoryCache");
// CFG: SEARCH-CRITERIA
-$cfg->setConfigEntry('search_criteria', "SearchCriteria");
+$cfg->setConfigEntry('search_criteria_class', "SearchCriteria");
// CFG: DATASET-CRITERIA
-$cfg->setConfigEntry('dataset_criteria', "DataSetCriteria");
+$cfg->setConfigEntry('dataset_criteria_class', "DataSetCriteria");
// CFG: FILE-IO-HANDLER
-$cfg->setConfigEntry('file_io_handler', "FileIoHandler");
+$cfg->setConfigEntry('file_io_class', "FileIoHandler");
// CFG: FILTER-CHAIN
-$cfg->setConfigEntry('filter_chain', "FilterChain");
+$cfg->setConfigEntry('filter_chain_class', "FilterChain");
// CFG: FILE-INPUT-STREAM
-$cfg->setConfigEntry('file_input_stream', "FileIoStream");
+$cfg->setConfigEntry('file_input_class', "FileIoStream");
// CFG: FILE-OUTPUT-STREAM
-$cfg->setConfigEntry('file_output_stream', "FileIoStream");
+$cfg->setConfigEntry('file_output_class', "FileIoStream");
// CFG: EMAIL-VALIDATOR
-$cfg->setConfigEntry('email_validator', "EmailValidatorFilter");
+$cfg->setConfigEntry('email_validator_class', "EmailValidatorFilter");
// CFG: USERNAME-VALIDATOR
-$cfg->setConfigEntry('username_validator', "UserNameValidatorFilter");
+$cfg->setConfigEntry('username_validator_class', "UserNameValidatorFilter");
// CFG: PASSWORD-VALIDATOR
-$cfg->setConfigEntry('password_validator', "PasswordValidatorFilter");
+$cfg->setConfigEntry('password_validator_class', "PasswordValidatorFilter");
// CFG: RULES-ACCEPTED-FILTER
-$cfg->setConfigEntry('rules_accepted_filter', "RulesAcceptedFilter");
+$cfg->setConfigEntry('rules_accepted_class', "RulesAcceptedFilter");
// CFG: CRYPTO-HELPER
-$cfg->setConfigEntry('crypto_heler', "CryptoHelper");
+$cfg->setConfigEntry('crypto_class', "CryptoHelper");
// CFG: RNG-CLASS
$cfg->setConfigEntry('rng_class', "RandomNumberGenerator");
// CFG: USER-DB-WRAPPER
-$cfg->setConfigEntry('user_db_wrapper', "UserDatabaseWrapper");
+$cfg->setConfigEntry('user_db_wrapper_class', "UserDatabaseWrapper");
// CFG: WEB-CMD-RESOLVER
-$cfg->setConfigEntry('web_cmd_resolver', "WebCommandResolver");
+$cfg->setConfigEntry('web_cmd_resolver_class', "WebCommandResolver");
// CFG: MATH-PRIME
$cfg->setConfigEntry('math_prime', 591623);
$cfg->setConfigEntry('is_single_server', "Y");
// CFG: POST-REGISTRATION-ACTION
-$cfg->setConfigEntry('post_registration_action', "LoginAfterRegistrationAction");
+$cfg->setConfigEntry('post_registration_class', "LoginAfterRegistrationAction");
// CFG: USER-CLASS
$cfg->setConfigEntry('user_class', "User");
private static $cfgInstance = null;
// Some constants for the configuration system
- const EXCEPTION_CONFIG_ENTRY_IS_EMPTY = 0xc00;
- const EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND = 0xc01;
+ const EXCEPTION_CONFIG_ENTRY_IS_EMPTY = 0x040;
+ const EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND = 0x041;
/**
* Protected constructor
*/
// Get the instance
-$io = ObjectFactory::createObjectByConfiguredName('file_io_handler');
+$io = ObjectFactory::createObjectByConfiguredName('file_io_class');
// [EOF]
?>
require(sprintf("%sinc/loader/class_ClassLoader%s", PATH, $cfg->readConfig('php_extension')));
// Does the user has an application specified?
-if (!empty($_GET[$cfg->readConfig('app_selector_get')])) {
+if (!empty($_GET['app'])) {
// Set the application from string
- $application = (string) $_GET[$cfg->readConfig('app_selector_get')];
+ $application = (string) $_GET['app'];
} elseif (!empty($_SERVER['argv'][1])) {
// Set the application from string
$application = (string) $_SERVER['argv'][1];
$app = explode('=', trim($application));
- if ($app[0] == $cfg->readConfig('app_selector_get')) {
+ if ($app[0] == 'app') {
// Application is valid!
$application = trim($app[1]);
} else {
*/
private $classCacheFQFN = "";
+ /**
+ * Counter for loaded include files
+ */
+ private $total = 0;
+
/**
* The *public* constructor
*
// File is found so load it only once
require($this->classes[$fileName]);
+ // Count this include
+ $this->total++;
+
// Developer mode excludes caching (better debugging)
if (!defined('DEVELOPER')) {
// Mark this class as loaded
} // END - if
} // END - foreach
}
+
+ /**
+ * Getter for total include counter
+ *
+ * @return $total Total loaded include files
+ */
+ public final function getTotal () {
+ return $this->total;
+ }
}
// [EOF]
*/
// Get a debugger instance
-$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->readConfig('debug_engine'));
+$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->readConfig('debug_class'));
// Empty string should be ignored and used for testing the middleware
DebugMiddleware::getInstance()->output("");
<div id="stats_objects">
Total objects: $content[total_objects]
</div>
+ <div id="stats_includes">
+ Loaded class files: $content[total_includes]
+ <span class="hint">(Including exception and interfaces.)</span>
+ </div>
</div>
{?footer_msg:footer_msg="Please contact the support and supply the full above message, if you think you are not qualified to fix this problem."?}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title>
$content[title]