From 558b417d946a1a6cee5278e86b5ed042afb3aad6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 9 Oct 2008 16:34:43 +0000 Subject: [PATCH] Code base synced --- .gitattributes | 10 ++ inc/classes.php | 8 +- .../actions/class_InvalidActionException.php | 2 +- .../auth/class_UserAuthorizationException.php | 2 +- .../exceptions/class_FrameworkException.php | 4 +- .../class_MismatchingCompressorsException.php | 2 +- .../class_InvalidControllerException.php | 2 +- .../database/general/class_SqlException.php | 2 +- .../class_SavePathIsNoDirectoryException.php | 2 +- .../class_SavePathReadProtectedException.php | 2 +- .../class_SavePathWriteProtectedException.php | 2 +- ...class_WrapperUserNameNotFoundException.php | 2 +- .../helper/class_FormClosedException.php | 2 +- .../helper/class_FormGroupClosedException.php | 2 +- ...elperNoPreviousOpenedSubGroupException.php | 2 +- .../helper/class_NoGroupOpenedException.php | 2 +- .../class_UserInstanceMissingException.php | 2 +- .../io/class_DirPointerNotOpenedException.php | 2 +- .../io/class_FileNotFoundException.php | 2 +- .../class_FilePointerNotOpenedException.php | 2 +- .../io/class_FileReadProtectedException.php | 2 +- .../io/class_InvalidDataLengthException.php | 2 +- .../io/class_InvalidMD5ChecksumException.php | 2 +- .../io/class_PathIsNoDirectoryException.php | 2 +- .../io/class_PathReadProtectedException.php | 2 +- ...ass_InvalidLanguagePathStringException.php | 2 +- ...ass_LanguagePathIsNoDirectoryException.php | 2 +- ...ass_LanguagePathReadProtectedException.php | 2 +- .../main/class_ClassMismatchException.php | 2 +- .../main/class_ClassNotFoundException.php | 2 +- .../class_ConfigEntryNotFoundException.php | 2 +- .../class_DimNotFoundInArrayException.php | 2 +- .../main/class_EmptyVariableException.php | 2 +- .../main/class_ExceptionNotFoundException.php | 2 +- .../main/class_GetterNotFoundException.php | 2 +- .../main/class_InvalidArrayCountException.php | 2 +- .../main/class_InvalidCommandException.php | 2 +- .../class_InvalidCommandInstanceException.php | 2 +- .../main/class_InvalidInterfaceException.php | 2 +- .../class_MissingArrayElementsException.php | 2 +- .../main/class_NoArrayCreatedException.php | 2 +- .../main/class_NoArrayException.php | 2 +- .../main/class_NoObjectException.php | 2 +- .../main/class_VariableIsNotSetException.php | 2 +- .../class_InvalidDatabaseResultException.php | 2 +- .../class_BasePathIsNoDirectoryException.php | 2 +- .../class_BasePathReadProtectedException.php | 2 +- .../class_InvalidBasePathStringException.php | 2 +- .../class_UnexpectedTemplateTypeException.php | 2 +- .../class_ViewHelperNotFoundException.php | 2 +- .../user/class_UserEmailMissingException.php | 2 +- .../class_UserPasswordMismatchException.php | 2 +- .../user/class_UsernameMissingException.php | 2 +- inc/classes/interfaces/discovery/.htaccess | 1 + .../discovery/class_Discoverable.php | 43 ++++++ .../web/class_WebLoginProfileAction.php | 2 +- .../main/class_BaseFrameworkSystem.php | 15 +- .../web/class_WebResendLinkCommand.php | 2 +- .../main/console/class_ConsoleTools.php | 4 +- .../class_ImageCodeCaptchaController.php | 2 +- .../main/controller/class_BaseController.php | 31 ++-- .../login/class_WebLoginAreaController.php | 8 +- .../web/class_WebConfirmController.php | 8 +- .../web/class_WebDefaultNewsController.php | 4 +- .../web/class_WebLogoutController.php | 4 +- .../wrapper/class_PaymentsDatabaseWrapper.php | 59 ++++++++ .../main/debug/class_DebugConsoleOutput.php | 2 +- .../main/debug/class_DebugWebOutput.php | 2 +- inc/classes/main/discovery/.htaccess | 1 + inc/classes/main/discovery/class_ | 78 ++++++++++ .../main/discovery/class_BaseDiscovery.php | 66 +++++++++ inc/classes/main/discovery/payment/.htaccess | 1 + .../payment/class_LocalPaymentDiscovery.php | 94 ++++++++++++ .../factories/objects/class_ObjectFactory.php | 7 +- inc/classes/main/filter/payment/.htaccess | 1 + .../payment/class_PaymentDiscoveryFilter.php | 139 ++++++++++++++++++ .../helper/web/forms/class_WebFormHelper.php | 3 +- .../main/output/class_ConsoleOutput.php | 2 +- inc/classes/main/output/class_WebOutput.php | 2 +- inc/classes/main/points/class_UserPoints.php | 2 +- .../main/reader/class_DefaultNewsReader.php | 2 +- .../action/class_BaseActionResolver.php | 2 +- .../main/response/class_BaseResponse.php | 11 ++ .../template/class_BaseTemplateEngine.php | 2 +- inc/classes/main/user/member/class_Member.php | 4 +- .../compressor/class_CompressorChannel.php | 2 +- inc/config.php | 67 ++++----- inc/config/class_FrameworkConfiguration.php | 60 ++++---- inc/database.php | 20 +-- inc/database/lib-local.php | 10 +- inc/file_io.php | 3 + inc/includes.php | 2 +- inc/language.php | 11 +- inc/selector.php | 10 +- 94 files changed, 709 insertions(+), 202 deletions(-) create mode 100644 inc/classes/interfaces/discovery/.htaccess create mode 100644 inc/classes/interfaces/discovery/class_Discoverable.php create mode 100644 inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php create mode 100644 inc/classes/main/discovery/.htaccess create mode 100644 inc/classes/main/discovery/class_ create mode 100644 inc/classes/main/discovery/class_BaseDiscovery.php create mode 100644 inc/classes/main/discovery/payment/.htaccess create mode 100644 inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php create mode 100644 inc/classes/main/filter/payment/.htaccess create mode 100644 inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php diff --git a/.gitattributes b/.gitattributes index 963494c045..5fd7e66c5d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -175,6 +175,8 @@ inc/classes/interfaces/database/middleware/.htaccess -text inc/classes/interfaces/database/middleware/class_DatabaseConnector.php -text inc/classes/interfaces/debug/.htaccess -text inc/classes/interfaces/debug/class_Debugger.php -text +inc/classes/interfaces/discovery/.htaccess -text +inc/classes/interfaces/discovery/class_Discoverable.php -text inc/classes/interfaces/extended/.htaccess -text inc/classes/interfaces/extended/class_LimitableObject.php -text inc/classes/interfaces/filter/.htaccess -text @@ -305,12 +307,18 @@ inc/classes/main/database/databases/.htaccess -text inc/classes/main/database/databases/class_LocalFileDatabase.php -text inc/classes/main/database/wrapper/.htaccess -text inc/classes/main/database/wrapper/class_NewsDatabaseWrapper.php -text +inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php -text inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php -text inc/classes/main/database/wrapper/class_UserPointsDatabaseWrapper.php -text inc/classes/main/debug/.htaccess -text inc/classes/main/debug/class_DebugConsoleOutput.php -text inc/classes/main/debug/class_DebugErrorLogOutput.php -text inc/classes/main/debug/class_DebugWebOutput.php -text +inc/classes/main/discovery/.htaccess -text +inc/classes/main/discovery/class_ -text +inc/classes/main/discovery/class_BaseDiscovery.php -text +inc/classes/main/discovery/payment/.htaccess -text +inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php -text inc/classes/main/extended/.htaccess -text inc/classes/main/extended/class_ObjectLimits.php -text inc/classes/main/extended/class_SerializationContainer.php -text @@ -344,6 +352,8 @@ 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/payment/.htaccess -text +inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php -text inc/classes/main/filter/update/.htaccess -text inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php -text inc/classes/main/filter/update/class_UserUpdateFilter.php -text diff --git a/inc/classes.php b/inc/classes.php index 5a541c9d06..78bafebbf8 100644 --- a/inc/classes.php +++ b/inc/classes.php @@ -35,19 +35,19 @@ foreach ($lowerClasses as $className) { try { ClassLoader::getInstance()->loadClasses(sprintf("inc/classes/%s/", $className)); } catch (PathIsNoDirectoryException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", $className )); } catch (PathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", $className )); } catch (PathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", $className )); } catch (DirPointerNotOpenedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", $className )); } diff --git a/inc/classes/exceptions/actions/class_InvalidActionException.php b/inc/classes/exceptions/actions/class_InvalidActionException.php index 3f6df3099a..addebdb1d7 100644 --- a/inc/classes/exceptions/actions/class_InvalidActionException.php +++ b/inc/classes/exceptions/actions/class_InvalidActionException.php @@ -31,7 +31,7 @@ class InvalidActionException extends FrameworkException { */ public function __construct(array $msgArray, $code) { // Prepare the message - $message = sprintf("[%s:%d] Cannot resolve action %s.", + $message = sprintf("[%s:%d] Cannot resolve action %s.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/exceptions/auth/class_UserAuthorizationException.php b/inc/classes/exceptions/auth/class_UserAuthorizationException.php index a5ab08bdc7..a07bf453c4 100644 --- a/inc/classes/exceptions/auth/class_UserAuthorizationException.php +++ b/inc/classes/exceptions/auth/class_UserAuthorizationException.php @@ -31,7 +31,7 @@ class UserAuthorizationException extends FrameworkException { */ public function __construct(Filterable $filterInstance, $code) { // Construct the message - $message = sprintf("[%s:%d] Authorization has failed. Error code %s", + $message = sprintf("[%s:%d] Authorization has failed. Error code %s", $filterInstance->__toString(), $this->getLine(), $this->getHexCode($code) diff --git a/inc/classes/exceptions/class_FrameworkException.php b/inc/classes/exceptions/class_FrameworkException.php index 3ba2fbec91..267744c255 100644 --- a/inc/classes/exceptions/class_FrameworkException.php +++ b/inc/classes/exceptions/class_FrameworkException.php @@ -121,7 +121,7 @@ abstract class FrameworkException extends ReflectionException { } // END - if // Prepare argument infos - $info = "{$info}"; + $info = "{$info}"; // File detection $file = "Unknown file"; @@ -136,7 +136,7 @@ abstract class FrameworkException extends ReflectionException { } // END - if // The message - $dbgMsg .= "\t at ".$dbgIndex." ".$file." (".$line.") -> ".$dbgInfo['function']."(".$info.")
\n"; + $dbgMsg .= "\t at ".$dbgIndex." ".$file." (".$line.") -> ".$dbgInfo['function']."(".$info.")
\n"; } // END - if $dbgMsg .= "Debug backtrace end
\n"; diff --git a/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php b/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php index 1d0acb482d..dfba485b6d 100644 --- a/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php +++ b/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php @@ -31,7 +31,7 @@ class MismatchingCompressorsException extends FrameworkException { */ public function __construct (array $array, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Der Kompressor %s zu den geladenen Daten aus %s und der aktuell verwendete Kompressor %s stimmen nicht überein!", + $message = sprintf("[%s:%d] Der Kompressor %s zu den geladenen Daten aus %s und der aktuell verwendete Kompressor %s stimmen nicht überein!", $array[0]->__toString(), $this->getLine(), strtoupper($array[1]), diff --git a/inc/classes/exceptions/controller/class_InvalidControllerException.php b/inc/classes/exceptions/controller/class_InvalidControllerException.php index b166455a12..7fec632003 100644 --- a/inc/classes/exceptions/controller/class_InvalidControllerException.php +++ b/inc/classes/exceptions/controller/class_InvalidControllerException.php @@ -31,7 +31,7 @@ class InvalidControllerException extends FrameworkException { */ public function __construct(array $msgArray, $code) { // Prepare the message - $message = sprintf("[%s:%d] Cannot resolve controller %s (class name: %s).", + $message = sprintf("[%s:%d] Cannot resolve controller %s (class name: %s).", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1], diff --git a/inc/classes/exceptions/database/general/class_SqlException.php b/inc/classes/exceptions/database/general/class_SqlException.php index 6270e9ce44..0634928819 100644 --- a/inc/classes/exceptions/database/general/class_SqlException.php +++ b/inc/classes/exceptions/database/general/class_SqlException.php @@ -31,7 +31,7 @@ class SqlException extends DatabaseException { */ public function __construct (array $msgArray, $code) { // Construct the message - $message = sprintf("[%s:%d] SQL error detected. Message from database: %s, code: %s.", + $message = sprintf("[%s:%d] SQL error detected. Message from database: %s, code: %s.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1], diff --git a/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php b/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php index a8fb42b629..b14fa97345 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php @@ -31,7 +31,7 @@ class SavePathIsNoDirectoryException extends DatabaseException { */ public function __construct ($path, $code) { // Add a message around the missing class - $message = sprintf("Der angegebene Speicherpfad %s ist ungütig (kein Pfad).", $path); + $message = sprintf("Der angegebene Speicherpfad %s ist ungütig (kein Pfad).", $path); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php index 7a0534b22b..ce0ffa6b46 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php @@ -31,7 +31,7 @@ class SavePathReadProtectedException extends DatabaseException { */ public function __construct ($path, $code) { // Add a message around the missing class - $message = sprintf("Der Pfad %s ist lese-geschützt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path); + $message = sprintf("Der Pfad %s ist lese-geschützt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php index 9d7f699348..81a1067e3e 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php @@ -31,7 +31,7 @@ class SavePathWriteProtectedException extends DatabaseException { */ public function __construct ($path, $code) { // Add a message around the missing class - $message = sprintf("Der angegebene Speicherpfad %s ist schreibgeschützt. Bitte Zugriffsrechte (CHMOD) entsprechend setzen.", $path); + $message = sprintf("Der angegebene Speicherpfad %s ist schreibgeschützt. Bitte Zugriffsrechte (CHMOD) entsprechend setzen.", $path); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php b/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php index bf3aa4c107..042255278f 100644 --- a/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php +++ b/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php @@ -31,7 +31,7 @@ class WrapperUserNameNotFoundException extends DatabaseException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Username %s was not found. Requesting class: %s", + $message = sprintf("[%s:%d] Username %s was not found. Requesting class: %s", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1]->getUserName(), diff --git a/inc/classes/exceptions/helper/class_FormClosedException.php b/inc/classes/exceptions/helper/class_FormClosedException.php index 59a52ad18f..9978e5e5a8 100644 --- a/inc/classes/exceptions/helper/class_FormClosedException.php +++ b/inc/classes/exceptions/helper/class_FormClosedException.php @@ -32,7 +32,7 @@ class FormClosedException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Could not add form element %s because form is closed.", + $message = sprintf("[%s:%d] Could not add form element %s because form is closed.", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/helper/class_FormGroupClosedException.php b/inc/classes/exceptions/helper/class_FormGroupClosedException.php index a1e88020cf..92a6e43896 100644 --- a/inc/classes/exceptions/helper/class_FormGroupClosedException.php +++ b/inc/classes/exceptions/helper/class_FormGroupClosedException.php @@ -31,7 +31,7 @@ class FormGroupClosedException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Could not add sub group %s because no form group has been opened before.", + $message = sprintf("[%s:%d] Could not add sub group %s because no form group has been opened before.", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php b/inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php index 6c257c0b51..b6b78f61d4 100644 --- a/inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php +++ b/inc/classes/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php @@ -31,7 +31,7 @@ class HelperNoPreviousOpenedSubGroupException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Sub group not opened before. Raw text follows: %s", + $message = sprintf("[%s:%d] Sub group not opened before. Raw text follows: %s", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/exceptions/helper/class_NoGroupOpenedException.php b/inc/classes/exceptions/helper/class_NoGroupOpenedException.php index c650070d3c..2946a8b519 100644 --- a/inc/classes/exceptions/helper/class_NoGroupOpenedException.php +++ b/inc/classes/exceptions/helper/class_NoGroupOpenedException.php @@ -31,7 +31,7 @@ class NoGroupOpenedException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Group not opened before. Raw text follows: %s", + $message = sprintf("[%s:%d] Group not opened before. Raw text follows: %s", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/exceptions/helper/class_UserInstanceMissingException.php b/inc/classes/exceptions/helper/class_UserInstanceMissingException.php index e68e8f0f47..218968bcfa 100644 --- a/inc/classes/exceptions/helper/class_UserInstanceMissingException.php +++ b/inc/classes/exceptions/helper/class_UserInstanceMissingException.php @@ -31,7 +31,7 @@ class UserInstanceMissingException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Registry key %s does not include a class with implemented interface Manageable(User|Guest).", + $message = sprintf("[%s:%d] Registry key %s does not include a class with implemented interface Manageable(User|Guest).", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php b/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php index 6dc16a4c92..5b0293ee69 100644 --- a/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php +++ b/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php @@ -31,7 +31,7 @@ class DirPointerNotOpenedException extends FrameworkException { */ public function __construct ($path, $code) { // Add a message around the missing class - $message = sprintf("Für den Pfad %s konnte kein Pointer initialisiert werden.", $path); + $message = sprintf("Für den Pfad %s konnte kein Pointer initialisiert werden.", $path); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/io/class_FileNotFoundException.php b/inc/classes/exceptions/io/class_FileNotFoundException.php index a0719448b8..e2e7dbce13 100644 --- a/inc/classes/exceptions/io/class_FileNotFoundException.php +++ b/inc/classes/exceptions/io/class_FileNotFoundException.php @@ -31,7 +31,7 @@ class FileNotFoundException extends FrameworkException { */ public function __construct ($fqfn, $code) { // Add a message around the missing class - $message = sprintf("The requested file %s was not found.", + $message = sprintf("The requested file %s was not found.", $fqfn ); diff --git a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php index e7e8bde8f6..37300a52cf 100644 --- a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php +++ b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php @@ -31,7 +31,7 @@ class FilePointerNotOpenedException extends FrameworkException { */ public function __construct ($fqfn, $code) { // Add a message around the missing class - $message = sprintf("Not able to initialize a pointer for the file %s. Maybe the file is missing.", $fqfn); + $message = sprintf("Not able to initialize a pointer for the file %s. Maybe the file is missing.", $fqfn); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/io/class_FileReadProtectedException.php b/inc/classes/exceptions/io/class_FileReadProtectedException.php index f68aebe384..4e8a0e667b 100644 --- a/inc/classes/exceptions/io/class_FileReadProtectedException.php +++ b/inc/classes/exceptions/io/class_FileReadProtectedException.php @@ -31,7 +31,7 @@ class FileReadProtectedException extends FrameworkException { */ public function __construct ($fileName, $code) { // Add a message around the missing class - $message = sprintf("File %s is read-protected. Please set read access rights (CHMOD).", $fileName); + $message = sprintf("File %s is read-protected. Please set read access rights (CHMOD).", $fileName); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/io/class_InvalidDataLengthException.php b/inc/classes/exceptions/io/class_InvalidDataLengthException.php index 47fd5fbcc2..a1ef85ad25 100644 --- a/inc/classes/exceptions/io/class_InvalidDataLengthException.php +++ b/inc/classes/exceptions/io/class_InvalidDataLengthException.php @@ -31,7 +31,7 @@ class InvalidDataLengthException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Eine unerwartete Datenlänge von %s Byte ist aufgetreten. %s wurden erwartet!", + $message = sprintf("[%s:%d] Eine unerwartete Datenlänge von %s Byte ist aufgetreten. %s wurden erwartet!", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1], diff --git a/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php b/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php index 26a1270a06..2e5104a0d8 100644 --- a/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php +++ b/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php @@ -31,7 +31,7 @@ class InvalidMD5ChecksumException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Die MD5-Prüfsummen %s und %s stimmen nicht überein!", + $message = sprintf("[%s:%d] Die MD5-Prüfsummen %s und %s stimmen nicht überein!", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1], diff --git a/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php b/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php index 51222ebc45..7f908b1085 100644 --- a/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php +++ b/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php @@ -31,7 +31,7 @@ class PathIsNoDirectoryException extends FrameworkException { */ public function __construct ($path, $code) { // Add a message around the missing class - $message = sprintf("Der angegebene Pfad %s ist ungütig (kein Pfad).", $path); + $message = sprintf("Der angegebene Pfad %s ist ungütig (kein Pfad).", $path); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/io/class_PathReadProtectedException.php b/inc/classes/exceptions/io/class_PathReadProtectedException.php index 09fed2bf78..b5dd9355d5 100644 --- a/inc/classes/exceptions/io/class_PathReadProtectedException.php +++ b/inc/classes/exceptions/io/class_PathReadProtectedException.php @@ -31,7 +31,7 @@ class PathReadProtectedException extends FrameworkException { */ public function __construct ($path, $code) { // Add a message around the missing class - $message = sprintf("Der Pfad %s ist lese-geschützt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path); + $message = sprintf("Der Pfad %s ist lese-geschützt. Bitte Zugriffsrechte (CHMOD) zum Lesen setzen.", $path); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php b/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php index 9265b33917..19be0cdcf9 100644 --- a/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php +++ b/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php @@ -31,7 +31,7 @@ class InvalidLanguagePathStringException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] %s is not a string with path!", + $message = sprintf("[%s:%d] %s is not a string with path!", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php b/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php index 858e737304..b17823d201 100644 --- a/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php @@ -31,7 +31,7 @@ class LanguagePathIsNoDirectoryException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Der Sprach-Basispfad %s existiert nicht oder ist eine Datei!", + $message = sprintf("[%s:%d] Der Sprach-Basispfad %s existiert nicht oder ist eine Datei!", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php b/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php index 2fc786696d..0938f77866 100644 --- a/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php +++ b/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php @@ -31,7 +31,7 @@ class LanguagePathReadProtectedException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Base language path %s is read-protected. Please change access rights (CHMOD).", + $message = sprintf("[%s:%d] Base language path %s is read-protected. Please change access rights (CHMOD).", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/main/class_ClassMismatchException.php b/inc/classes/exceptions/main/class_ClassMismatchException.php index 32499e3e08..51497b46a6 100644 --- a/inc/classes/exceptions/main/class_ClassMismatchException.php +++ b/inc/classes/exceptions/main/class_ClassMismatchException.php @@ -31,7 +31,7 @@ class ClassMismatchException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("The class %s does not match class %s.", + $message = sprintf("The class %s does not match class %s.", $classArray[0], $classArray[1] ); diff --git a/inc/classes/exceptions/main/class_ClassNotFoundException.php b/inc/classes/exceptions/main/class_ClassNotFoundException.php index 29f13f24bc..1dcf9bdab5 100644 --- a/inc/classes/exceptions/main/class_ClassNotFoundException.php +++ b/inc/classes/exceptions/main/class_ClassNotFoundException.php @@ -31,7 +31,7 @@ class ClassNotFoundException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Internal class %s not found.", + $message = sprintf("[%s:%d] Internal class %s not found.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php b/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php index e4ec1b7737..40c3c71edb 100644 --- a/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php +++ b/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php @@ -31,7 +31,7 @@ class ConfigEntryNotFoundException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Configuration entry %s not found.", + $message = sprintf("[%s:%d] Configuration entry %s not found.", $classArray[0], $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php b/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php index 7806f9b81e..1e11cceb2b 100644 --- a/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php +++ b/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php @@ -38,7 +38,7 @@ class DimNotFoundInArrayException extends FrameworkException { ); } else { // No class given - $message = sprintf("Please provide a class for %s", __CLASS__); + $message = sprintf("Please provide a class for %s", __CLASS__); } // Call parent constructor diff --git a/inc/classes/exceptions/main/class_EmptyVariableException.php b/inc/classes/exceptions/main/class_EmptyVariableException.php index 1fae65454c..188969cff6 100644 --- a/inc/classes/exceptions/main/class_EmptyVariableException.php +++ b/inc/classes/exceptions/main/class_EmptyVariableException.php @@ -31,7 +31,7 @@ class EmptyVariableException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Variable %s is not set.", + $message = sprintf("[%s:%d] Variable %s is not set.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/exceptions/main/class_ExceptionNotFoundException.php b/inc/classes/exceptions/main/class_ExceptionNotFoundException.php index d3b37c8a4f..81ff4f14a3 100644 --- a/inc/classes/exceptions/main/class_ExceptionNotFoundException.php +++ b/inc/classes/exceptions/main/class_ExceptionNotFoundException.php @@ -31,7 +31,7 @@ class ExceptionNotFoundException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Exception %s not found.", + $message = sprintf("[%s:%d] Exception %s not found.", $classArray[0], $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/main/class_GetterNotFoundException.php b/inc/classes/exceptions/main/class_GetterNotFoundException.php index 5291b05946..a632dcd295 100644 --- a/inc/classes/exceptions/main/class_GetterNotFoundException.php +++ b/inc/classes/exceptions/main/class_GetterNotFoundException.php @@ -34,7 +34,7 @@ class GetterNotFoundException extends FrameworkException { $dataArray = (array) $dataArray; // Add a message around the missing class - $message = sprintf("[%s:%d] Getter-Methode für Attribut %s nicht gefunden.", + $message = sprintf("[%s:%d] Getter-Methode für Attribut %s nicht gefunden.", $dataArray[0]->__toString(), $this->getLine(), $dataArray[1] diff --git a/inc/classes/exceptions/main/class_InvalidArrayCountException.php b/inc/classes/exceptions/main/class_InvalidArrayCountException.php index a85bebfc90..3703f1ad1e 100644 --- a/inc/classes/exceptions/main/class_InvalidArrayCountException.php +++ b/inc/classes/exceptions/main/class_InvalidArrayCountException.php @@ -31,7 +31,7 @@ class InvalidArrayCountException extends FrameworkException { */ public function __construct (array $array, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] %s hat %d Elemente, soll aber %d enthalten!", + $message = sprintf("[%s:%d] %s hat %d Elemente, soll aber %d enthalten!", $array[0]->__toString(), $this->getLine(), $array[1], diff --git a/inc/classes/exceptions/main/class_InvalidCommandException.php b/inc/classes/exceptions/main/class_InvalidCommandException.php index d546cc1e27..d55a167f90 100644 --- a/inc/classes/exceptions/main/class_InvalidCommandException.php +++ b/inc/classes/exceptions/main/class_InvalidCommandException.php @@ -31,7 +31,7 @@ class InvalidCommandException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Invalid command %s (class %s) detected.", + $message = sprintf("[%s:%d] Invalid command %s (class %s) detected.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1], diff --git a/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php b/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php index 93cc03a560..34a4d2495d 100644 --- a/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php +++ b/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php @@ -31,7 +31,7 @@ class InvalidCommandInstanceException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Invalid command %s detected.", + $message = sprintf("[%s:%d] Invalid command %s detected.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/exceptions/main/class_InvalidInterfaceException.php b/inc/classes/exceptions/main/class_InvalidInterfaceException.php index a7fc71e4d5..c6285422be 100644 --- a/inc/classes/exceptions/main/class_InvalidInterfaceException.php +++ b/inc/classes/exceptions/main/class_InvalidInterfaceException.php @@ -31,7 +31,7 @@ class InvalidInterfaceException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Object does not implement expected interface .", + $message = sprintf("[%s:%d] Object does not implement expected interface .", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/main/class_MissingArrayElementsException.php b/inc/classes/exceptions/main/class_MissingArrayElementsException.php index a59b514329..5c3547bc22 100644 --- a/inc/classes/exceptions/main/class_MissingArrayElementsException.php +++ b/inc/classes/exceptions/main/class_MissingArrayElementsException.php @@ -41,7 +41,7 @@ class MissingArrayElementsException extends FrameworkException { } // Add a message around the missing class - $message = sprintf("[%s:%d] Array %s() Does not have these elements: %s", + $message = sprintf("[%s:%d] Array %s() Does not have these elements: %s", $classArray[0]->__toString(), $this->getLine(), $classArray[1], diff --git a/inc/classes/exceptions/main/class_NoArrayCreatedException.php b/inc/classes/exceptions/main/class_NoArrayCreatedException.php index 36dcbba996..e9f00de6dd 100644 --- a/inc/classes/exceptions/main/class_NoArrayCreatedException.php +++ b/inc/classes/exceptions/main/class_NoArrayCreatedException.php @@ -31,7 +31,7 @@ class NoArrayCreatedException extends FrameworkException { */ public function __construct (array $array, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] %s ist kein erstelltes Objekt.", + $message = sprintf("[%s:%d] %s ist kein erstelltes Objekt.", $array[0]->__toString(), $this->getLine(), $array[1] diff --git a/inc/classes/exceptions/main/class_NoArrayException.php b/inc/classes/exceptions/main/class_NoArrayException.php index 2f0c557b76..30d312f15e 100644 --- a/inc/classes/exceptions/main/class_NoArrayException.php +++ b/inc/classes/exceptions/main/class_NoArrayException.php @@ -29,7 +29,7 @@ class NoArrayException extends FrameworkException { */ public function __construct ($string, $code) { // Add a message around the missing class - $message = sprintf("%s ist kein Array!", + $message = sprintf("%s ist kein Array!", $string ); diff --git a/inc/classes/exceptions/main/class_NoObjectException.php b/inc/classes/exceptions/main/class_NoObjectException.php index 20f6870f40..541b849889 100644 --- a/inc/classes/exceptions/main/class_NoObjectException.php +++ b/inc/classes/exceptions/main/class_NoObjectException.php @@ -33,7 +33,7 @@ class NoObjectException extends FrameworkException { */ public function __construct ($string, $code) { // Add a message around the missing class - $message = sprintf("%s ist kein Objekt!", + $message = sprintf("%s ist kein Objekt!", $string ); diff --git a/inc/classes/exceptions/main/class_VariableIsNotSetException.php b/inc/classes/exceptions/main/class_VariableIsNotSetException.php index 57000be1e3..ddcad58033 100644 --- a/inc/classes/exceptions/main/class_VariableIsNotSetException.php +++ b/inc/classes/exceptions/main/class_VariableIsNotSetException.php @@ -31,7 +31,7 @@ class VariableIsNotSetException extends FrameworkException { */ public function __construct (array $array, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Bei der Initialisierung der Applikation %s wurde keine Variable %s erzeugt.", + $message = sprintf("[%s:%d] Bei der Initialisierung der Applikation %s wurde keine Variable %s erzeugt.", $array[0]->__toString(), $this->getLine(), $array[1], diff --git a/inc/classes/exceptions/result/class_InvalidDatabaseResultException.php b/inc/classes/exceptions/result/class_InvalidDatabaseResultException.php index be1ab5d37e..762eb82658 100644 --- a/inc/classes/exceptions/result/class_InvalidDatabaseResultException.php +++ b/inc/classes/exceptions/result/class_InvalidDatabaseResultException.php @@ -31,7 +31,7 @@ class InvalidDatabaseResultException extends FrameworkException { */ public function __construct(array $msgArray, $code) { // Construct the message - $message = sprintf("[%s:%d] Database instance %s contains invalid entries.", + $message = sprintf("[%s:%d] Database instance %s contains invalid entries.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1]->__toString() diff --git a/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php b/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php index 5a109fb6a0..04d510a05b 100644 --- a/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php @@ -31,7 +31,7 @@ class BasePathIsNoDirectoryException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Der Template-Basispfad %s existiert nicht oder ist eine Datei!", + $message = sprintf("[%s:%d] Der Template-Basispfad %s existiert nicht oder ist eine Datei!", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/template/class_BasePathReadProtectedException.php b/inc/classes/exceptions/template/class_BasePathReadProtectedException.php index c66fd7b291..6a4d956e58 100644 --- a/inc/classes/exceptions/template/class_BasePathReadProtectedException.php +++ b/inc/classes/exceptions/template/class_BasePathReadProtectedException.php @@ -31,7 +31,7 @@ class BasePathReadProtectedException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Der Template-Basispfad %s ist lesegeschützt! Bitte Zugriffsrechte (CHMOD) ändern.", + $message = sprintf("[%s:%d] Der Template-Basispfad %s ist lesegeschützt! Bitte Zugriffsrechte (CHMOD) ändern.", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/template/class_InvalidBasePathStringException.php b/inc/classes/exceptions/template/class_InvalidBasePathStringException.php index c52a5847bf..93f875e97e 100644 --- a/inc/classes/exceptions/template/class_InvalidBasePathStringException.php +++ b/inc/classes/exceptions/template/class_InvalidBasePathStringException.php @@ -31,7 +31,7 @@ class InvalidBasePathStringException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] %s is not a string with a base path!", + $message = sprintf("[%s:%d] %s is not a string with a base path!", $classArray[0]->__toString(), $this->getLine(), $classArray[1] diff --git a/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php b/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php index 9a7eb05568..9394348aab 100644 --- a/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php +++ b/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php @@ -31,7 +31,7 @@ class UnexpectedTemplateTypeException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Der Template-Typ %s entspricht nicht dem erwartetem Template-Typ %s.", + $message = sprintf("[%s:%d] Der Template-Typ %s entspricht nicht dem erwartetem Template-Typ %s.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1], diff --git a/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php b/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php index 0af17cd21a..06dea77130 100644 --- a/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php +++ b/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php @@ -31,7 +31,7 @@ class ViewHelperNotFoundException extends FrameworkException { */ public function __construct (array $msgArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:] View-Helper %s ist ungültig.", + $message = sprintf("[%s:] View-Helper %s ist ungültig.", $msgArray[0]->__toString(), $msgArray[1] ); diff --git a/inc/classes/exceptions/user/class_UserEmailMissingException.php b/inc/classes/exceptions/user/class_UserEmailMissingException.php index 27dbf51b1f..dcef3708c4 100644 --- a/inc/classes/exceptions/user/class_UserEmailMissingException.php +++ b/inc/classes/exceptions/user/class_UserEmailMissingException.php @@ -31,7 +31,7 @@ class UserEmailMissingException extends FrameworkException { */ public function __construct(array $msgArray, $code = 0) { // Create the message - $message = sprintf("[%s:%d] User email %s was not found.", + $message = sprintf("[%s:%d] User email %s was not found.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/exceptions/user/class_UserPasswordMismatchException.php b/inc/classes/exceptions/user/class_UserPasswordMismatchException.php index a5184b37c0..0457930784 100644 --- a/inc/classes/exceptions/user/class_UserPasswordMismatchException.php +++ b/inc/classes/exceptions/user/class_UserPasswordMismatchException.php @@ -31,7 +31,7 @@ class UserPasswordMismatchException extends FrameworkException { */ public function __construct(array $msgArray, $code = 0) { // Create the message - $message = sprintf("[%s:%d] Supplied password for user %s did not match with stored password.", + $message = sprintf("[%s:%d] Supplied password for user %s did not match with stored password.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1]->getUserName() diff --git a/inc/classes/exceptions/user/class_UsernameMissingException.php b/inc/classes/exceptions/user/class_UsernameMissingException.php index 0ab7e9e547..9f5e52dd0f 100644 --- a/inc/classes/exceptions/user/class_UsernameMissingException.php +++ b/inc/classes/exceptions/user/class_UsernameMissingException.php @@ -31,7 +31,7 @@ class UsernameMissingException extends FrameworkException { */ public function __construct(array $msgArray, $code = 0) { // Create the message - $message = sprintf("[%s:%d] Username %s was not found.", + $message = sprintf("[%s:%d] Username %s was not found.", $msgArray[0]->__toString(), $this->getLine(), $msgArray[1] diff --git a/inc/classes/interfaces/discovery/.htaccess b/inc/classes/interfaces/discovery/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/classes/interfaces/discovery/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/discovery/class_Discoverable.php b/inc/classes/interfaces/discovery/class_Discoverable.php new file mode 100644 index 0000000000..4aa69e80a5 --- /dev/null +++ b/inc/classes/interfaces/discovery/class_Discoverable.php @@ -0,0 +1,43 @@ + + * @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 . + */ +interface Discoverable extends FrameworkInterface { + /** + * Discovers the request + * + * @param $requestInstance An instance of a Requestable class + * @return void + */ + function discover (Requestable $requestInstance); + + /** + * Adds the database result in a human-readable format to the helper class + * + * @param $helperInstance An instance of a helper class + * @return void + */ + function addResultsToHelper (HelpableTemplate $helperInstance); +} + +// +?> diff --git a/inc/classes/main/actions/web/class_WebLoginProfileAction.php b/inc/classes/main/actions/web/class_WebLoginProfileAction.php index 3ed47c0a8d..a7de7e8c78 100644 --- a/inc/classes/main/actions/web/class_WebLoginProfileAction.php +++ b/inc/classes/main/actions/web/class_WebLoginProfileAction.php @@ -69,7 +69,7 @@ class WebLoginProfileAction extends BaseAction implements Commandable, Registera */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add user status filter here - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); } } diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 7e461ac820..31feceef55 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -211,7 +211,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->setRealClass('DestructedObject'); } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) { // Already destructed object - $this->debugOutput(sprintf("[%s:] The object %s is already destroyed.", + $this->debugOutput(sprintf("[%s:] The object %s is already destroyed.", __CLASS__, $this->__toString() )); } @@ -269,6 +269,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { private final function initInstance () { // Is this a system class? if (!in_array($this->__toString(), $this->systemClasses)) { + // Set configuration instance + $this->setConfigInstance(FrameworkConfiguration::getInstance()); + // Add application helper to our class $this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class'); @@ -289,7 +292,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { Registry::isInitialized('OK'); } elseif ($this->__toString() == 'DebugMiddleware') { // Set configuration instance - $this->setConfigInstance(FrameworkConfiguration::createFrameworkConfiguration()); + $this->setConfigInstance(FrameworkConfiguration::getInstance()); } } @@ -571,6 +574,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * Stub method (only real cabins shall override it) * * @return boolean false = is no cabin, true = is a cabin + * @deprecated */ public function isCabin () { return false; @@ -581,6 +585,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * * @return boolean false = is not tradeable by the Merchant class, * true = is a tradeable object + * @deprecated */ public function isTradeable () { return false; @@ -759,7 +764,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { ); // Output it - ApplicationEntryPoint::app_die(sprintf("%s debug output:
%s
\nLoaded includes:
%s
", + ApplicationEntryPoint::app_die(sprintf("
%s debug output:
%s
\nLoaded includes:
%s
", $this->__toString(), $content, ClassLoader::getInstance()->getPrintableIncludeList() @@ -810,9 +815,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public function debugBackTrace () { // Sorry, there is no other way getting this nice backtrace - print "
\n";
+		print("
\n");
 		debug_print_backtrace();
-		print "
"; + print("
"); exit; } diff --git a/inc/classes/main/commands/web/class_WebResendLinkCommand.php b/inc/classes/main/commands/web/class_WebResendLinkCommand.php index c6ba2a6c82..596bf89488 100644 --- a/inc/classes/main/commands/web/class_WebResendLinkCommand.php +++ b/inc/classes/main/commands/web/class_WebResendLinkCommand.php @@ -134,7 +134,7 @@ class WebResendLinkCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Filter for checking if account is unconfirmed - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter')); } } diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index 3b49f72168..d037d40494 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -50,7 +50,7 @@ class ConsoleTools extends BaseFrameworkSystem { // Read the file $hostname = trim($io->readFromFile()); - $helper->debugOutput(sprintf("[%s:] Our host name is: %s", + $helper->debugOutput(sprintf("[%s:] Our host name is: %s", $helper->__toString(), $hostname )); @@ -65,7 +65,7 @@ class ConsoleTools extends BaseFrameworkSystem { $ip = $ipResolved; // Debug message - $helper->debugOutput(sprintf("[%s:] Resolved IP address is: %s\n", + $helper->debugOutput(sprintf("[%s:] Resolved IP address is: %s\n", $helper->__toString(), $ip )); diff --git a/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php b/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php index e84fca7a34..a6717456ee 100644 --- a/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php +++ b/inc/classes/main/controller/captcha/class_ImageCodeCaptchaController.php @@ -46,7 +46,7 @@ class ImageCodeCaptchaController extends BaseController implements Controller { $controllerInstance->setResolverInstance($resolverInstance); // Add filter for checking the "encrypt" string - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_encrypt_validator_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_encrypt_validator_filter')); // Return the prepared instance return $controllerInstance; diff --git a/inc/classes/main/controller/class_BaseController.php b/inc/classes/main/controller/class_BaseController.php index 1c4d442f5a..69fa4d1546 100644 --- a/inc/classes/main/controller/class_BaseController.php +++ b/inc/classes/main/controller/class_BaseController.php @@ -25,14 +25,9 @@ */ class BaseController extends BaseFrameworkSystem implements Registerable { /** - * Pre filter chain instance + * Generic filter chains */ - private $preFilterChain = null; - - /** - * Post filter chain instance - */ - private $postFilterChain = null; + private $filterChains = array(); /** * Protected constructor @@ -49,13 +44,23 @@ class BaseController extends BaseFrameworkSystem implements Registerable { $this->removeSystemArray(); // Initialize both filter chains - $this->preFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class'); - $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain_class'); + $this->initFilterChain('pre'); + $this->initFilterChain('post'); // Add this controller to the registry Registry::getRegistry()->addInstance('controller', $this); } + /** + * Private method to initialize a given filter chain + * + * @param $filterChain Name of the filter chain + * @return void + */ + private function initFilterChain ($filterChain) { + $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class'); + } + /** * Adds a filter to the pre filter chain * @@ -64,7 +69,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ public function addPreFilter (Filterable $filterInstance) { // Add the pre filter - $this->preFilterChain->addFilter($filterInstance); + $this->filterChains['pre']->addFilter($filterInstance); } /** @@ -75,7 +80,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ public function addPostFilter (Filterable $filterInstance) { // Add the post filter - $this->postFilterChain->addFilter($filterInstance); + $this->filterChains['post']->addFilter($filterInstance); } /** @@ -87,7 +92,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ protected function executePreFilters (Requestable $requestInstance, Responseable $responseInstance) { // Execute all pre filters - $this->preFilterChain->processFilters($requestInstance, $responseInstance); + $this->filterChains['pre']->processFilters($requestInstance, $responseInstance); } /** @@ -99,7 +104,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { */ protected function executePostFilters (Requestable $requestInstance, Responseable $responseInstance) { // Execute all post filters - $this->postFilterChain->processFilters($requestInstance, $responseInstance); + $this->filterChains['post']->processFilters($requestInstance, $responseInstance); } } diff --git a/inc/classes/main/controller/login/class_WebLoginAreaController.php b/inc/classes/main/controller/login/class_WebLoginAreaController.php index 1a1900c369..4e82ce10a8 100644 --- a/inc/classes/main/controller/login/class_WebLoginAreaController.php +++ b/inc/classes/main/controller/login/class_WebLoginAreaController.php @@ -46,16 +46,16 @@ class WebLoginAreaController extends BaseController implements Controller { $controllerInstance->setResolverInstance($resolverInstance); // User auth filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); // User update filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter')); // News fetcher filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); // News proccess/display-preparation - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); /* @todo: Add some filters to this controller */ diff --git a/inc/classes/main/controller/web/class_WebConfirmController.php b/inc/classes/main/controller/web/class_WebConfirmController.php index 64c845d019..411c59ba79 100644 --- a/inc/classes/main/controller/web/class_WebConfirmController.php +++ b/inc/classes/main/controller/web/class_WebConfirmController.php @@ -47,10 +47,10 @@ class WebConfirmController extends BaseController implements Controller { $controllerInstance->setResolverInstance($resolverInstance); // Add filters for handling confirmation code and username - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_class')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_class')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_filter')); // Return the prepared instance return $controllerInstance; diff --git a/inc/classes/main/controller/web/class_WebDefaultNewsController.php b/inc/classes/main/controller/web/class_WebDefaultNewsController.php index 1f6c0cc28a..d5769e9a20 100644 --- a/inc/classes/main/controller/web/class_WebDefaultNewsController.php +++ b/inc/classes/main/controller/web/class_WebDefaultNewsController.php @@ -46,8 +46,8 @@ class WebDefaultNewsController extends BaseController implements Controller { $controllerInstance->setResolverInstance($resolverInstance); // Add news filters to this controller - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_class')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); // Return the prepared instance return $controllerInstance; diff --git a/inc/classes/main/controller/web/class_WebLogoutController.php b/inc/classes/main/controller/web/class_WebLogoutController.php index 00b020a1df..7d8a9aeef7 100644 --- a/inc/classes/main/controller/web/class_WebLogoutController.php +++ b/inc/classes/main/controller/web/class_WebLogoutController.php @@ -47,10 +47,10 @@ class WebLogoutController extends BaseController implements Controller { $controllerInstance->setResolverInstance($resolverInstance); // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); // User status filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); // Return the prepared instance return $controllerInstance; diff --git a/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php b/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php new file mode 100644 index 0000000000..52f3646127 --- /dev/null +++ b/inc/classes/main/database/wrapper/class_PaymentsDatabaseWrapper.php @@ -0,0 +1,59 @@ + + * @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 . + */ +class PaymentsDatabaseWrapper extends BaseDatabaseWrapper { + // Constants for exceptions + const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0x180; + + // Constants for database table names + const DB_TABLE_PAYMENTS = "payments"; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct() { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this database wrapper by a provided user class + * + * @return $wrapperInstance An instance of the created wrapper class + */ + public final static function createPaymentsDatabaseWrapper () { + // Get a new instance + $wrapperInstance = new PaymentsDatabaseWrapper(); + + // Set (primary!) table name + $wrapperInstance->setTableName(self::DB_TABLE_PAYMENTS); + + // Return the instance + return $wrapperInstance; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/debug/class_DebugConsoleOutput.php b/inc/classes/main/debug/class_DebugConsoleOutput.php index b9db256800..08e6d426a8 100644 --- a/inc/classes/main/debug/class_DebugConsoleOutput.php +++ b/inc/classes/main/debug/class_DebugConsoleOutput.php @@ -52,7 +52,7 @@ class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, Output * @return void */ public final function outputStream ($output) { - print(html_entity_decode(strip_tags($output))); + print(html_entity_decode(strip_tags(stripslashes($output)))); } /** diff --git a/inc/classes/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php index 268738a7a1..433f68e8b6 100644 --- a/inc/classes/main/debug/class_DebugWebOutput.php +++ b/inc/classes/main/debug/class_DebugWebOutput.php @@ -54,7 +54,7 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre public final function outputStream ($output) { // Strip out
$output = str_replace("
", "", $output); - print($output."
\n"); + print(stripslashes($output)."
\n"); } /** diff --git a/inc/classes/main/discovery/.htaccess b/inc/classes/main/discovery/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/classes/main/discovery/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/discovery/class_ b/inc/classes/main/discovery/class_ new file mode 100644 index 0000000000..890d6502e3 --- /dev/null +++ b/inc/classes/main/discovery/class_ @@ -0,0 +1,78 @@ + + * @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 . + */ +class ???Discovery extends BaseDiscovery implements Discoverable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Create an instance of this class + * + * @return $discoveryInstance An instance of this discovery class + */ + public final static function create???Discovery () { + // Get an instance of this class + $discoveryInstance = new ???Discovery(); + + // Return the prepared instance + return $discoveryInstance; + } + + /** + * Discovers the request + * + * @param $requestInstance An instance of a Requestable class + * @return void + * @todo 0% done + */ + public function discover (Requestable $requestInstance) { + $this->partialStub("Please implement this method."); + } + + /** + * Adds the database result in a human-readable format to the helper class + * + * @param $helperInstance An instance of a helper class + * @return void + * @todo 0% done + */ + public function addResultsToHelper (HelpableTemplate $helperInstance) { + $this->partialStub("Please implement this method."); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/discovery/class_BaseDiscovery.php b/inc/classes/main/discovery/class_BaseDiscovery.php new file mode 100644 index 0000000000..48164e141f --- /dev/null +++ b/inc/classes/main/discovery/class_BaseDiscovery.php @@ -0,0 +1,66 @@ + + * @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 . + */ +class BaseDiscovery extends BaseFrameworkSystem { + /** + * Action name for payment discovery + */ + private $actionName = ""; + + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Protected setter for action name + * + * @param $actionName Action name to set + * @return void + */ + protected final function setActionName ($actionName) { + $this->actionName = (string) $actionName; + } + + /** + * Private getter for action name + * + * @return $actionName Action name to set + */ + protected final function getActionName () { + return $this->actionName; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/discovery/payment/.htaccess b/inc/classes/main/discovery/payment/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/classes/main/discovery/payment/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php new file mode 100644 index 0000000000..129dd3b14a --- /dev/null +++ b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php @@ -0,0 +1,94 @@ + + * @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 . + */ +class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Create an instance of this class + * + * @param $filterInstance An instance of a filter + * @return $discoveryInstance An instance of this discovery class + */ + public final static function createLocalPaymentDiscovery (Filterable $filterInstance) { + // Get an instance of this class + $discoveryInstance = new LocalPaymentDiscovery(); + + // Set the action from filter + $discoveryInstance->setActionName($filterInstance->getActionName()); + + // Return the prepared instance + return $discoveryInstance; + } + + /** + * Discovers the request + * + * @param $requestInstance An instance of a Requestable class + * @return void + */ + public function discover (Requestable $requestInstance) { + // Now get a search criteria and set app name and payment action as search critera + $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + $criteriaInstance->addCriteria("app_name", $requestInstance->getRequestElement('app')); + $criteriaInstance->addCriteria("payment_action", $this->getActionName().'_action'); + $criteriaInstance->setLimit(1); + + // Get a wrapper instance + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('payment_db_wrapper_class'); + + // Get result back + $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance); + + // Set the result instance + $this->setResultInstance($resultInstance); + } + + /** + * Adds the database result in a human-readable format to the helper class + * + * @param $helperInstance An instance of a helper class + * @return void + * @todo 0% done + */ + public function addResultsToHelper (HelpableTemplate $helperInstance) { + // Undone part + } +} + +// [EOF] +?> diff --git a/inc/classes/main/factories/objects/class_ObjectFactory.php b/inc/classes/main/factories/objects/class_ObjectFactory.php index 06c73d89c4..0848e79fab 100644 --- a/inc/classes/main/factories/objects/class_ObjectFactory.php +++ b/inc/classes/main/factories/objects/class_ObjectFactory.php @@ -64,14 +64,13 @@ class ObjectFactory extends BaseFactory { throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND); } - // Then Prepare the call-back function - $callback = sprintf("%s::create%s", - $className, + // Create method name + $methodName = sprintf("create%s", $className ); // Run the user function - $objectInstance = call_user_func_array($callback, $args); + $objectInstance = call_user_func_array(array($className, $methodName), $args); // Count generated objects up self::$total++; diff --git a/inc/classes/main/filter/payment/.htaccess b/inc/classes/main/filter/payment/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/classes/main/filter/payment/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php b/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php new file mode 100644 index 0000000000..2f12e5b075 --- /dev/null +++ b/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php @@ -0,0 +1,139 @@ + + * @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 . + */ +class PaymentDiscoveryFilter extends BaseFrameworkSystem implements Filterable { + /** + * Action name for payment discovery + */ + private $actionName = ""; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Creates an instance of this filter class + * + * @param $actionInstance A performable action + * @return $filterInstance An instance of this filter class + * @throws NullPointerException If the resolver is not set + */ + public final static function createPaymentDiscoveryFilter (PerformableAction $actionInstance) { + // Get a new instance + $filterInstance = new PaymentDiscoveryFilter(); + + // Get resolver from action + $resolverInstance = $actionInstance->getResolverInstance(); + + // Is the resolver set? + if (is_null($resolverInstance)) { + // Throw an exception here + throw new NullPointerException($filterInstance, self::EXCEPTION_IS_NULL_POINTER); + } // END - if + + // Get the action name from resolver + $actionName = $resolverInstance->getActionName(); + + // Store it away in this class + $filterInstance->setActionName($actionName); + + // Return the instance + return $filterInstance; + } + + /** + * Protected setter for action name + * + * @param $actionName Action name to set + * @return void + */ + protected final function setActionName ($actionName) { + $this->actionName = (string) $actionName; + } + + /** + * Getter for action name + * + * @return $actionName Action name to set + */ + public final function getActionName () { + return $this->actionName; + } + + /** + * 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 + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Try to get real discovery class + try { + // Get an instance from the object factory + $discoveryInstance = ObjectFactory::createObjectByConfiguredName($this->getActionName().'_payment_discovery', array($this)); + + // Call the discovery method + $discoveryInstance->discover($requestInstance); + + // Remember this instance if all wents fine + Registry::getRegistry()->addInstance('payments', $discoveryInstance); + } catch (ConfigEntryNotFoundException $e) { + // Something bad happend + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('payment_config_entry_error'); + $responseInstance->addFatalMessagePlain($e->getMessage()); + + // Abort here + return false; + } catch (ClassNotFoundException $e) { + // Something bad happend + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('payment_class_error'); + $responseInstance->addFatalMessagePlain($e->getMessage()); + + // Abort here + return false; + } + } +} + +// [EOF] +?> diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index 2f3502c9e7..a188251b5c 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -634,8 +634,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { } // END - if // Render the content - $content = sprintf("\n", - $subName, + $content = sprintf("\n", $subName, $subValue ); diff --git a/inc/classes/main/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php index bcc1fc5eb8..51f5dcaf18 100644 --- a/inc/classes/main/output/class_ConsoleOutput.php +++ b/inc/classes/main/output/class_ConsoleOutput.php @@ -95,7 +95,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer { } } else { // Output it to the console - printf("%s\n", trim(html_entity_decode(strip_tags($outStream)))); + printf("%s\n", trim(html_entity_decode(strip_tags(stripslashes($outStream))))); } } diff --git a/inc/classes/main/output/class_WebOutput.php b/inc/classes/main/output/class_WebOutput.php index 7a508058dd..e82c0b7af1 100644 --- a/inc/classes/main/output/class_WebOutput.php +++ b/inc/classes/main/output/class_WebOutput.php @@ -84,7 +84,7 @@ class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registera * @return void */ public final function output ($outStream=false) { - print($outStream); + print(stripslashes($outStream)); } } diff --git a/inc/classes/main/points/class_UserPoints.php b/inc/classes/main/points/class_UserPoints.php index 17c22e2548..fb0f169e12 100644 --- a/inc/classes/main/points/class_UserPoints.php +++ b/inc/classes/main/points/class_UserPoints.php @@ -72,7 +72,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable { // Now get a search criteria and set the user's name as criteria $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - $criteriaInstance->addCriteria('points_uid', $this->getUserInstance()->getUserName()); + $criteriaInstance->addCriteria("points_uid", $this->getUserInstance()->getUserName()); $criteriaInstance->setLimit(1); // Get result back diff --git a/inc/classes/main/reader/class_DefaultNewsReader.php b/inc/classes/main/reader/class_DefaultNewsReader.php index 4e5dbb1057..b0dbac6715 100644 --- a/inc/classes/main/reader/class_DefaultNewsReader.php +++ b/inc/classes/main/reader/class_DefaultNewsReader.php @@ -70,7 +70,7 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); // Add the page as criteria to it at lease - $criteriaInstance->addCriteria('page', $page); + $criteriaInstance->addCriteria("page", $page); // Add limitation from config $criteriaInstance->setLimit($this->getConfigInstance()->readConfig("news_{$page}_limit")); diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php index 0c7f268faf..eef7b46976 100644 --- a/inc/classes/main/resolver/action/class_BaseActionResolver.php +++ b/inc/classes/main/resolver/action/class_BaseActionResolver.php @@ -68,7 +68,7 @@ class BaseActionResolver extends BaseResolver { * * @return $actionName Last validated action name */ - protected final function getActionName () { + public final function getActionName () { return $this->actionName; } diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php index 2ecfaa2bae..0c3a4c71a2 100644 --- a/inc/classes/main/response/class_BaseResponse.php +++ b/inc/classes/main/response/class_BaseResponse.php @@ -132,6 +132,17 @@ class BaseResponse extends BaseFrameworkSystem { $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId); } + /** + * Adds a plain fatal message id to the response + * + * @param $message The plain message we shall add + * @return void + */ + public final function addFatalMessagePlain ($message) { + // Adds the resolved message id to the fatal message list + $this->fatalMessages[] = $message; + } + /** * Flushs the cached HTTP response to the outer world * diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 7e1aa7c194..2bbec445b0 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -1098,7 +1098,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { default: // Unknown type found // Construct message - $msg = sprintf("[%s->%s] Unknown/unsupported template type %s detected.", + $msg = sprintf("[%s->%s] Unknown/unsupported template type %s detected.", $this->__toString(), __FUNCTION__, $this->getTemplateType() diff --git a/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php index 141f1de389..726e850140 100644 --- a/inc/classes/main/user/member/class_Member.php +++ b/inc/classes/main/user/member/class_Member.php @@ -144,8 +144,8 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class'); // And add our both entries - $updateInstance->addCriteria('last_activity', date("Y-m-d H:i:s", time())); - $updateInstance->addCriteria('last_action', $lastAction); + $updateInstance->addCriteria("last_activity", date("Y-m-d H:i:s", time())); + $updateInstance->addCriteria("last_action", $lastAction); // Add the search criteria for searching for the right entry $updateInstance->setSearchInstance($searchInstance); diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index 266cf6facd..6d3ede2569 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -61,7 +61,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable { // Read all directories but no sub directories while ($dir = $dirPointer->readDirectoryExcept(array("..", ".", ".htaccess", ".svn"))) { // Is this a class file? - if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == FrameworkConfiguration::getInstance()->readConfig('php_extension'))) { + if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == ".php")) { // Get the compressor's name. That's why you must name // your files like your classes and also that's why you // must keep on class in one file. diff --git a/inc/config.php b/inc/config.php index d50782a1da..1cf6715e1a 100644 --- a/inc/config.php +++ b/inc/config.php @@ -30,7 +30,7 @@ @require_once(dirname(__FILE__) . '/config/class_FrameworkConfiguration.php'); // Get a new configuration instance -$cfg = FrameworkConfiguration::createFrameworkConfiguration(); +$cfg = FrameworkConfiguration::getInstance(); // CFG: SERVER-PATH $cfg->setConfigEntry('base_path', (dirname(dirname(__FILE__)) . '/')); // DON'T MISS THE TRAILING SLASH!!! @@ -50,9 +50,6 @@ $cfg->setDefaultTimezone("Europe/Berlin"); // CFG: MAGIC-QUOTES-RUNTIME $cfg->setMagicQuotesRuntime(false); -// CFG: PHP-SCRIPT-EXTENSION -$cfg->setConfigEntry('php_extension', ".php"); - // CFG: CLASS-PREFIX $cfg->setConfigEntry('class_prefix', "class_"); @@ -170,50 +167,50 @@ $cfg->setConfigEntry('file_input_class', "FileIoStream"); // CFG: FILE-OUTPUT-STREAM $cfg->setConfigEntry('file_output_class', "FileIoStream"); -// CFG: EMAIL-VALIDATOR -$cfg->setConfigEntry('email_validator_class', "EmailValidatorFilter"); +// CFG: EMAIL-VALIDATOR-FILTER +$cfg->setConfigEntry('email_validator_filter', "EmailValidatorFilter"); -// CFG: USERNAME-VALIDATOR -$cfg->setConfigEntry('username_validator_class', "UserNameValidatorFilter"); +// CFG: USERNAME-VALIDATOR-FILTER +$cfg->setConfigEntry('username_validator_filter', "UserNameValidatorFilter"); -// CFG: USERNAME-IS-GUEST -$cfg->setConfigEntry('username_is_guest_class', "UserNameIsGuestFilter"); +// CFG: USERNAME-IS-GUEST-FILTER +$cfg->setConfigEntry('username_is_guest_filter', "UserNameIsGuestFilter"); -// CFG: PASSWORD-VALIDATOR -$cfg->setConfigEntry('password_validator_class', "PasswordValidatorFilter"); +// CFG: PASSWORD-VALIDATOR-FILTER +$cfg->setConfigEntry('password_validator_filter', "PasswordValidatorFilter"); -// CFG: RULES-ACCEPTED-CLASS -$cfg->setConfigEntry('rules_accepted_class', "RulesAcceptedFilter"); +// CFG: RULES-ACCEPTED-FILTER +$cfg->setConfigEntry('rules_accepted_filter', "RulesAcceptedFilter"); -// CFG: USERNAME-VERIFIER-CLASS -$cfg->setConfigEntry('username_verifier_class', "UserNameVerifierFilter"); +// CFG: USERNAME-VERIFIER-FILTER +$cfg->setConfigEntry('username_verifier_filter', "UserNameVerifierFilter"); -// CFG: USER-GUEST-VERIFIER-CLASS -$cfg->setConfigEntry('user_guest_verifier_class', "UserGuestVerifierFilter"); +// CFG: USER-GUEST-VERIFIER-FILTER +$cfg->setConfigEntry('user_guest_verifier_filter', "UserGuestVerifierFilter"); -// CFG: EMAIL-VERIFIER -$cfg->setConfigEntry('email_verifier_class', "EmailVerifierFilter"); +// CFG: EMAIL-VERIFIER-FILTER +$cfg->setConfigEntry('email_verifier_filter', "EmailVerifierFilter"); -// CFG: PASSWORD-VERIFIER-CLASS -$cfg->setConfigEntry('password_verifier_class', "PasswordVerifierFilter"); +// CFG: PASSWORD-VERIFIER-FILTER +$cfg->setConfigEntry('password_verifier_filter', "PasswordVerifierFilter"); -// CFG: PASSWD-GUEST-VERIFIER-CLASS -$cfg->setConfigEntry('passwd_guest_verifier_class', "PasswordGuestVerifierFilter"); +// CFG: PASSWD-GUEST-VERIFIER-FILTER +$cfg->setConfigEntry('passwd_guest_verifier_filter', "PasswordGuestVerifierFilter"); -// CFG: EMAIL-CHANGE-CLASS -$cfg->setConfigEntry('email_change_class', "EmailChangeFilter"); +// CFG: EMAIL-CHANGE-FILTER +$cfg->setConfigEntry('email_change_filter', "EmailChangeFilter"); -// CFG: PASSWORD-CHANGE-CLASS -$cfg->setConfigEntry('password_change_class', "PasswordChangeFilter"); +// CFG: PASSWORD-CHANGE-FILTER +$cfg->setConfigEntry('password_change_filter', "PasswordChangeFilter"); -// CFG: ACCOUNT-PASSWORD-CLASS -$cfg->setConfigEntry('account_password_class', "AccountPasswordVerifierFilter"); +// CFG: ACCOUNT-PASSWORD-FILTER +$cfg->setConfigEntry('account_password_filter', "AccountPasswordVerifierFilter"); -// CFG: USER-STATUS-CLASS -$cfg->setConfigEntry('user_status_class', "UserStatusVerifierFilter"); +// CFG: USER-STATUS-FILTER +$cfg->setConfigEntry('user_status_filter', "UserStatusVerifierFilter"); -// CFG: USER-UNCONFIRMED-CLASS -$cfg->setConfigEntry('user_unconfirmed_class', "UserUnconfirmedVerifierFilter"); +// CFG: USER-UNCONFIRMED-FILTER +$cfg->setConfigEntry('user_unconfirmed_filter', "UserUnconfirmedVerifierFilter"); // CFG: CRYPTO-CLASS $cfg->setConfigEntry('crypto_class', "CryptoHelper"); @@ -267,7 +264,7 @@ $cfg->setConfigEntry('guest_class', "Guest"); $cfg->setConfigEntry('cookie_expire', (60*60*2)); // Two hours! // CFG: COOKIE-PATH -$cfg->setConfigEntry('cookie_path', dirname($_SERVER['SCRIPT_NAME']) . "/"); +$cfg->setConfigEntry('cookie_path', $cfg->detectScriptPath() . "/"); // CFG: COOKIE-DOMAIN $cfg->setConfigEntry('cookie_domain', $cfg->detectDomain()); // Is mostly the same... diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 8f6fa15f45..2261c0f2a7 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -51,46 +51,18 @@ class FrameworkConfiguration implements Registerable { // Empty for now } - /** - * "Create" a configuration instance - * - * @param $enableDebug Wether enable debug mode (default: off) - * @return $cfgInstance An instance of this configuration class - */ - public final static function createFrameworkConfiguration ($enableDebug = false) { - /** - * For singleton design pattern because we only need a one-time-run - * through the initial configuration. - */ - if (is_null(self::$cfgInstance)) { - // CFG: ERROR-REPORTING - @error_reporting(E_ALL | E_STRICT); - - /** - * Shall we enable the debug mode? - */ - if ($enableDebug) { - define('DEBUG_MODE', true); - } - - /** - * Crate a config instance - */ - self::$cfgInstance = new FrameworkConfiguration(); - } - - /** - * Return the instance - */ - return self::$cfgInstance; - } - /** * Getter for an instance of this class * * @return $cfgInstance An instance of this class */ public final static function getInstance () { + // is the instance there? + if (is_null(self::$cfgInstance)) { + // Create a config instance + self::$cfgInstance = new FrameworkConfiguration(); + } // END - if + return self::$cfgInstance; } @@ -231,7 +203,7 @@ class FrameworkConfiguration implements Registerable { } // END - if // Construct the full URL now and secure it against CSRF attacks - $baseUrl = $baseUrl . "://" . $this->detectDomain() . dirname($_SERVER['SCRIPT_NAME']); + $baseUrl = $baseUrl . "://" . $this->detectDomain() . $this->detectScriptPath(); // Return the URL return $baseUrl; @@ -256,6 +228,24 @@ class FrameworkConfiguration implements Registerable { return $fullDomain; } + /** + * Detect safely the script path without trailing slash which is the part + * between "http://your-domain.invalid/" and "script-name.php" + */ + public function detectScriptPath () { + // Default is empty + $scriptPath = ""; + + // Is the scriptname set? + if (isset($_SERVER['SCRIPT_NAME'])) { + // Get dirname of it + $scriptPath = dirname($_SERVER['SCRIPT_NAME']); + } // END - if + + // Return it + return $scriptPath; + } + /** * Getter for field name * diff --git a/inc/database.php b/inc/database.php index 03bc377ac5..de0c7d8844 100644 --- a/inc/database.php +++ b/inc/database.php @@ -29,10 +29,9 @@ $layerInstance = null; $cfg = FrameworkConfiguration::getInstance(); // Generate FQFN for the database layer -$INC = sprintf("%sinc/database/lib-%s%s", +$INC = sprintf("%sinc/database/lib-%s.php", $cfg->readConfig('base_path'), - $cfg->readConfig('db_type'), - $cfg->readConfig('php_extension') + $cfg->readConfig('db_type') ); // Load the database layer include @@ -53,31 +52,34 @@ unset($INC); try { $db = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $layerInstance); } catch (NullPointerException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", $e->getMessage() )); } catch (InvalidDirectoryResourceException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", $e->getMessage() )); } catch (PathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", $e->getMessage() )); } catch (PathIsNoDirectoryException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", $e->getMessage() )); } catch (PathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", $e->getMessage() )); } catch (DirPointerNotOpenedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: %s
\n", $e->getMessage() )); } +// Is the app variable there and valid? +if (is_object($app)) $app->setDatabaseInstance($db); + // Datenbankobjekt debuggen if (defined('DEBUG_DATABASE_OBJ')) { DebugMiddleware::getInstance()->output(sprintf("The database sub-system does now look like this:
diff --git a/inc/database/lib-local.php b/inc/database/lib-local.php index ae748c5de1..9e9d5a663c 100644 --- a/inc/database/lib-local.php +++ b/inc/database/lib-local.php @@ -26,23 +26,23 @@ try { $layerInstance = LocalFileDatabase::createLocalFileDatabase(FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance()); } catch (SavePathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathNotFoundException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathIsNoDirectoryException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } catch (SavePathWriteProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() )); } diff --git a/inc/file_io.php b/inc/file_io.php index 0a5ec9b4c3..c141feabd9 100644 --- a/inc/file_io.php +++ b/inc/file_io.php @@ -27,5 +27,8 @@ // Get the instance $io = ObjectFactory::createObjectByConfiguredName('file_io_class'); +// Is the app variable there and valid? +if (is_object($app)) $app->setFileIoInstance($io); + // [EOF] ?> diff --git a/inc/includes.php b/inc/includes.php index 54bd39be01..7e3f5c9ffc 100644 --- a/inc/includes.php +++ b/inc/includes.php @@ -26,7 +26,7 @@ $cfg = FrameworkConfiguration::getInstance(); // Include the class loader function -require(sprintf("%sinc/loader/class_ClassLoader%s", $cfg->readConfig('base_path'), $cfg->readConfig('php_extension'))); +require(sprintf("%sinc/loader/class_ClassLoader.php", $cfg->readConfig('base_path'))); // Does the user has an application specified? if (!empty($_GET['app'])) { diff --git a/inc/language.php b/inc/language.php index 6db17c0ba7..fe8847a3cb 100644 --- a/inc/language.php +++ b/inc/language.php @@ -26,22 +26,25 @@ try { FrameworkConfiguration::getInstance()->readConfig('lang_base_path') )); } catch (LanguagePathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", $e->getMessage() )); } catch (InvalidLanguagePathStringException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", $e->getMessage() )); } catch (LanguagePathIsNoDirectoryException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", $e->getMessage() )); } catch (LanguagePathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", $e->getMessage() )); } +// Is the app variable there and valid? +if (is_object($app)) $app->setLanguageInstance($lang); + // [EOF] ?> diff --git a/inc/selector.php b/inc/selector.php index ddab76926e..d20cbcb04a 100644 --- a/inc/selector.php +++ b/inc/selector.php @@ -29,6 +29,7 @@ $cfg = FrameworkConfiguration::getInstance(); $configAppIncludes = array( sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class "config", // The application's own configuration + "data", // Application data "init", // The application initializer "loader", // The application's class loader "debug", // Some debugging stuff @@ -45,11 +46,10 @@ foreach ($configAppIncludes as $inc) { } // Generate a FQFN for the helper class - $fqfn = sprintf("%s%s/%s%s", + $fqfn = sprintf("%s%s/%s.php", $cfg->readConfig('application_path'), $cfg->readConfig('app_name'), - $inc, - $cfg->readConfig('php_extension') + $inc ); // Does the include file exists? @@ -58,8 +58,8 @@ foreach ($configAppIncludes as $inc) { require_once($fqfn); } elseif ($cfg->readConfig('verbose_level') > 0) { // File is missing - trigger_error(sprintf("Cannot load application script %s! File is missing or read-protected.", - $inc . $cfg->readConfig('php_extension') + trigger_error(sprintf("Cannot load application script %s.php! File is missing or read-protected.", + $inc )); } } -- 2.39.5