From b912eda46059527fc0475e043944c3ebff47fbcd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 12 Apr 2008 22:35:21 +0000 Subject: [PATCH] Several MVC classes added, entryPoint method rewritten --- .gitattributes | 22 +++ .../selector/class_ApplicationHelper.php | 14 ++ application/selector/starter.php | 2 +- .../ship-simu/class_ApplicationHelper.php | 37 +++- application/ship-simu/config.php | 32 +++ application/ship-simu/init.php | 2 +- application/ship-simu/loader.php | 12 +- application/ship-simu/starter.php | 2 +- .../templates/de/code/shipsimu_main.ctp | 8 + devel/class_Debug.php | 2 +- .../exceptions/class_FrameworkException.php | 4 +- .../class_MismatchingCompressorsException.php | 4 +- .../class_ContainerItemIsNoArrayException.php | 4 +- .../class_ContainerItemIsNullException.php | 4 +- .../class_ContainerMaybeDamagedException.php | 4 +- .../class_SavePathIsEmptyException.php | 4 +- .../class_SavePathIsNoDirectoryException.php | 4 +- .../class_SavePathReadProtectedException.php | 4 +- .../class_SavePathWriteProtectedException.php | 4 +- .../io/class_DirPointerNotOpenedException.php | 4 +- .../class_FilePointerNotOpenedException.php | 4 +- .../io/class_InvalidDataLengthException.php | 4 +- ...lass_InvalidDirectoryResourceException.php | 4 +- .../io/class_InvalidMD5ChecksumException.php | 4 +- .../io/class_PathIsEmptyException.php | 4 +- .../io/class_PathIsNoDirectoryException.php | 4 +- .../io/class_PathReadProtectedException.php | 4 +- ...ass_InvalidLanguagePathStringException.php | 4 +- .../class_LanguagePathIsEmptyException.php | 4 +- ...ass_LanguagePathIsNoDirectoryException.php | 4 +- ...ass_LanguagePathReadProtectedException.php | 4 +- .../class_MissingFileIoHandlerException.php | 4 +- .../class_MissingLanguageHandlerException.php | 4 +- .../main/class_ClassMismatchException.php | 4 +- .../main/class_ClassNotFoundException.php | 4 +- .../class_ConfigEntryIsEmptyException.php | 4 +- .../class_ConfigEntryNotFoundException.php | 4 +- .../class_DimNotFoundInArrayException.php | 4 +- .../main/class_EmptyVariableException.php | 46 +++++ .../class_ExceptionNotChangedException.php | 4 +- .../main/class_ExceptionNotFoundException.php | 4 +- .../main/class_GetterNotFoundException.php | 9 +- .../main/class_InvalidArrayCountException.php | 4 +- .../main/class_InvalidCommandException.php | 46 +++++ .../class_InvalidCommandInstanceException.php | 46 +++++ .../main/class_InvalidControllerException.php | 46 +++++ .../main/class_InvalidObjectException.php | 4 +- .../class_MissingArrayElementsException.php | 4 +- ...ingDecimalsThousandsSeperatorException.php | 4 +- .../main/class_MissingMethodException.php | 4 +- .../main/class_NoArrayCreatedException.php | 4 +- .../main/class_NoArrayException.php | 4 +- .../main/class_NoObjectException.php | 4 +- .../main/class_NullPointerException.php | 4 +- ...ss_ResponseHeadersAlreadySentException.php | 45 +++++ .../main/class_VariableIsNotSetException.php | 4 +- .../class_BasePathIsEmptyException.php | 4 +- .../class_BasePathIsNoDirectoryException.php | 4 +- .../class_BasePathReadProtectedException.php | 4 +- .../class_InvalidBasePathStringException.php | 4 +- ...s_InvalidTemplateVariableNameException.php | 4 +- .../class_UnexpectedTemplateTypeException.php | 4 +- ...ass_UnsupportedTemplateEngineException.php | 4 +- .../class_ViewHelperNotFoundException.php | 7 +- .../class_ManageableApplication.php | 11 +- inc/classes/interfaces/class_ | 4 +- .../interfaces/class_FrameworkInterface.php | 4 +- .../interfaces/commands/class_Commandable.php | 4 +- .../compressor/class_Compressor.php | 4 +- inc/classes/interfaces/controller/.htaccess | 1 + .../controller/class_Controller.php | 36 ++++ .../class_FrameworkDatabaseInterface.php | 4 +- .../class_DatabaseFrontendInterface.php | 4 +- .../middleware/class_DatabaseConnector.php | 4 +- .../interfaces/debug/class_Debugger.php | 4 +- .../extended/class_LimitableObject.php | 4 +- .../interfaces/io/class_Streamable.php | 4 +- .../io/file/class_FileInputStreamer.php | 4 +- .../io/file/class_FileOutputStreamer.php | 4 +- .../io/output/class_OutputStreamer.php | 4 +- .../language/class_ManageableLanguage.php | 4 +- .../interfaces/request/class_Requestable.php | 4 +- inc/classes/interfaces/resolver/.htaccess | 1 + .../resolver/class_CommandResolver.php | 44 +++++ .../resolver/class_ControllerResolver.php | 34 ++++ .../response/class_Responseable.php | 4 +- .../template/class_CompileableTemplate.php | 4 +- .../template/view/class_ViewHelper.php | 4 +- inc/classes/main/class_ | 4 +- .../main/class_BaseFrameworkSystem.php | 70 +++++-- .../main/class_FrameworkArrayObject.php | 4 +- .../main/commands/class_BaseCommand.php | 52 ++++- inc/classes/main/commands/local/.htaccess | 1 + .../commands/local/class_LocalHomeCommand.php | 90 +++++++++ .../main/compressor/class_Bzip2Compressor.php | 4 +- .../main/compressor/class_GzipCompressor.php | 4 +- .../main/compressor/class_NullCompressor.php | 4 +- .../main/console/class_ConsoleTools.php | 4 +- .../main/controller/class_BaseController.php | 8 +- inc/classes/main/controller/default/.htaccess | 1 + .../default/class_DefaultController.php | 96 +++++++++ .../main/controller/registration/.htaccess | 1 + .../class_DefaultRegistrationController.php | 71 +++++++ .../database/class_BaseDatabaseFrontend.php | 4 +- .../classes/class_LocalFileDatabase.php | 4 +- .../main/debug/class_DebugConsoleOutput.php | 4 +- .../main/debug/class_DebugErrorLogOutput.php | 4 +- .../main/debug/class_DebugWebOutput.php | 4 +- .../main/extended/class_ObjectLimits.php | 4 +- .../extended/class_SerializationContainer.php | 4 +- inc/classes/main/io/class_FileIOStream.php | 4 +- .../io/class_FrameworkDirectoryPointer.php | 4 +- .../io/class_FrameworkFileInputPointer.php | 4 +- .../io/class_FrameworkFileOutputPointer.php | 4 +- .../main/language/class_LanguageSystem.php | 4 +- .../main/output/class_ConsoleOutput.php | 4 +- inc/classes/main/output/class_WebOutput.php | 4 +- .../main/request/class_HttpRequest.php | 4 +- inc/classes/main/resolver/.htaccess | 1 + .../main/resolver/class_BaseResolver.php | 115 +++++++++++ inc/classes/main/resolver/local/.htaccess | 1 + .../local/class_LocalCommandResolver.php | 184 +++++++++++++++++ .../local/class_LocalControllerResolver.php | 186 ++++++++++++++++++ .../main/response/class_HttpResponse.php | 36 +++- .../main/template/class_TemplateEngine.php | 4 +- .../middleware/class_BaseMiddleware.php | 4 +- .../compressor/class_CompressorChannel.php | 4 +- .../database/class_DatabaseConnection.php | 4 +- .../debug/class_DebugMiddleware.php | 4 +- .../middleware/io/class_FileIOHandler.php | 4 +- inc/config.php | 7 +- inc/config/class_FrameworkConfiguration.php | 4 +- inc/database.php | 4 +- inc/database/lib-local.php | 4 +- inc/file_io.php | 4 +- inc/includes.php | 4 +- inc/language.php | 2 +- inc/loader/class_ClassLoader.php | 4 +- inc/output.php | 4 +- inc/selector.php | 4 +- templates/de/code/emergency_exit.ctp | 9 + tests/ConfigTest.php | 19 ++ tests/old/contract-test.php | 4 +- 143 files changed, 1601 insertions(+), 258 deletions(-) create mode 100644 application/ship-simu/config.php create mode 100644 inc/classes/exceptions/main/class_EmptyVariableException.php create mode 100644 inc/classes/exceptions/main/class_InvalidCommandException.php create mode 100644 inc/classes/exceptions/main/class_InvalidCommandInstanceException.php create mode 100644 inc/classes/exceptions/main/class_InvalidControllerException.php create mode 100644 inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php create mode 100644 inc/classes/interfaces/controller/.htaccess create mode 100644 inc/classes/interfaces/controller/class_Controller.php create mode 100644 inc/classes/interfaces/resolver/.htaccess create mode 100644 inc/classes/interfaces/resolver/class_CommandResolver.php create mode 100644 inc/classes/interfaces/resolver/class_ControllerResolver.php create mode 100644 inc/classes/main/commands/local/.htaccess create mode 100644 inc/classes/main/commands/local/class_LocalHomeCommand.php create mode 100644 inc/classes/main/controller/default/.htaccess create mode 100644 inc/classes/main/controller/default/class_DefaultController.php create mode 100644 inc/classes/main/controller/registration/.htaccess create mode 100644 inc/classes/main/controller/registration/class_DefaultRegistrationController.php create mode 100644 inc/classes/main/resolver/.htaccess create mode 100644 inc/classes/main/resolver/class_BaseResolver.php create mode 100644 inc/classes/main/resolver/local/.htaccess create mode 100644 inc/classes/main/resolver/local/class_LocalCommandResolver.php create mode 100644 inc/classes/main/resolver/local/class_LocalControllerResolver.php diff --git a/.gitattributes b/.gitattributes index bbdb8c2..37ed7a4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,6 +16,7 @@ application/selector/templates/de/code/selector_apps.ctp -text application/selector/templates/de/code/selector_main.ctp -text application/ship-simu/.htaccess -text application/ship-simu/class_ApplicationHelper.php -text +application/ship-simu/config.php -text application/ship-simu/debug.php -text application/ship-simu/exceptions.php -text application/ship-simu/exceptions/.htaccess -text @@ -167,10 +168,14 @@ inc/classes/exceptions/main/class_ClassNotFoundException.php -text inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php -text inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php -text inc/classes/exceptions/main/class_DimNotFoundInArrayException.php -text +inc/classes/exceptions/main/class_EmptyVariableException.php -text inc/classes/exceptions/main/class_ExceptionNotChangedException.php -text inc/classes/exceptions/main/class_ExceptionNotFoundException.php -text inc/classes/exceptions/main/class_GetterNotFoundException.php -text inc/classes/exceptions/main/class_InvalidArrayCountException.php -text +inc/classes/exceptions/main/class_InvalidCommandException.php -text +inc/classes/exceptions/main/class_InvalidCommandInstanceException.php -text +inc/classes/exceptions/main/class_InvalidControllerException.php -text inc/classes/exceptions/main/class_InvalidObjectException.php -text inc/classes/exceptions/main/class_MissingArrayElementsException.php -text inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php -text @@ -179,6 +184,7 @@ inc/classes/exceptions/main/class_NoArrayCreatedException.php -text inc/classes/exceptions/main/class_NoArrayException.php -text inc/classes/exceptions/main/class_NoObjectException.php -text inc/classes/exceptions/main/class_NullPointerException.php -text +inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php -text inc/classes/exceptions/main/class_VariableIsNotSetException.php -text inc/classes/exceptions/template/.htaccess -text inc/classes/exceptions/template/class_BasePathIsEmptyException.php -text @@ -197,6 +203,8 @@ inc/classes/interfaces/class_FrameworkInterface.php -text inc/classes/interfaces/commands/class_Commandable.php -text inc/classes/interfaces/compressor/.htaccess -text inc/classes/interfaces/compressor/class_Compressor.php -text +inc/classes/interfaces/controller/.htaccess -text +inc/classes/interfaces/controller/class_Controller.php -text inc/classes/interfaces/database/.htaccess -text inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php -text inc/classes/interfaces/database/frontend/.htaccess -text @@ -218,6 +226,9 @@ inc/classes/interfaces/language/.htaccess -text inc/classes/interfaces/language/class_ManageableLanguage.php -text inc/classes/interfaces/request/.htaccess -text inc/classes/interfaces/request/class_Requestable.php -text +inc/classes/interfaces/resolver/.htaccess -text +inc/classes/interfaces/resolver/class_CommandResolver.php -text +inc/classes/interfaces/resolver/class_ControllerResolver.php -text inc/classes/interfaces/response/.htaccess -text inc/classes/interfaces/response/class_Responseable.php -text inc/classes/interfaces/template/.htaccess -text @@ -230,6 +241,8 @@ inc/classes/main/class_FrameworkArrayObject.php -text inc/classes/main/commands/class_BaseCommand.php -text inc/classes/main/commands/extended/.htaccess -text inc/classes/main/commands/extended/class_ -text +inc/classes/main/commands/local/.htaccess -text +inc/classes/main/commands/local/class_LocalHomeCommand.php -text inc/classes/main/compressor/.htaccess -text inc/classes/main/compressor/class_Bzip2Compressor.php -text inc/classes/main/compressor/class_GzipCompressor.php -text @@ -238,6 +251,10 @@ inc/classes/main/console/.htaccess -text inc/classes/main/console/class_ConsoleTools.php -text inc/classes/main/controller/.htaccess -text inc/classes/main/controller/class_BaseController.php -text +inc/classes/main/controller/default/.htaccess -text +inc/classes/main/controller/default/class_DefaultController.php -text +inc/classes/main/controller/registration/.htaccess -text +inc/classes/main/controller/registration/class_DefaultRegistrationController.php -text inc/classes/main/database/.htaccess -text inc/classes/main/database/class_BaseDatabaseFrontend.php -text inc/classes/main/database/classes/.htaccess -text @@ -261,6 +278,11 @@ inc/classes/main/output/class_ConsoleOutput.php -text inc/classes/main/output/class_WebOutput.php -text inc/classes/main/request/.htaccess -text inc/classes/main/request/class_HttpRequest.php -text +inc/classes/main/resolver/.htaccess -text +inc/classes/main/resolver/class_BaseResolver.php -text +inc/classes/main/resolver/local/.htaccess -text +inc/classes/main/resolver/local/class_LocalCommandResolver.php -text +inc/classes/main/resolver/local/class_LocalControllerResolver.php -text inc/classes/main/response/.htaccess -text inc/classes/main/response/class_HttpResponse.php -text inc/classes/main/template/.htaccess -text diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index 3edc751..7f721c3 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -55,6 +55,11 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica */ private $shortName = ""; + /** + * Name of the master template + */ + private $masterTemplate = ""; + /** * An instance of this class */ @@ -157,6 +162,15 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $this->shortName = $shortName; } + /** + * Getter for master template name + * + * @return $masterTemplate Name of the master template + */ + public final function getMasterTemplate () { + return $this->masterTemplate; + } + /** * Launcher for the application selector * diff --git a/application/selector/starter.php b/application/selector/starter.php index 21d451a..9d0d8ac 100644 --- a/application/selector/starter.php +++ b/application/selector/starter.php @@ -53,7 +53,7 @@ try { ); eval($eval); } catch (FrameworkException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Die Applikation %s kann nicht gestartet werden. Grund: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Die Applikation %s kann nicht gestartet werden. Grund: %s", $application, $e->getMessage() )); diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php index ff8fe5e..07aeffc 100644 --- a/application/ship-simu/class_ApplicationHelper.php +++ b/application/ship-simu/class_ApplicationHelper.php @@ -55,6 +55,11 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica */ private $shortName = ""; + /** + * The name of the master template + */ + private $masterTemplate = "shipsimu_main"; + /** * An instance of this class */ @@ -97,7 +102,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica /** * Getter for the version number * - * @return $appVersion The application's version number + * @return $appVersion The application's version number */ public final function getAppVersion () { return $this->appVersion; @@ -106,7 +111,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica /** * Setter for the version number * - * @param $appVersion The application's version number + * @param $appVersion The application's version number * @return void */ public final function setAppVersion ($appVersion) { @@ -157,23 +162,35 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $this->shortName = $shortName; } + /** + * Getter for master template name + * + * @return $masterTemplate Name of the master template + */ + public final function getMasterTemplate () { + return $this->masterTemplate; + } + /** * Launches the ship-simulator game * * @return void */ public final function entryPoint () { - // Handle the request - $this->handleRequest(); + // Get default command + $defaultCommand = $this->getConfigInstance()->readConfig("default_command"); - // Prepare the template engine - $tplEngine = $this->prepareTemplateEngine($this); + // Create a new request object + $requestInstance = HttpRequest::createHttpRequest(); - // Load the main template - $tplEngine->loadCodeTemplate("shipsimu_main"); + // ... and a new response object + $responseInstance = HttpResponse::createHttpResponse($this); - // Raise an error here - trigger_error(__METHOD__.": Unfinished work!"); + // Get a new controller instance as well + $controllerInstance = LocalControllerResolver::createLocalControllerResolver($defaultCommand, $this)->resolveDefaultController(); + + // Handle the request + $controllerInstance->handleRequest($requestInstance, $responseInstance); } } diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php new file mode 100644 index 0000000..f9bff72 --- /dev/null +++ b/application/ship-simu/config.php @@ -0,0 +1,32 @@ + + * @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 . + */ + +// Get a configuration instance for shorter lines +$cfg = FrameworkConfiguration::getInstance(); + +// CFG: DEFAULT-COMMAND +$cfg->setConfigEntry("default_command", "home"); + +// [EOF] +?> diff --git a/application/ship-simu/init.php b/application/ship-simu/init.php index 558c811..1a3fc08 100644 --- a/application/ship-simu/init.php +++ b/application/ship-simu/init.php @@ -41,7 +41,7 @@ eval($eval); // Set application name and version $app->setAppName("Ship-Simu Schiffsimulator"); -$app->setAppVersion("0.1"); +$app->setAppVersion("0.0.0"); $app->setAppShortName("ship-simu"); // Initialize output system diff --git a/application/ship-simu/loader.php b/application/ship-simu/loader.php index 16bbaf9..0dffa20 100644 --- a/application/ship-simu/loader.php +++ b/application/ship-simu/loader.php @@ -34,22 +34,26 @@ foreach ($lowerClasses as $class) { try { ClassLoader::getInstance()->loadClasses(sprintf("%s/%s/%s", FrameworkConfiguration::getInstance()->readConfig("application_path"), $application, $class)); } catch (PathIsNoDirectoryException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + $application, $class, $e->getMessage() )); } catch (PathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + $application, $class, $e->getMessage() )); } catch (PathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + $application, $class, $e->getMessage() )); } catch (DirPointerNotOpenedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", + $application, $class, $e->getMessage() )); diff --git a/application/ship-simu/starter.php b/application/ship-simu/starter.php index 137ebbc..458ccf8 100644 --- a/application/ship-simu/starter.php +++ b/application/ship-simu/starter.php @@ -54,7 +54,7 @@ try { ); eval($eval); } catch (FrameworkException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:] Die Applikation %s kann nicht gestartet werden. Grund: %s", + ApplicationEntryPoint::app_die(sprintf("[Main:] Die Applikation %s kann nicht gestartet werden. Grund: %s", $application, $e->getMessage() )); diff --git a/application/ship-simu/templates/de/code/shipsimu_main.ctp b/application/ship-simu/templates/de/code/shipsimu_main.ctp index 367dda7..208aa2f 100644 --- a/application/ship-simu/templates/de/code/shipsimu_main.ctp +++ b/application/ship-simu/templates/de/code/shipsimu_main.ctp @@ -8,4 +8,12 @@ {--HEADER_SHIP_SIMU--} +
+ {?content?} +
+ +
+ {--FOOTER_SHIP_SIMU--} +
+ {?footer_msg:footer_msg={--FOOTER_SHIP_SIMU--}?} diff --git a/devel/class_Debug.php b/devel/class_Debug.php index 1adbe5a..c1a0343 100644 --- a/devel/class_Debug.php +++ b/devel/class_Debug.php @@ -18,7 +18,7 @@ * 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 . + * along with this program. If not, see . */ class Debug { // Constructor diff --git a/inc/classes/exceptions/class_FrameworkException.php b/inc/classes/exceptions/class_FrameworkException.php index 175b2b2..7655cc9 100644 --- a/inc/classes/exceptions/class_FrameworkException.php +++ b/inc/classes/exceptions/class_FrameworkException.php @@ -5,10 +5,10 @@ * attach a dedicated message to it. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php b/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php index 46f2563..f87f254 100644 --- a/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php +++ b/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php @@ -3,10 +3,10 @@ * An exception thrown when compressors are mismatching * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php b/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php index 6fdc825..4748dca 100644 --- a/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php +++ b/inc/classes/exceptions/container/class_ContainerItemIsNoArrayException.php @@ -3,10 +3,10 @@ * An exception thrown when a container item is not an array * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/container/class_ContainerItemIsNullException.php b/inc/classes/exceptions/container/class_ContainerItemIsNullException.php index 6f17940..f19f04a 100644 --- a/inc/classes/exceptions/container/class_ContainerItemIsNullException.php +++ b/inc/classes/exceptions/container/class_ContainerItemIsNullException.php @@ -3,10 +3,10 @@ * An exception thrown when a container item is null * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php b/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php index aa010fa..61f793e 100644 --- a/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php +++ b/inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php @@ -3,10 +3,10 @@ * An exception thrown when the container is possibly damaged * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php b/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php index 7199369..a254b8a 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php @@ -3,10 +3,10 @@ * An exception thrown when the save path string is empty * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php b/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php index 8d2c89b..25c20fe 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php @@ -3,10 +3,10 @@ * An exception thrown when the save path is no directory * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php index d4a0de4..dd693ed 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php @@ -3,10 +3,10 @@ * An exception thrown when the save path is read-protected * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php b/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php index a19d667..601e885 100644 --- a/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php +++ b/inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php @@ -3,10 +3,10 @@ * An exception thrown when the save path is write-protected * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php b/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php index 6be3455..ff1d5e8 100644 --- a/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php +++ b/inc/classes/exceptions/io/class_DirPointerNotOpenedException.php @@ -3,10 +3,10 @@ * An exception thrown when a directory pointer is not opended * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php index 4ecfc2e..841782a 100644 --- a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php +++ b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php @@ -3,10 +3,10 @@ * An exception thrown when a file pointer is not opened * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_InvalidDataLengthException.php b/inc/classes/exceptions/io/class_InvalidDataLengthException.php index 310ab0b..4554bac 100644 --- a/inc/classes/exceptions/io/class_InvalidDataLengthException.php +++ b/inc/classes/exceptions/io/class_InvalidDataLengthException.php @@ -3,10 +3,10 @@ * An exception thrown when the length of the data mismatch * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php b/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php index 32de296..ada88ed 100644 --- a/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php +++ b/inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php @@ -3,10 +3,10 @@ * An exception thrown when the returned directory resource is invalid * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php b/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php index 2e1a51d..047591b 100644 --- a/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php +++ b/inc/classes/exceptions/io/class_InvalidMD5ChecksumException.php @@ -3,10 +3,10 @@ * An exception thrown when a MD5 checksum does not exception * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_PathIsEmptyException.php b/inc/classes/exceptions/io/class_PathIsEmptyException.php index 77a4a54..bd67212 100644 --- a/inc/classes/exceptions/io/class_PathIsEmptyException.php +++ b/inc/classes/exceptions/io/class_PathIsEmptyException.php @@ -3,10 +3,10 @@ * An exception thrown when the path string is empty * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php b/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php index fbf4800..f02225f 100644 --- a/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php +++ b/inc/classes/exceptions/io/class_PathIsNoDirectoryException.php @@ -3,10 +3,10 @@ * An exception thrown when a given path is not a directory * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/io/class_PathReadProtectedException.php b/inc/classes/exceptions/io/class_PathReadProtectedException.php index 14891d7..bca9d36 100644 --- a/inc/classes/exceptions/io/class_PathReadProtectedException.php +++ b/inc/classes/exceptions/io/class_PathReadProtectedException.php @@ -3,10 +3,10 @@ * An exception thrown when a path is read-protected * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php b/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php index 536a073..e21ebaa 100644 --- a/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php +++ b/inc/classes/exceptions/language/class_InvalidLanguagePathStringException.php @@ -3,10 +3,10 @@ * An exception thrown when the language path string is invalid * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php b/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php index e1aef2a..be02f0e 100644 --- a/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php +++ b/inc/classes/exceptions/language/class_LanguagePathIsEmptyException.php @@ -3,10 +3,10 @@ * An exception thrown when the language path string is empty * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php b/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php index 3772ee0..05c450f 100644 --- a/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/language/class_LanguagePathIsNoDirectoryException.php @@ -3,10 +3,10 @@ * An exception thrown when the language path is no directory * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php b/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php index 1ac1a94..f9c2111 100644 --- a/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php +++ b/inc/classes/exceptions/language/class_LanguagePathReadProtectedException.php @@ -3,10 +3,10 @@ * An exception thrown when the language path is read-protected * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php b/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php index f8d5e2d..c48c06e 100644 --- a/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php +++ b/inc/classes/exceptions/language/class_MissingFileIoHandlerException.php @@ -3,10 +3,10 @@ * An exception thrown when the language handler is missing * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php b/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php index 0a3171a..744add6 100644 --- a/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php +++ b/inc/classes/exceptions/language/class_MissingLanguageHandlerException.php @@ -3,10 +3,10 @@ * An exception thrown when the language handler is missing * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_ClassMismatchException.php b/inc/classes/exceptions/main/class_ClassMismatchException.php index a17ecdf..1e3f6d7 100644 --- a/inc/classes/exceptions/main/class_ClassMismatchException.php +++ b/inc/classes/exceptions/main/class_ClassMismatchException.php @@ -3,10 +3,10 @@ * An exception thrown when two classes are not matching * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_ClassNotFoundException.php b/inc/classes/exceptions/main/class_ClassNotFoundException.php index ba1efd6..897f220 100644 --- a/inc/classes/exceptions/main/class_ClassNotFoundException.php +++ b/inc/classes/exceptions/main/class_ClassNotFoundException.php @@ -3,10 +3,10 @@ * An exception thrown when a class was not found * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php b/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php index 781adca..a1ddf02 100644 --- a/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php +++ b/inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php @@ -3,10 +3,10 @@ * An exception thrown when a configuration entry is empty * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php b/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php index 80cef7c..3858703 100644 --- a/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php +++ b/inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php @@ -3,10 +3,10 @@ * An exception thrown when a configuration entry is not found * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php b/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php index 484a414..ff011f2 100644 --- a/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php +++ b/inc/classes/exceptions/main/class_DimNotFoundInArrayException.php @@ -3,10 +3,10 @@ * An exception thron when dimension entries are not found in an array * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_EmptyVariableException.php b/inc/classes/exceptions/main/class_EmptyVariableException.php new file mode 100644 index 0000000..a415276 --- /dev/null +++ b/inc/classes/exceptions/main/class_EmptyVariableException.php @@ -0,0 +1,46 @@ + + * @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 EmptyVariableException extends FrameworkException { + /** + * The constructor + * + * @param $msgArray Message array holding all needed data + * @param $code Code number for the exception + * @return void + */ + public function __construct (array $msgArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:%d] Variable %s is not set.", + $msgArray[0]->__toString(), + $this->getLine(), + $msgArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/inc/classes/exceptions/main/class_ExceptionNotChangedException.php b/inc/classes/exceptions/main/class_ExceptionNotChangedException.php index e23adfa..e1ff786 100644 --- a/inc/classes/exceptions/main/class_ExceptionNotChangedException.php +++ b/inc/classes/exceptions/main/class_ExceptionNotChangedException.php @@ -3,10 +3,10 @@ * An exception thrown when an exception was not changed * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @link http://www.ship-simu.org * @deprecated * * This program is free software: you can redistribute it and/or modify diff --git a/inc/classes/exceptions/main/class_ExceptionNotFoundException.php b/inc/classes/exceptions/main/class_ExceptionNotFoundException.php index fe50215..2fd9eec 100644 --- a/inc/classes/exceptions/main/class_ExceptionNotFoundException.php +++ b/inc/classes/exceptions/main/class_ExceptionNotFoundException.php @@ -3,10 +3,10 @@ * An exception thrown when an other exception was not found * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_GetterNotFoundException.php b/inc/classes/exceptions/main/class_GetterNotFoundException.php index c89c0d2..b03b21c 100644 --- a/inc/classes/exceptions/main/class_GetterNotFoundException.php +++ b/inc/classes/exceptions/main/class_GetterNotFoundException.php @@ -3,10 +3,10 @@ * An exception thrown when a getter for an attribute was not found * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -29,10 +29,7 @@ class GetterNotFoundException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($dataArray, $code) { - // Cast the array - $dataArray = (array) $dataArray; - + public function __construct (array $dataArray, $code) { // Add a message around the missing class $message = sprintf("[%s:%d] Getter-Methode für Attribut %s nicht gefunden.", $dataArray[0]->__toString(), diff --git a/inc/classes/exceptions/main/class_InvalidArrayCountException.php b/inc/classes/exceptions/main/class_InvalidArrayCountException.php index 75fa544..d8a9f19 100644 --- a/inc/classes/exceptions/main/class_InvalidArrayCountException.php +++ b/inc/classes/exceptions/main/class_InvalidArrayCountException.php @@ -3,10 +3,10 @@ * An exception thrown when the number of array elements mismatch * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_InvalidCommandException.php b/inc/classes/exceptions/main/class_InvalidCommandException.php new file mode 100644 index 0000000..af30b8c --- /dev/null +++ b/inc/classes/exceptions/main/class_InvalidCommandException.php @@ -0,0 +1,46 @@ + + * @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 InvalidCommandException extends FrameworkException { + /** + * The constructor + * + * @param $message Message from the exception + * @param $code Code number for the exception + * @return void + */ + public function __construct (array $msgArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:%d] Invalid command %s detected.", + $msgArray[0]->__toString(), + $this->getLine(), + $msgArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php b/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php new file mode 100644 index 0000000..e802e9e --- /dev/null +++ b/inc/classes/exceptions/main/class_InvalidCommandInstanceException.php @@ -0,0 +1,46 @@ + + * @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 InvalidCommandInstanceException extends FrameworkException { + /** + * The constructor + * + * @param $message Message from the exception + * @param $code Code number for the exception + * @return void + */ + public function __construct (array $msgArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:%d] Invalid command %s detected.", + $msgArray[0]->__toString(), + $this->getLine(), + $msgArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/inc/classes/exceptions/main/class_InvalidControllerException.php b/inc/classes/exceptions/main/class_InvalidControllerException.php new file mode 100644 index 0000000..3caf2a5 --- /dev/null +++ b/inc/classes/exceptions/main/class_InvalidControllerException.php @@ -0,0 +1,46 @@ + + * @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 InvalidControllerInstanceException extends FrameworkException { + /** + * The constructor + * + * @param $msgArray Array with data from the exception point + * @param $code Code number for the exception + * @return void + */ + public function __construct (array $msgArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:%d] Invalid controller %s detected.", + $msgArray[0]->__toString(), + $this->getLine(), + $msgArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/inc/classes/exceptions/main/class_InvalidObjectException.php b/inc/classes/exceptions/main/class_InvalidObjectException.php index 08d92df..cc19b75 100644 --- a/inc/classes/exceptions/main/class_InvalidObjectException.php +++ b/inc/classes/exceptions/main/class_InvalidObjectException.php @@ -3,10 +3,10 @@ * An exception thrown when an instance variable instances a non-object * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_MissingArrayElementsException.php b/inc/classes/exceptions/main/class_MissingArrayElementsException.php index 5d483db..3b22ba2 100644 --- a/inc/classes/exceptions/main/class_MissingArrayElementsException.php +++ b/inc/classes/exceptions/main/class_MissingArrayElementsException.php @@ -3,10 +3,10 @@ * An exception thrown when required array elements are missing * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php b/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php index 8ccc62e..5acccef 100644 --- a/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php +++ b/inc/classes/exceptions/main/class_MissingDecimalsThousandsSeperatorException.php @@ -3,10 +3,10 @@ * An exception thrown when the decimal and thousands seperators are missing * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_MissingMethodException.php b/inc/classes/exceptions/main/class_MissingMethodException.php index 8855e5d..9b9fc98 100644 --- a/inc/classes/exceptions/main/class_MissingMethodException.php +++ b/inc/classes/exceptions/main/class_MissingMethodException.php @@ -3,10 +3,10 @@ * An exception thrown when a method is missing * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_NoArrayCreatedException.php b/inc/classes/exceptions/main/class_NoArrayCreatedException.php index b741fdf..298c811 100644 --- a/inc/classes/exceptions/main/class_NoArrayCreatedException.php +++ b/inc/classes/exceptions/main/class_NoArrayCreatedException.php @@ -3,10 +3,10 @@ * An exception thrown then no array was created in a dynamic environment * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_NoArrayException.php b/inc/classes/exceptions/main/class_NoArrayException.php index e885801..615198d 100644 --- a/inc/classes/exceptions/main/class_NoArrayException.php +++ b/inc/classes/exceptions/main/class_NoArrayException.php @@ -1,10 +1,10 @@ - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_NoObjectException.php b/inc/classes/exceptions/main/class_NoObjectException.php index 8cd3c3e..9d70821 100644 --- a/inc/classes/exceptions/main/class_NoObjectException.php +++ b/inc/classes/exceptions/main/class_NoObjectException.php @@ -3,10 +3,10 @@ * A deprecated exception which should be replaced with InvalidObjectException * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @link http://www.ship-simu.org * @deprecated * @see InvalidObjectException * diff --git a/inc/classes/exceptions/main/class_NullPointerException.php b/inc/classes/exceptions/main/class_NullPointerException.php index 0a16aae..6aab6cd 100644 --- a/inc/classes/exceptions/main/class_NullPointerException.php +++ b/inc/classes/exceptions/main/class_NullPointerException.php @@ -3,10 +3,10 @@ * An exception thrown when an object instance is null * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php b/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php new file mode 100644 index 0000000..72751d9 --- /dev/null +++ b/inc/classes/exceptions/main/class_ResponseHeadersAlreadySentException.php @@ -0,0 +1,45 @@ + + * @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 ResponseHeadersAlreadySentException extends FrameworkException { + /** + * The constructor + * + * @param $message Message from the exception + * @param $code Code number for the exception + * @return void + */ + public function __construct (BaseFrameworkSystem $class, $code) { + // Add a message around the missing class + $message = sprintf("[%s:%d] Headers are already sent!", + $class->__toString(), + $this->getLine() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/inc/classes/exceptions/main/class_VariableIsNotSetException.php b/inc/classes/exceptions/main/class_VariableIsNotSetException.php index 84daff1..7d05f69 100644 --- a/inc/classes/exceptions/main/class_VariableIsNotSetException.php +++ b/inc/classes/exceptions/main/class_VariableIsNotSetException.php @@ -3,10 +3,10 @@ * An exception thrown when a variable is not set * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_BasePathIsEmptyException.php b/inc/classes/exceptions/template/class_BasePathIsEmptyException.php index 3009863..5fae513 100644 --- a/inc/classes/exceptions/template/class_BasePathIsEmptyException.php +++ b/inc/classes/exceptions/template/class_BasePathIsEmptyException.php @@ -3,10 +3,10 @@ * An exception thrown when the base path is empty * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php b/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php index 9dc01e2..0b9486d 100644 --- a/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php +++ b/inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php @@ -3,10 +3,10 @@ * An exception thrown when the base path is no directory * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_BasePathReadProtectedException.php b/inc/classes/exceptions/template/class_BasePathReadProtectedException.php index 37b10b2..d86a1fc 100644 --- a/inc/classes/exceptions/template/class_BasePathReadProtectedException.php +++ b/inc/classes/exceptions/template/class_BasePathReadProtectedException.php @@ -3,10 +3,10 @@ * An exception thrown when the base path is read-protected * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_InvalidBasePathStringException.php b/inc/classes/exceptions/template/class_InvalidBasePathStringException.php index 095ed8b..3ee2341 100644 --- a/inc/classes/exceptions/template/class_InvalidBasePathStringException.php +++ b/inc/classes/exceptions/template/class_InvalidBasePathStringException.php @@ -3,10 +3,10 @@ * An exception thrown hen the base path string is invalid * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php b/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php index f625ccc..c5cbce4 100644 --- a/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php +++ b/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php @@ -3,10 +3,10 @@ * An exception thrown when a template variable name is invalid * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php b/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php index ba37050..568fa91 100644 --- a/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php +++ b/inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php @@ -3,10 +3,10 @@ * An exception thrown when the template type is not supported * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php b/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php index a66fda3..3433651 100644 --- a/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php +++ b/inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php @@ -3,10 +3,10 @@ * An exception thrown when the template engine instance is not supported * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php b/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php index ece8b34..6cd771a 100644 --- a/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php +++ b/inc/classes/exceptions/template/class_ViewHelperNotFoundException.php @@ -3,10 +3,10 @@ * An exception thrown when a given view helper was not found * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -31,8 +31,9 @@ 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:%d] View-Helper %s ist ungültig.", $msgArray[0]->__toString(), + $this->getLine(), $msgArray[1] ); diff --git a/inc/classes/interfaces/application/class_ManageableApplication.php b/inc/classes/interfaces/application/class_ManageableApplication.php index 81ff0c4..5bb3dac 100644 --- a/inc/classes/interfaces/application/class_ManageableApplication.php +++ b/inc/classes/interfaces/application/class_ManageableApplication.php @@ -8,10 +8,10 @@ * - And many more... * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -71,6 +71,13 @@ interface ManageableApplication extends FrameworkInterface { */ function setAppShortName ($shortName); + /** + * Getter for master template name + * + * @return $masterTemplate Name of the master template + */ + function getMasterTemplate (); + /** * Launches the application * diff --git a/inc/classes/interfaces/class_ b/inc/classes/interfaces/class_ index 1e4ea82..055ad90 100644 --- a/inc/classes/interfaces/class_ +++ b/inc/classes/interfaces/class_ @@ -3,10 +3,10 @@ * * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/class_FrameworkInterface.php b/inc/classes/interfaces/class_FrameworkInterface.php index 2906fce..f9489dd 100644 --- a/inc/classes/interfaces/class_FrameworkInterface.php +++ b/inc/classes/interfaces/class_FrameworkInterface.php @@ -4,10 +4,10 @@ * method stubs which is being used in every class * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/commands/class_Commandable.php b/inc/classes/interfaces/commands/class_Commandable.php index ab5b53a..4b3eaba 100644 --- a/inc/classes/interfaces/commands/class_Commandable.php +++ b/inc/classes/interfaces/commands/class_Commandable.php @@ -3,10 +3,10 @@ * An interface for commands for the front controller * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/compressor/class_Compressor.php b/inc/classes/interfaces/compressor/class_Compressor.php index 0ce342e..781b393 100644 --- a/inc/classes/interfaces/compressor/class_Compressor.php +++ b/inc/classes/interfaces/compressor/class_Compressor.php @@ -3,10 +3,10 @@ * An interface for compression classes * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/controller/.htaccess b/inc/classes/interfaces/controller/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/interfaces/controller/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/controller/class_Controller.php b/inc/classes/interfaces/controller/class_Controller.php new file mode 100644 index 0000000..f06f583 --- /dev/null +++ b/inc/classes/interfaces/controller/class_Controller.php @@ -0,0 +1,36 @@ + + * @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 Controller extends FrameworkInterface { + /** + * Handles the given request and response + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + function handleRequest (Requestable $requestInstance, Responseable $responseInstance); +} + +// +?> diff --git a/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php b/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php index 5605da3..34c4bcc 100644 --- a/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php +++ b/inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php @@ -3,10 +3,10 @@ * The general interface for all other database interfaces * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php b/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php index 93bbd19..bdea3bd 100644 --- a/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php +++ b/inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php @@ -7,10 +7,10 @@ * compressed before they got saved to a local file. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php b/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php index 4945d14..5c392ed 100644 --- a/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php +++ b/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php @@ -3,10 +3,10 @@ * An interface for middleware database classes * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/debug/class_Debugger.php b/inc/classes/interfaces/debug/class_Debugger.php index 1b76bcf..dc988fe 100644 --- a/inc/classes/interfaces/debug/class_Debugger.php +++ b/inc/classes/interfaces/debug/class_Debugger.php @@ -3,10 +3,10 @@ * An interface for debugger classes * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/extended/class_LimitableObject.php b/inc/classes/interfaces/extended/class_LimitableObject.php index 212e189..80d05d2 100644 --- a/inc/classes/interfaces/extended/class_LimitableObject.php +++ b/inc/classes/interfaces/extended/class_LimitableObject.php @@ -4,10 +4,10 @@ * DatabaseConnection class. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/io/class_Streamable.php b/inc/classes/interfaces/io/class_Streamable.php index ca1a76e..f7f0d00 100644 --- a/inc/classes/interfaces/io/class_Streamable.php +++ b/inc/classes/interfaces/io/class_Streamable.php @@ -3,10 +3,10 @@ * An interface for streams * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/io/file/class_FileInputStreamer.php b/inc/classes/interfaces/io/file/class_FileInputStreamer.php index 75dc429..6ec4064 100644 --- a/inc/classes/interfaces/io/file/class_FileInputStreamer.php +++ b/inc/classes/interfaces/io/file/class_FileInputStreamer.php @@ -3,10 +3,10 @@ * An interface for file input operations. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/io/file/class_FileOutputStreamer.php b/inc/classes/interfaces/io/file/class_FileOutputStreamer.php index a3f896d..6028dc6 100644 --- a/inc/classes/interfaces/io/file/class_FileOutputStreamer.php +++ b/inc/classes/interfaces/io/file/class_FileOutputStreamer.php @@ -3,10 +3,10 @@ * An interface for file output operations. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/io/output/class_OutputStreamer.php b/inc/classes/interfaces/io/output/class_OutputStreamer.php index 992f504..25bdb0f 100644 --- a/inc/classes/interfaces/io/output/class_OutputStreamer.php +++ b/inc/classes/interfaces/io/output/class_OutputStreamer.php @@ -3,10 +3,10 @@ * An interface for output streams * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/language/class_ManageableLanguage.php b/inc/classes/interfaces/language/class_ManageableLanguage.php index 7e3c0fb..2a2b36c 100644 --- a/inc/classes/interfaces/language/class_ManageableLanguage.php +++ b/inc/classes/interfaces/language/class_ManageableLanguage.php @@ -3,10 +3,10 @@ * An interface for language systems * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/request/class_Requestable.php b/inc/classes/interfaces/request/class_Requestable.php index 0571e00..08dd5b1 100644 --- a/inc/classes/interfaces/request/class_Requestable.php +++ b/inc/classes/interfaces/request/class_Requestable.php @@ -3,10 +3,10 @@ * An interface for requests * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/resolver/.htaccess b/inc/classes/interfaces/resolver/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/interfaces/resolver/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/interfaces/resolver/class_CommandResolver.php b/inc/classes/interfaces/resolver/class_CommandResolver.php new file mode 100644 index 0000000..2793eb5 --- /dev/null +++ b/inc/classes/interfaces/resolver/class_CommandResolver.php @@ -0,0 +1,44 @@ + + * @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 CommandResolver extends FrameworkInterface { + /** + * Returns an command instance for a given request class + * + * @param $requestInstance An instance of a request class + * @return $commandInstance An instance of the resolved command + */ + function resolvCommandByRequest (Requestable $requestInstance); + + /** + * Checks wether the given command is valid + * + * @param $commandName The default command we shall execute + * @return $isValid Wether the given command is valid + * @throws EmptyVariableException Thrown if the given command is not set + */ + function isCommandValid ($commandName); +} + +// +?> diff --git a/inc/classes/interfaces/resolver/class_ControllerResolver.php b/inc/classes/interfaces/resolver/class_ControllerResolver.php new file mode 100644 index 0000000..e953cee --- /dev/null +++ b/inc/classes/interfaces/resolver/class_ControllerResolver.php @@ -0,0 +1,34 @@ + + * @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 ControllerResolver extends FrameworkInterface { + /** + * Resolves the default controller of the given command + * + * @return $controllerInstance A controller instance for the default command + */ + function resolveDefaultController (); +} + +// +?> diff --git a/inc/classes/interfaces/response/class_Responseable.php b/inc/classes/interfaces/response/class_Responseable.php index f83e7f9..d8fdaee 100644 --- a/inc/classes/interfaces/response/class_Responseable.php +++ b/inc/classes/interfaces/response/class_Responseable.php @@ -3,10 +3,10 @@ * An interface for responses * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/template/class_CompileableTemplate.php b/inc/classes/interfaces/template/class_CompileableTemplate.php index 0bf7556..b73dd5b 100644 --- a/inc/classes/interfaces/template/class_CompileableTemplate.php +++ b/inc/classes/interfaces/template/class_CompileableTemplate.php @@ -3,10 +3,10 @@ * An interface for template engines * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/interfaces/template/view/class_ViewHelper.php b/inc/classes/interfaces/template/view/class_ViewHelper.php index 36c0dde..9578573 100644 --- a/inc/classes/interfaces/template/view/class_ViewHelper.php +++ b/inc/classes/interfaces/template/view/class_ViewHelper.php @@ -3,10 +3,10 @@ * An interface for view helpers * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/class_ b/inc/classes/main/class_ index 26ff8be..af4096f 100644 --- a/inc/classes/main/class_ +++ b/inc/classes/main/class_ @@ -3,10 +3,10 @@ * * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 796860a..6b4d816 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -4,10 +4,10 @@ * class handles saving of games etc. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -53,6 +53,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $dbInstance = null; + /** + * Instance to an application helper class + */ + private $applicationInstance = null; + /** * The real class name */ @@ -140,6 +145,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { const EXCEPTION_MISSING_LANGUAGE_HANDLER = 0x02e; const EXCEPTION_MISSING_FILE_IO_HANDLER = 0x02f; const EXCEPTION_MISSING_ELEMENT = 0x030; + const EXCEPTION_INVALID_COMMAND = 0x031; + const EXCEPTION_INVALID_CONTROLLER = 0x032; + const EXCEPTION_HEADERS_ALREADY_SENT = 0x033; /** * In the super constructor these system classes shall be ignored or else @@ -150,16 +158,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { *--------------------------------------------------------------------* */ private $systemClasses = array( - "DebugMiddleware", // Debug middleware output sub-system - "DebugWebOutput", // Debug web output sub-system - "DebugConsoleOutput", // Debug console output sub-system - "DebugErrorLogOutput", // Debug error_log() output sub-system - "CompressorChannel", // Compressor sub-system + "DebugMiddleware", // Debug middleware output sub-system + "DebugWebOutput", // Debug web output sub-system + "DebugConsoleOutput", // Debug console output sub-system + "DebugErrorLogOutput", // Debug error_log() output sub-system + "CompressorChannel", // Compressor sub-system "FrameworkDirectoryPointer", // Directory handler sub-system - "NullCompressor", // Null compressor - "Bzip2Compressor", // BZIP2 compressor - "GzipCompressor", // GZIP compressor - "WebOutput", // Web output sub-system + "NullCompressor", // Null compressor + "Bzip2Compressor", // BZIP2 compressor + "GzipCompressor", // GZIP compressor + "WebOutput", // Web output sub-system ); /** @@ -812,11 +820,31 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->fileIOInstance = $fileIOInstance; } + /** + * Protected getter for a manageable application helper class + * + * @return $applicationInstance An instance of a manageable application helper class + */ + protected final function getApplicationInstance () { + return $this->applicationInstance; + } + + /** + * Setter for a manageable application helper class + * + * @param $applicationInstance An instance of a manageable application helper class + * @return void + */ + public final function setApplicationInstance (ManageableApplication $applicationInstance) { + $this->applicationInstance = $applicationInstance; + } + /** * Prepare the template engine (TemplateEngine by default) for a given * application helper instance (ApplicationHelper by default). * - * @param $appInstance An application helper instance + * @param $appInstance An application helper instance or + * null if we shall use the default * @return $tplEngine The template engine instance * @throws NullPointerException If the template engine could not * be initialized @@ -824,8 +852,22 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * unsupported template engine * @throws MissingLanguageHandlerException If the language sub-system * is not yet initialized - */ - protected function prepareTemplateEngine (BaseFrameworkSystem $appInstance) { + * @throws NullPointerException If the discovered application + * instance is still null + */ + protected function prepareTemplateEngine (BaseFrameworkSystem $appInstance=null) { + // Is the application instance set? + if (is_null($appInstance)) { + // Get the current instance + $appInstance = $this->getApplicationInstance(); + + // Still null? + if (is_null($appInstance)) { + // Thrown an exception + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } + } + // Generate FQFN for all application templates $fqfn = sprintf("%s%s/%s/%s", PATH, diff --git a/inc/classes/main/class_FrameworkArrayObject.php b/inc/classes/main/class_FrameworkArrayObject.php index 69a3363..910b4d8 100644 --- a/inc/classes/main/class_FrameworkArrayObject.php +++ b/inc/classes/main/class_FrameworkArrayObject.php @@ -5,10 +5,10 @@ * need more details. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/commands/class_BaseCommand.php b/inc/classes/main/commands/class_BaseCommand.php index 501c1ff..825b2b0 100644 --- a/inc/classes/main/commands/class_BaseCommand.php +++ b/inc/classes/main/commands/class_BaseCommand.php @@ -3,10 +3,10 @@ * A general (base) command * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -22,6 +22,16 @@ * along with this program. If not, see . */ class BaseCommand extends BaseFrameworkSystem { + /** + * The controller we need for this command + */ + private $controllerName = ""; + + /** + * Resolver instance + */ + private $resolverInstance = null; + /** * Protected constructor * @@ -31,6 +41,44 @@ class BaseCommand extends BaseFrameworkSystem { // Call parent constructor parent::__construct($class); } + + /** + * Setter for controller name + * + * @param $controllerName Name of the controller assigned with this command + * @return void + */ + public final function setControllerName ($controllerName) { + $this->controllerName = (string) $controllerName; + } + + /** + * Getter for controller name + * + * @return $controllerName Name of the controller assigned with this command + */ + public final function getControllerName () { + return $this->controllerName; + } + + /** + * Setter for resolver instance + * + * @param $resolverInstance Instance of a command resolver class + * @return void + */ + public final function setResolverInstance (CommandResolver $resolverInstance) { + $this->resolverInstance = $resolverInstance; + } + + /** + * Getter for resolver instance + * + * @return $resolverInstance Instance of a command resolver class + */ + public final function getResolverInstance () { + return $this->resolverInstance; + } } // [EOF] diff --git a/inc/classes/main/commands/local/.htaccess b/inc/classes/main/commands/local/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/commands/local/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/commands/local/class_LocalHomeCommand.php b/inc/classes/main/commands/local/class_LocalHomeCommand.php new file mode 100644 index 0000000..c670cb1 --- /dev/null +++ b/inc/classes/main/commands/local/class_LocalHomeCommand.php @@ -0,0 +1,90 @@ + + * @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 LocalHomeCommand extends BaseCommand implements Commandable { + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set special description + $this->setObjectDescription("Home-Command"); + + // Create unique ID number + $this->createUniqueID(); + + // Clean up a little + $this->removeSystemArray(); + + // Set assigned controller + $this->setControllerName("default"); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public final static function createLocalHomeCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new LocalHomeCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get the application instance + $appInstance = $this->getResolverInstance()->getApplicationInstance(); + + // Prepare a template instance + $templateInstance = $this->prepareTemplateEngine($appInstance); + + // Load the master template + $masterTemplate = $appInstance->getMasterTemplate(); + + // Load the master template + $templateInstance->loadCodeTemplate($masterTemplate); + + // Load the home template + $templateInstance->loadWebTemplate("home"); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/compressor/class_Bzip2Compressor.php b/inc/classes/main/compressor/class_Bzip2Compressor.php index 2cadc80..272a558 100644 --- a/inc/classes/main/compressor/class_Bzip2Compressor.php +++ b/inc/classes/main/compressor/class_Bzip2Compressor.php @@ -3,10 +3,10 @@ * BZIP2 compression and decompression class * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/compressor/class_GzipCompressor.php b/inc/classes/main/compressor/class_GzipCompressor.php index ae59267..208e12b 100644 --- a/inc/classes/main/compressor/class_GzipCompressor.php +++ b/inc/classes/main/compressor/class_GzipCompressor.php @@ -3,10 +3,10 @@ * GZIP compression and decompression class * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/compressor/class_NullCompressor.php b/inc/classes/main/compressor/class_NullCompressor.php index 742ab02..74cb5d3 100644 --- a/inc/classes/main/compressor/class_NullCompressor.php +++ b/inc/classes/main/compressor/class_NullCompressor.php @@ -3,10 +3,10 @@ * Null compression and decompression class * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index 3e9e9d7..78dc94c 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -3,10 +3,10 @@ * This class contains static helper functions for console applications * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/controller/class_BaseController.php b/inc/classes/main/controller/class_BaseController.php index 82dba69..f7aea5c 100644 --- a/inc/classes/main/controller/class_BaseController.php +++ b/inc/classes/main/controller/class_BaseController.php @@ -3,10 +3,10 @@ * A generic controller class * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -27,9 +27,9 @@ class BaseController extends BaseFrameworkSystem { * * @return void */ - protected function __construct () { + protected function __construct ($class) { // Call parent constructor - parent::__construct(__CLASS__); + parent::__construct($class); // Clean up a little $this->removeNumberFormaters(); diff --git a/inc/classes/main/controller/default/.htaccess b/inc/classes/main/controller/default/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/controller/default/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/controller/default/class_DefaultController.php b/inc/classes/main/controller/default/class_DefaultController.php new file mode 100644 index 0000000..e700a6e --- /dev/null +++ b/inc/classes/main/controller/default/class_DefaultController.php @@ -0,0 +1,96 @@ + + * @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 DefaultController extends BaseController implements Controller { + /** + * Instance of a CommandResolver class + */ + private $resolverInstance = null; + + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("Standart-Controller für alle übrigen Anfragen"); + + // Create unique ID number + $this->createUniqueID(); + + // Clean up a little + $this->removeSystemArray(); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $controllerInstance A prepared instance of this class + */ + public final static function createDefaultController (CommandResolver $resolverInstance) { + // Create the instance + $controllerInstance = new DefaultController(); + + // Set the command resolver + $controllerInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $controllerInstance; + } + + /** + * Setter for a command resolver instance + * + * @param $resolverInstance An instance of a command resolver class + * @return void + */ + public final function setResolverInstance (CommandResolver $resolverInstance) { + $this->resolverInstance = $resolverInstance; + } + + /** + * Handles the given request and response + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { + // Get the command instance + $commandInstance = $this->resolverInstance->resolvCommandByRequest($requestInstance); + + // Execute the command + $commandInstance->execute($requestInstance, $responseInstance); + + // Flush the response out + $responseInstance->flushResponse(); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/controller/registration/.htaccess b/inc/classes/main/controller/registration/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/controller/registration/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/controller/registration/class_DefaultRegistrationController.php b/inc/classes/main/controller/registration/class_DefaultRegistrationController.php new file mode 100644 index 0000000..2f15e40 --- /dev/null +++ b/inc/classes/main/controller/registration/class_DefaultRegistrationController.php @@ -0,0 +1,71 @@ + + * @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 DefaultRegistrationController extends BaseController implements Controller { + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("Ein Standart-Anmelde-Controller"); + + // Create unique ID number + $this->createUniqueID(); + + // Clean up a little + $this->removeSystemArray(); + } + + /** + * Creates an instance of this class + * + * @return $controllerInstance A prepared instance of this class + */ + public final static function createDefaultRegistrationController () { + // Create the instance + $controllerInstance = new DefaultRegistrationController(); + + // Return the prepared instance + return $controllerInstance; + } + + /** + * Handles the given request and response + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { + die(__METHOD__.": Stub!"); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/database/class_BaseDatabaseFrontend.php b/inc/classes/main/database/class_BaseDatabaseFrontend.php index a4220e0..790b424 100644 --- a/inc/classes/main/database/class_BaseDatabaseFrontend.php +++ b/inc/classes/main/database/class_BaseDatabaseFrontend.php @@ -4,10 +4,10 @@ * * @see DatabaseFrontendInterface - An interface for database frontends (front-end to the application) * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/database/classes/class_LocalFileDatabase.php b/inc/classes/main/database/classes/class_LocalFileDatabase.php index 3748108..7ac2b7d 100644 --- a/inc/classes/main/database/classes/class_LocalFileDatabase.php +++ b/inc/classes/main/database/classes/class_LocalFileDatabase.php @@ -5,10 +5,10 @@ * This class serializes objects and saves them to local files. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/debug/class_DebugConsoleOutput.php b/inc/classes/main/debug/class_DebugConsoleOutput.php index a019c3f..dfcfd36 100644 --- a/inc/classes/main/debug/class_DebugConsoleOutput.php +++ b/inc/classes/main/debug/class_DebugConsoleOutput.php @@ -3,10 +3,10 @@ * A debug output class for the console (e.g. hub software) * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/debug/class_DebugErrorLogOutput.php b/inc/classes/main/debug/class_DebugErrorLogOutput.php index a26867b..26b099d 100644 --- a/inc/classes/main/debug/class_DebugErrorLogOutput.php +++ b/inc/classes/main/debug/class_DebugErrorLogOutput.php @@ -3,10 +3,10 @@ * A debug output class for PHP's error_log() command * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/debug/class_DebugWebOutput.php b/inc/classes/main/debug/class_DebugWebOutput.php index a7ed41d..17faa19 100644 --- a/inc/classes/main/debug/class_DebugWebOutput.php +++ b/inc/classes/main/debug/class_DebugWebOutput.php @@ -3,10 +3,10 @@ * A debug output class for the web browser * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/extended/class_ObjectLimits.php b/inc/classes/main/extended/class_ObjectLimits.php index a2eccc3..75925c6 100644 --- a/inc/classes/main/extended/class_ObjectLimits.php +++ b/inc/classes/main/extended/class_ObjectLimits.php @@ -4,10 +4,10 @@ * objects to the datatabase connection or else a lot heap would be saved. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/extended/class_SerializationContainer.php b/inc/classes/main/extended/class_SerializationContainer.php index 94da00b..3987ad8 100644 --- a/inc/classes/main/extended/class_SerializationContainer.php +++ b/inc/classes/main/extended/class_SerializationContainer.php @@ -4,10 +4,10 @@ * other classes * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/io/class_FileIOStream.php b/inc/classes/main/io/class_FileIOStream.php index 39acf09..c983346 100644 --- a/inc/classes/main/io/class_FileIOStream.php +++ b/inc/classes/main/io/class_FileIOStream.php @@ -3,10 +3,10 @@ * An universal class for file input/output streams. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index 553e633..5ad52ed 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -3,10 +3,10 @@ * A class for directory reading and getting its contents * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php index 3834de9..a38b0a3 100644 --- a/inc/classes/main/io/class_FrameworkFileInputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileInputPointer.php @@ -3,10 +3,10 @@ * A class for reading files * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php index cf7f491..8cc07ca 100644 --- a/inc/classes/main/io/class_FrameworkFileOutputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileOutputPointer.php @@ -3,10 +3,10 @@ * A class for writing files * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/language/class_LanguageSystem.php b/inc/classes/main/language/class_LanguageSystem.php index 1ed28e4..4aa9490 100644 --- a/inc/classes/main/language/class_LanguageSystem.php +++ b/inc/classes/main/language/class_LanguageSystem.php @@ -4,10 +4,10 @@ * application and whole framework * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php index 7bd0588..5d2b1c1 100644 --- a/inc/classes/main/output/class_ConsoleOutput.php +++ b/inc/classes/main/output/class_ConsoleOutput.php @@ -4,10 +4,10 @@ * for console output * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/output/class_WebOutput.php b/inc/classes/main/output/class_WebOutput.php index 1312f33..a687cea 100644 --- a/inc/classes/main/output/class_WebOutput.php +++ b/inc/classes/main/output/class_WebOutput.php @@ -4,10 +4,10 @@ * browser * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/request/class_HttpRequest.php b/inc/classes/main/request/class_HttpRequest.php index ca85b97..6826d76 100644 --- a/inc/classes/main/request/class_HttpRequest.php +++ b/inc/classes/main/request/class_HttpRequest.php @@ -3,10 +3,10 @@ * A concrete HTTP request class to make HTTP requests more abstract * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/main/resolver/.htaccess b/inc/classes/main/resolver/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/resolver/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/resolver/class_BaseResolver.php b/inc/classes/main/resolver/class_BaseResolver.php new file mode 100644 index 0000000..74cfa47 --- /dev/null +++ b/inc/classes/main/resolver/class_BaseResolver.php @@ -0,0 +1,115 @@ + + * @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 BaseResolver extends BaseFrameworkSystem { + /** + * Validated command name + */ + private $commandName = ""; + + /** + * Prefix for local, remote or other resolver + */ + private $commandPrefix = ""; + + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeSystemArray(); + } + + /** + * Setter for command name + * + * @param $commandName Last validated command name + * @return void + */ + protected final function setCommandName ($commandName) { + $this->commandName = $commandName; + } + + /** + * Getter for command name + * + * @return $commandName Last validated command name + */ + protected final function getCommandName () { + return $this->commandName; + } + + /** + * Setter for command prefix + * + * @param $commandPrefix Last validated commandPrefix + * @return void + */ + protected final function setCommandPrefix ($commandPrefix) { + $this->commandPrefix = $commandPrefix; + } + + /** + * Checks wether the given command is valid + * + * @param $commandName The default command we shall execute + * @return $isValid Wether the given command is valid + * @throws EmptyVariableException Thrown if the given command is not set + */ + public function isCommandValid ($commandName) { + // By default nothing shall be valid + $isValid = false; + + // Is a command set? + if (empty($commandName)) { + // Then thrown an exception here + throw new EmptyVariableException(array($this, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + } + + // Now, let us create the full name of the command class + $class = sprintf("%s%sCommand", + $this->commandPrefix, + ucfirst(strtolower($commandName)) + ); + + // Is this class already loaded? + if (class_exists($class)) { + // This class does exist. :-) + $isValid = true; + } + + // Set command name + $this->setCommandName($commandName); + + // Return the result + return $isValid; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/resolver/local/.htaccess b/inc/classes/main/resolver/local/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/resolver/local/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/resolver/local/class_LocalCommandResolver.php b/inc/classes/main/resolver/local/class_LocalCommandResolver.php new file mode 100644 index 0000000..87e0d69 --- /dev/null +++ b/inc/classes/main/resolver/local/class_LocalCommandResolver.php @@ -0,0 +1,184 @@ + + * @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 LocalCommandResolver extends BaseResolver implements CommandResolver { + /** + * Last successfull resolved command + */ + private $lastCommandInstance = ""; + + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("Lokaler Kommandoauflöser"); + + // Create unique ID number + $this->createUniqueID(); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + + // Set prefix to "Local" + $this->setCommandPrefix("Local"); + } + + /** + * Creates an instance of a local command resolver with a given default command + * + * @param $defaultCommand The default command we shall execute + * @param $appInstance An instance of a manageable application helper class + * @return $resolverInstance The prepared command resolver instance + * @throws EmptyVariableException Thrown if the default command is not set + * @throws InvalidCommandException Thrown if the default command is invalid + */ + public final static function createLocalCommandResolver ($defaultCommand, ManageableApplication $appInstance) { + // Create the new instance + $resolverInstance = new LocalCommandResolver(); + + // Is the variable $defaultCommand set and the command is valid? + if (empty($defaultCommand)) { + // Then thrown an exception here + throw new EmptyVariableException(array($resolverInstance, 'defaultCommand'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + } elseif (!$resolverInstance->isCommandValid($defaultCommand)) { + // Invalid command found + throw new InvalidCommandException(array($resolverInstance, $defaultCommand), self::EXCEPTION_INVALID_COMMAND); + } + + // Set the application instance + $resolverInstance->setApplicationInstance($appInstance); + + // Return the prepared instance + return $resolverInstance; + } + + /** + * Returns an command instance for a given request class or null if + * MissingArrayElementsException was thrown + * + * @param $requestInstance An instance of a request class + * @return $commandInstance An instance of the resolved command + * @throws InvalidCommandException Thrown if $commandName is + * invalid + * @throws InvalidCommandInstanceException Thrown if $commandInstance + * is an invalid instance + */ + public function resolvCommandByRequest (Requestable $requestInstance) { + // Init variables + $commandName = ""; + $commandInstance = null; + + // Test if the required parameter is set + try { + // This goes fine so let's resolv the command + $commandName = $requestInstance->getRequestElement($this->getConfigInstance()->readConfig("command_parameter")); + + // Is the command empty? Then fall back to default command + if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig("default_command"); + + // Check if the command is valid + if (!$this->isCommandValid($commandName)) { + // This command is invalid! + throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } + + // Get the command + $commandInstance = $this->loadCommand($commandName); + + // And validate it + if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) { + // This command has an invalid instance! + throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } + + // Set last command + $this->lastCommandInstance = $commandInstance; + } catch (MissingArrayElementsException $e) { + // Just catch it here... + } + + // Return the resolved command instance + return $commandInstance; + } + + /** + * "Loads" a given command and instances it if not yet cached + * + * @param $commandName A command name we shall look for + * @return $commandInstance A loaded command instance + * @throws InvalidCommandException Thrown if even the default + * command class is missing (bad!) + */ + private function loadCommand ($commandName) { + // Cache default command + $defaultCommand = $this->getConfigInstance()->readConfig("default_command"); + + // Init command instance + $commandInstance = null; + + // Create command class name + $class = sprintf("Local%sCommand", + ucfirst(strtolower($commandName)) + ); + + // Is this class loaded? + if (!class_exists($class)) { + // Class not found, so try the default one or throw exception + if ($commandName != $defaultCommand) { + // Try the default command + return $this->loadCommand($defaultCommand); + } else { + // Still not found? + throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND); + } + } + + // Initiate the command + $eval = sprintf("\$commandInstance = %s::create%s(\$this);", + $class, + $class + ); + + // Run the command + eval($eval); + + // Is the instance valid? + if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) { + // Something is wrong + $commandInstance = null; + } + + // Return the result + return $commandInstance; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/resolver/local/class_LocalControllerResolver.php b/inc/classes/main/resolver/local/class_LocalControllerResolver.php new file mode 100644 index 0000000..8ff0788 --- /dev/null +++ b/inc/classes/main/resolver/local/class_LocalControllerResolver.php @@ -0,0 +1,186 @@ + + * @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 LocalControllerResolver extends BaseResolver implements ControllerResolver { + /** + * Last successfull resolved controller + */ + private $lastControllerName = ""; + + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription(""); + + // Create unique ID number + $this->createUniqueID(); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + + // Set prefix to "Local" + $this->setCommandPrefix("Local"); + } + + /** + * Creates an instance of a resolver class with a given command + * + * @param $commandName The default command we shall execute + * @param $appInstance An instance of a manageable application helper class + * @return $resolverInstance The prepared command resolver instance + * @throws EmptyVariableException Thrown if the default command is not set + * @throws InvalidCommandException Thrown if the default command is invalid + */ + public final static function createLocalControllerResolver ($commandName, ManageableApplication $appInstance) { + // Create the new instance + $resolverInstance = new LocalControllerResolver(); + + // Is the variable $commandName set and the command is valid? + if (empty($commandName)) { + // Then thrown an exception here + throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + } elseif (!$resolverInstance->isCommandValid($commandName)) { + // Invalid command found + throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); + } + + // Set the application instance + $resolverInstance->setApplicationInstance($appInstance); + + // Return the prepared instance + return $resolverInstance; + } + + /** + * Resolves the default controller of the given command + * + * @return $controllerInstance A controller instance for the default + * command + * @throws InvalidCommandException Thrown if $commandName is + * invalid + * @throws InvalidControllerInstanceException Thrown if $commandInstance + * is invalid + */ + public function resolveDefaultController () { + // Init variables + $commandName = ""; + $controllerInstance = null; + + // Try to resolv the command + try { + // Get the command name + $commandName = $this->getCommandName(); + + // Check if the command is valid + if (!$this->isCommandValid($commandName)) { + // This command is invalid! + throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } + + // Get the command + $controllerInstance = $this->loadController($commandName); + + // And validate it + if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) { + // This command has an invalid instance! + throw new InvalidControllerInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_CONTROLLER); + } + + // Set last command + $this->lastCommandInstance = $controllerInstance; + } catch (MissingArrayElementsException $e) { + // Just catch it here... + } + + // Return the maybe resolved instance + return $controllerInstance; + } + + /** + * "Loads" a given controller and instances it if not yet cached + * + * @param $commandName A controller name we shall look for + * @return $controllerInstance A loaded controller instance + * @throws DefaultControllerException Thrown if even the default + * controller class is missing (bad!) + */ + private function loadController ($commandName) { + // Cache default command + $defaultCommand = $this->getConfigInstance()->readConfig("default_command"); + + // Init controller instance + $controllerInstance = null; + + // Default controller + $class = "DefaultController"; + + // Generate the class name + if ($commandName != $defaultCommand) { + // Create controller class name + $class = sprintf("Local%sController", + ucfirst(strtolower($commandName)) + ); + } + + // Is this class loaded? + if (!class_exists($class)) { + // Class not found, so try the default one or throw exception + if ($commandName != $defaultCommand) { + // Try the default controller + return $this->loadController($defaultCommand); + } else { + // Still not found? + throw new DefaultControllerException($this, self::EXCEPTION_DEFAUL_CONTROLLER_GONE); + } + } + + // Initiate the controller + $eval = sprintf("\$controllerInstance = %s::create%s(LocalCommandResolver::createLocalCommandResolver(\$commandName, \$this->getApplicationInstance()));", + $class, + $class + ); + + // Run the command + eval($eval); + + // Is the instance valid? + if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) { + // Something is wrong + $controllerInstance = null; + } + + // Return the result + return $controllerInstance; + } +} + +// [EOF] +?> diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php index 8b29afe..3679fe9 100644 --- a/inc/classes/main/response/class_HttpResponse.php +++ b/inc/classes/main/response/class_HttpResponse.php @@ -3,10 +3,10 @@ * A class for an HTTP response on an HTTP request * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -37,6 +37,11 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { */ private $responseBody = ""; + /** + * Instance of the template engine + */ + private $templateEngine = null; + /** * Protected constructor * @@ -60,12 +65,16 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { /** * Creates an object of this class * + * @param $appInstance An instance of a manageable application * @return $responseInstance A prepared instance of this class */ - public final static function createHttpResponse () { + public final static function createHttpResponse (ManageableApplication $appInstance) { // Get a new instance $responseInstance = new HttpResponse(); + // Initialize the template engine here + $responseInstance->initTemplateEngine($appInstance); + // Return the prepared instance return $responseInstance; } @@ -110,7 +119,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { * @throws ResponseHeadersAlreadySentException Thrown if headers are * already sent */ - public function flushResponse($force=false) { + public function flushResponse ($force=false) { if ((headers_sent()) && (!$force)) { // Headers are already sent! throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT); @@ -127,6 +136,25 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable { $this->reponseBody = ""; $this->responseHeaders = array(); } + + /** + * Initializes the template engine instance + * + * @param $appInstance An instance of a manageable application + * @return void + */ + public final function initTemplateEngine (ManageableApplication $appInstance) { + $this->templateEngine = $this->prepareTemplateEngine($appInstance); + } + + /** + * Getter for the template engine instance + * + * @return $templateEngine An instance of the used template engine + */ + public final function getTemplateEngine () { + return $this->templateEngine; + } } // [EOF] diff --git a/inc/classes/main/template/class_TemplateEngine.php b/inc/classes/main/template/class_TemplateEngine.php index 4fdb1a3..55bf000 100644 --- a/inc/classes/main/template/class_TemplateEngine.php +++ b/inc/classes/main/template/class_TemplateEngine.php @@ -4,10 +4,10 @@ * and emails. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/middleware/class_BaseMiddleware.php b/inc/classes/middleware/class_BaseMiddleware.php index 9b576dd..1cc69f6 100644 --- a/inc/classes/middleware/class_BaseMiddleware.php +++ b/inc/classes/middleware/class_BaseMiddleware.php @@ -3,10 +3,10 @@ * An abstract middleware class for all other middlware classes * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index da8b484..b5fa565 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -3,10 +3,10 @@ * Middleware class for selecting the right compressor channel * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/middleware/database/class_DatabaseConnection.php b/inc/classes/middleware/database/class_DatabaseConnection.php index 402677b..45b09ea 100644 --- a/inc/classes/middleware/database/class_DatabaseConnection.php +++ b/inc/classes/middleware/database/class_DatabaseConnection.php @@ -3,10 +3,10 @@ * Database selector class * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/middleware/debug/class_DebugMiddleware.php b/inc/classes/middleware/debug/class_DebugMiddleware.php index 4a13432..37d4ed9 100644 --- a/inc/classes/middleware/debug/class_DebugMiddleware.php +++ b/inc/classes/middleware/debug/class_DebugMiddleware.php @@ -5,10 +5,10 @@ * become deprecated soon. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/classes/middleware/io/class_FileIOHandler.php b/inc/classes/middleware/io/class_FileIOHandler.php index fa6937c..8c7a47a 100644 --- a/inc/classes/middleware/io/class_FileIOHandler.php +++ b/inc/classes/middleware/io/class_FileIOHandler.php @@ -4,10 +4,10 @@ * Missing paths in writing process will be automatically created. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/config.php b/inc/config.php index e104b41..9b307c0 100644 --- a/inc/config.php +++ b/inc/config.php @@ -5,10 +5,10 @@ * configuration entries there. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 @@ -141,5 +141,8 @@ $cfg->setConfigEntry("default_application", "selector"); // CFG: VERBOSE-LEVEL $cfg->setConfigEntry("verbose_level", 0); +// CFG: COMMAND-PARAMETER +$cfg->setConfigEntry("command_parameter", "page"); + // [EOF] ?> diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 9f919fa..6c81052 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -7,10 +7,10 @@ * * @see ClassLoader * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/database.php b/inc/database.php index bba0192..99611ea 100644 --- a/inc/database.php +++ b/inc/database.php @@ -3,10 +3,10 @@ * Initializes the database layer * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/database/lib-local.php b/inc/database/lib-local.php index 3e1ebc5..a14e7c8 100644 --- a/inc/database/lib-local.php +++ b/inc/database/lib-local.php @@ -3,10 +3,10 @@ * Initializes the local file database class * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/file_io.php b/inc/file_io.php index eb37543..18b0cb4 100644 --- a/inc/file_io.php +++ b/inc/file_io.php @@ -5,10 +5,10 @@ * instances will we generated. * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/includes.php b/inc/includes.php index f6aeeac..52f8594 100644 --- a/inc/includes.php +++ b/inc/includes.php @@ -3,10 +3,10 @@ * Loads more include files by using the generic class loader * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/language.php b/inc/language.php index 1711acf..58ea69e 100644 --- a/inc/language.php +++ b/inc/language.php @@ -3,7 +3,7 @@ * Try to initializes the language system * * @author Roland Haeder - * @version 0.3.0 + * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version * diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 9d4ddbe..7366496 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -3,10 +3,10 @@ * This class loads class include files with a specific prefix and suffix * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/output.php b/inc/output.php index b77df4a..72ff36b 100644 --- a/inc/output.php +++ b/inc/output.php @@ -3,10 +3,10 @@ * Initializes the output middleware layer * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/inc/selector.php b/inc/selector.php index a8bb1fd..2133c11 100644 --- a/inc/selector.php +++ b/inc/selector.php @@ -3,10 +3,10 @@ * The application selector main include file * * @author Roland Haeder - * @version 0.3.0 + * @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.mxchange.org + * @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 diff --git a/templates/de/code/emergency_exit.ctp b/templates/de/code/emergency_exit.ctp index a16e1cd..f747430 100644 --- a/templates/de/code/emergency_exit.ctp +++ b/templates/de/code/emergency_exit.ctp @@ -8,4 +8,13 @@ $content[message] +
+
+ Backtrace: +
+
+ $content[backtrace] +
+
+ {?footer_msg:footer_msg="Please contact the support and supply the full above message, if you think you are not qualified to fix this problem."?} diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 84b245d..a5cc32d 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -23,6 +23,25 @@ require_once("PHPUnit/Framework.php"); /** * A test case for the configuration sub system * + * @author Roland Haeder + * @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 + * @see http://www.phpunit.de + * + * 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 ConfigTest extends PHPUnit_Framework_TestCase { /** diff --git a/tests/old/contract-test.php b/tests/old/contract-test.php index 607c887..e268d08 100644 --- a/tests/old/contract-test.php +++ b/tests/old/contract-test.php @@ -445,12 +445,12 @@ try { if ($typeValid) { DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s kann Schiffe vom Typ %s bauen.
\n", $shipping->getCompanyName(), - $contract->getShipInstance()->getPartDescr() + $contract->getShipInstance()->getObjectDescription() )); } else { DebugMiddleware::getInstance()->output(sprintf("Die Reederei %s kann keine Schiffe vom Typ %s bauen!
\n", $shipping->getCompanyName(), - $contract->getShipInstance()->getPartDescr() + $contract->getShipInstance()->getObjectDescription() )); exit; } -- 2.39.5