]> git.mxchange.org Git - core.git/commitdiff
Continued: master
authorRoland Häder <roland@mxchange.org>
Mon, 15 Jan 2024 21:36:16 +0000 (22:36 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 15 Jan 2024 21:36:16 +0000 (22:36 +0100)
- updated package references

533 files changed:
application/.htaccess [deleted file]
application/tests/class_ApplicationHelper.php
application/tests/classes/commands/console/class_TestsConsoleMainCommand.php [new file with mode: 0644]
application/tests/classes/controller/console/class_TestsConsoleDefaultNewsController.php [new file with mode: 0644]
application/tests/classes/filter/class_BaseTestsFilter.php [new file with mode: 0644]
application/tests/classes/filter/tests/class_Tests [new file with mode: 0644]
application/tests/classes/filter/tests/configuration/class_TestsConfiguration [new file with mode: 0644]
application/tests/classes/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php [new file with mode: 0644]
application/tests/classes/filter/tests/configuration/is_enabled/class_TestsConfigurationIsEnabledFilter.php [new file with mode: 0644]
application/tests/classes/filter/tests/requirements/class_TestsPhpRequirementsFilter.php [new file with mode: 0644]
application/tests/classes/resolver/command/console/class_TestsConsoleCommandResolver.php [new file with mode: 0644]
application/tests/classes/resolver/controller/class_TestsConsoleControllerResolver.php [new file with mode: 0644]
application/tests/config-local.php-dist [new file with mode: 0644]
application/tests/config.php
application/tests/data.php [deleted file]
application/tests/debug.php
application/tests/exceptions.php
application/tests/loader.php [deleted file]
application/tests/starter.php [deleted file]
composer.lock
contrib/cleanup.sh [new file with mode: 0755]
contrib/update_year.sh
db/.gitkeep [new file with mode: 0644]
db/.htaccess [deleted file]
db/news/.gitkeep [new file with mode: 0644]
db/news/.htaccess [deleted file]
docs/scrypt/CREDITS [new file with mode: 0644]
docs/scrypt/LICENSE [new file with mode: 0644]
docs/scrypt/README.md [new file with mode: 0644]
framework/bootstrap/bootstrap.inc.php
framework/bootstrap/class_FrameworkBootstrap.php
framework/config-global.php
framework/config/class_FrameworkConfiguration.php
framework/config/config-local.php-dist
framework/loader/class_ClassLoader.php
framework/main/classes/actions/class_
framework/main/classes/actions/class_BaseAction.php
framework/main/classes/actions/html/class_HtmlLoginProfileAction.php
framework/main/classes/actions/post_registration/class_LoginAfterRegistrationAction.php
framework/main/classes/application/class_BaseApplication.php
framework/main/classes/auth/class_CookieAuth.php
framework/main/classes/cache/class_MemoryCache.php
framework/main/classes/class_
framework/main/classes/class_Base
framework/main/classes/class_BaseFrameworkSystem.php
framework/main/classes/class_FrameworkArrayObject.php
framework/main/classes/client/class_
framework/main/classes/client/class_BaseClient.php
framework/main/classes/client/http/class_HttpClient.php
framework/main/classes/commands/class_
framework/main/classes/commands/class_BaseCommand.php
framework/main/classes/commands/console/class_Console
framework/main/classes/commands/console/class_ConsoleFuseCommand.php
framework/main/classes/commands/html/class_Html
framework/main/classes/commands/html/class_HtmlConfirmCommand.php
framework/main/classes/commands/html/class_HtmlDoFormCommand.php
framework/main/classes/commands/html/class_HtmlHomeCommand.php
framework/main/classes/commands/html/class_HtmlLoginAreaCommand.php
framework/main/classes/commands/html/class_HtmlLoginCommand.php
framework/main/classes/commands/html/class_HtmlLoginFailedCommand.php
framework/main/classes/commands/html/class_HtmlLogoutCommand.php
framework/main/classes/commands/html/class_HtmlLogoutDoneCommand.php
framework/main/classes/commands/html/class_HtmlProblemCommand.php
framework/main/classes/commands/html/class_HtmlRegisterCommand.php
framework/main/classes/commands/html/class_HtmlResendLinkCommand.php
framework/main/classes/commands/html/class_HtmlStatusCommand.php
framework/main/classes/commands/image/class_ImageCodeCaptchaCommand.php
framework/main/classes/compressor/class_Bzip2Compressor.php
framework/main/classes/compressor/class_GzipCompressor.php
framework/main/classes/compressor/class_NullCompressor.php
framework/main/classes/compressor/class_ZlibCompressor.php
framework/main/classes/container/class_
framework/main/classes/container/class_BaseContainer.php
framework/main/classes/controller/class_
framework/main/classes/controller/class_BaseController.php
framework/main/classes/controller/console/class_ConsoleDefaultController.php
framework/main/classes/controller/console/class_ConsoleDefaultNewsController.php
framework/main/classes/controller/html/class_Html
framework/main/classes/controller/html/class_HtmlConfirmController.php
framework/main/classes/controller/html/class_HtmlDefaultController.php
framework/main/classes/controller/html/class_HtmlDefaultNewsController.php
framework/main/classes/controller/html/class_HtmlLoginController.php
framework/main/classes/controller/html/class_HtmlLoginFailedController.php
framework/main/classes/controller/html/class_HtmlLogoutController.php
framework/main/classes/controller/html/class_HtmlLogoutDoneController.php
framework/main/classes/controller/html/class_HtmlRegisterController.php
framework/main/classes/controller/html/class_HtmlStatusController.php
framework/main/classes/controller/html/form/class_HtmlDoFormController.php
framework/main/classes/controller/html/login/class_HtmlLoginAreaController.php
framework/main/classes/controller/image/captcha/class_ImageCodeCaptchaController.php
framework/main/classes/controller/image/class_ImageDefaultController.php
framework/main/classes/criteria/class_BaseCriteria.php
framework/main/classes/criteria/dataset/class_DataSetCriteria.php
framework/main/classes/criteria/search/class_SearchCriteria.php
framework/main/classes/criteria/update/class_UpdateCriteria.php
framework/main/classes/crypto/class_CryptoHelper.php
framework/main/classes/database/backend/class_BaseDatabaseBackend.php
framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php
framework/main/classes/database/class_
framework/main/classes/database/class_BaseDatabaseResult.php
framework/main/classes/database/frontend/class_BaseDatabaseFrontend.php
framework/main/classes/database/frontend/news/class_NewsDatabaseFrontend.php
framework/main/classes/database/frontend/payments/class_PaymentsDatabaseFrontend.php
framework/main/classes/database/frontend/user/class_UserDatabaseFrontend.php
framework/main/classes/database/frontend/user_points/class_UserPointsDatabaseFrontend.php
framework/main/classes/database/migration/class_
framework/main/classes/database/migration/class_BaseDatabaseMigration.php
framework/main/classes/database/migration/format_upgrade/class_
framework/main/classes/database/migration/format_upgrade/class_BaseFormatUpgrade.php
framework/main/classes/database/migration/format_upgrade/lfdb/class_LocalFileDatabaseFormatVersion01To02Upgrade.php
framework/main/classes/database/result/class_CachedDatabaseResult.php
framework/main/classes/decorator/class_BaseDecorator.php
framework/main/classes/decorator/xml/compactor/class_XmlCompactorDecorator.php
framework/main/classes/decorator/xml/template/class_XmlRewriterTemplateDecorator.php
framework/main/classes/discovery/class_
framework/main/classes/discovery/class_BaseDiscovery.php
framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php
framework/main/classes/factories/class_
framework/main/classes/factories/class_BaseFactory.php
framework/main/classes/factories/client/class_ClientFactory.php
framework/main/classes/factories/database/class_DatabaseFrontendFactory.php
framework/main/classes/factories/html/class_HtmlNewsFactory.php
framework/main/classes/factories/index/class_FileStackIndexFactory.php
framework/main/classes/factories/logger/class_LoggerFactory.php
framework/main/classes/factories/login/class_LoginFactory.php
framework/main/classes/factories/objects/class_ObjectFactory.php
framework/main/classes/factories/registry/class_SocketRegistryFactory.php
framework/main/classes/factories/stacks/class_FileStackFactory.php
framework/main/classes/factories/user/class_UserFactory.php
framework/main/classes/factories/xml/class_XmlTemplateEngineFactory.php
framework/main/classes/feature/class_
framework/main/classes/feature/class_BaseFeature.php
framework/main/classes/feature/class_FrameworkFeature.php
framework/main/classes/feature/fuse/class_FuseFeature.php
framework/main/classes/file_directories/binary/class_BaseBinaryFile.php
framework/main/classes/file_directories/binary/index/class_IndexFile.php
framework/main/classes/file_directories/binary/stack/class_StackFile.php
framework/main/classes/file_directories/class_BaseAbstractFile.php
framework/main/classes/file_directories/class_BaseFileIo.php
framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php
framework/main/classes/file_directories/input/raw/class_FrameworkRawFileInputPointer.php
framework/main/classes/file_directories/input/text/class_FrameworkTextFileInputPointer.php
framework/main/classes/file_directories/io/class_FrameworkFileInputOutputPointer.php
framework/main/classes/file_directories/io_stream/class_FileIoStream.php
framework/main/classes/file_directories/output/raw/class_FrameworkRawFileOutputPointer.php
framework/main/classes/file_directories/output/text/class_FrameworkTextFileOutputPointer.php
framework/main/classes/file_directories/text/class_BaseTextFile.php
framework/main/classes/file_directories/text/input/class_BaseInputTextFile.php
framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php
framework/main/classes/file_directories/text/output/class_BaseOutputTextFile.php
framework/main/classes/filesystem/class_
framework/main/classes/filesystem/class_BaseFilesystem.php
framework/main/classes/filter/auth/class_UserAuthFilter.php
framework/main/classes/filter/change/class_EmailChangeFilter.php
framework/main/classes/filter/change/class_PasswordChangeFilter.php
framework/main/classes/filter/checkboxes/class_RulesAcceptedFilter.php
framework/main/classes/filter/class_
framework/main/classes/filter/class_BaseFilter.php
framework/main/classes/filter/class_BaseFilterDecorator.php
framework/main/classes/filter/class_FilterChain.php
framework/main/classes/filter/crypto/class_CaptchaEncryptFilter.php
framework/main/classes/filter/guest/class_UserNameIsGuestFilter.php
framework/main/classes/filter/news/class_NewsDownloadFilter.php
framework/main/classes/filter/news/class_NewsProcessFilter.php
framework/main/classes/filter/null/class_NullFilter.php
framework/main/classes/filter/payment/class_PaymentDiscoveryFilter.php
framework/main/classes/filter/update/class_UserStatusConfimedUpdateFilter.php
framework/main/classes/filter/update/class_UserUpdateFilter.php
framework/main/classes/filter/validator/class_EmailValidatorFilter.php
framework/main/classes/filter/validator/class_PasswordValidatorFilter.php
framework/main/classes/filter/validator/class_UserNameValidatorFilter.php
framework/main/classes/filter/verifier/class_AccountPasswordVerifierFilter.php
framework/main/classes/filter/verifier/class_BirthdayVerifierFilter.php
framework/main/classes/filter/verifier/class_ConfirmCodeVerifierFilter.php
framework/main/classes/filter/verifier/class_EmailVerifierFilter.php
framework/main/classes/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php
framework/main/classes/filter/verifier/class_PasswordGuestVerifierFilter.php
framework/main/classes/filter/verifier/class_PasswordVerifierFilter.php
framework/main/classes/filter/verifier/class_UserGuestVerifierFilter.php
framework/main/classes/filter/verifier/class_UserNameVerifierFilter.php
framework/main/classes/filter/verifier/class_UserStatusVerifierFilter.php
framework/main/classes/filter/verifier/class_UserUnconfirmedVerifierFilter.php
framework/main/classes/fuse/class_FrameworkFuseWrapper.php_discontinued
framework/main/classes/handler/class_
framework/main/classes/handler/class_BaseHandler.php
framework/main/classes/handler/tasks/class_TaskHandler.php
framework/main/classes/helper/captcha/class_
framework/main/classes/helper/captcha/class_BaseCaptcha.php
framework/main/classes/helper/captcha/images/class_ImageHelper.php
framework/main/classes/helper/captcha/web/class_GraphicalCodeCaptcha.php
framework/main/classes/helper/class_
framework/main/classes/helper/class_BaseHelper.php
framework/main/classes/helper/html/blocks/class_HtmlBlockHelper.php
framework/main/classes/helper/html/class_
framework/main/classes/helper/html/class_BaseHtmlHelper.php
framework/main/classes/helper/html/forms/class_HtmlFormHelper.php
framework/main/classes/helper/html/links/class_HtmlLinkHelper.php
framework/main/classes/helper/login/class_BaseLoginHelper.php
framework/main/classes/images/class_
framework/main/classes/images/class_BaseImage.php
framework/main/classes/images/png/class_PngImage.php
framework/main/classes/index/class_
framework/main/classes/index/class_BaseIndex.php
framework/main/classes/index/file/class_BaseFileIndex.php
framework/main/classes/index/file/stack/class_FileStackIndex.php
framework/main/classes/iterator/class_
framework/main/classes/iterator/class_BaseIterator.php
framework/main/classes/iterator/default/class_DefaultIterator.php
framework/main/classes/iterator/file/class_FileIterator.php
framework/main/classes/iterator/registry/class_RegistryIterator.php
framework/main/classes/language/class_LanguageSystem.php
framework/main/classes/lists/class_
framework/main/classes/lists/class_BaseList.php
framework/main/classes/lists/groups/class_ListGroupList.php
framework/main/classes/lists/tasks/class_TaskList.php
framework/main/classes/mailer/class_
framework/main/classes/mailer/class_BaseMailer.php
framework/main/classes/mailer/debug/class_DebugMailer.php
framework/main/classes/menu/class_BaseMenu.php
framework/main/classes/output/class_
framework/main/classes/output/class_BaseOutput.php
framework/main/classes/output/console/class_ConsoleOutput.php
framework/main/classes/output/debug/class_BaseDebugOutput.php
framework/main/classes/output/debug/console/class_DebugConsoleOutput.php
framework/main/classes/output/debug/error/class_DebugErrorLogOutput.php
framework/main/classes/output/debug/web/class_DebugWebOutput.php
framework/main/classes/output/web/class_WebOutput.php
framework/main/classes/parser/class_
framework/main/classes/parser/class_BaseParser.php
framework/main/classes/parser/xml/class_XmlParser.php
framework/main/classes/points/class_UserPoints.php
framework/main/classes/reader/class_ConsoleNewsReader.php
framework/main/classes/reader/class_DefaultNewsReader.php
framework/main/classes/registration/class_BaseRegistration.php
framework/main/classes/registry/class_
framework/main/classes/registry/class_BaseRegistry.php
framework/main/classes/registry/format_upgrade/database/class_
framework/main/classes/registry/format_upgrade/database/class_LocalFileDatabaseFormatUpgradeRegistry.php
framework/main/classes/registry/generic/class_GenericRegistry.php
framework/main/classes/registry/object/class_ObjectRegistry.php [new file with mode: 0644]
framework/main/classes/registry/sub/class_SubRegistry.php
framework/main/classes/request/class_
framework/main/classes/request/class_BaseRequest.php
framework/main/classes/request/console/class_ConsoleRequest.php
framework/main/classes/request/html/class_HtmlRequest.php
framework/main/classes/resolver/action/class_BaseActionResolver.php
framework/main/classes/resolver/action/html/class_HtmlActionResolver.php
framework/main/classes/resolver/class_
framework/main/classes/resolver/class_BaseResolver.php
framework/main/classes/resolver/command/class_BaseCommandResolver.php
framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php
framework/main/classes/resolver/command/html/class_Html
framework/main/classes/resolver/command/html/class_HtmlCommandResolver.php
framework/main/classes/resolver/command/image/class_ImageCommandResolver.php
framework/main/classes/resolver/controller/class_BaseControllerResolver.php
framework/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php
framework/main/classes/resolver/controller/html/class_HtmlControllerResolver.php
framework/main/classes/resolver/controller/image/class_ImageControllerResolver.php
framework/main/classes/response/class_BaseResponse.php
framework/main/classes/response/console/class_ConsoleResponse.php
framework/main/classes/response/html/class_HtmlResponse.php
framework/main/classes/response/image/class_ImageResponse.php
framework/main/classes/rng/class_RandomNumberGenerator.php
framework/main/classes/stacker/class_
framework/main/classes/stacker/class_BaseStacker.php
framework/main/classes/stacker/fifo/class_FiFoStacker.php
framework/main/classes/stacker/file/class_
framework/main/classes/stacker/file/class_BaseFileStack.php
framework/main/classes/stacker/file/fifo/class_FiFoFileStack.php
framework/main/classes/stacker/filo/class_FiLoStacker.php
framework/main/classes/states/class_
framework/main/classes/states/class_BaseState.php
framework/main/classes/streams/class_BaseStream.php
framework/main/classes/streams/crypto/class_BaseCryptoStream.php
framework/main/classes/streams/crypto/mcrypt/class_McryptStream.php [deleted file]
framework/main/classes/streams/crypto/null/class_NullCryptoStream.php
framework/main/classes/streams/crypto/openssl/class_OpenSslStream.php
framework/main/classes/tasks/class_
framework/main/classes/tasks/class_BaseTask.php
framework/main/classes/tasks/idle/class_IdleLoopTask.php
framework/main/classes/template/class_
framework/main/classes/template/class_BaseTemplateEngine.php
framework/main/classes/template/console/class_ConsoleTemplateEngine.php
framework/main/classes/template/html/class_HtmlTemplateEngine.php
framework/main/classes/template/image/class_ImageTemplateEngine.php
framework/main/classes/template/mail/class_MailTemplateEngine.php
framework/main/classes/template/menu/class_MenuTemplateEngine.php
framework/main/classes/template/xml/class_BaseXmlTemplateEngine.php
framework/main/classes/tools/console/class_ConsoleTools.php
framework/main/classes/user/class_BaseUser.php
framework/main/classes/user/guest/class_Guest.php
framework/main/classes/user/member/class_Member.php
framework/main/classes/utils/arrays/class_ArrayUtils.php
framework/main/classes/utils/crypto/class_CryptoUtils.php
framework/main/classes/utils/numbers/class_NumberUtils.php
framework/main/classes/utils/strings/class_StringUtils.php
framework/main/classes/visitor/class_
framework/main/classes/visitor/class_BaseVisitor.php
framework/main/exceptions/actions/class_InvalidActionException.php
framework/main/exceptions/auth/class_UserAuthorizationException.php
framework/main/exceptions/base64/class_Base64EncodingBadException.php
framework/main/exceptions/base64/class_Base64EncodingModuloException.php
framework/main/exceptions/class_
framework/main/exceptions/class_FrameworkException.php
framework/main/exceptions/compressor/class_MismatchingCompressorsException.php
framework/main/exceptions/config/class_ConfigValueTypeUnsupportedException.php
framework/main/exceptions/config/class_NoConfigEntryException.php
framework/main/exceptions/connection/class_ConnectionAlreadyRegisteredException.php
framework/main/exceptions/controller/class_DefaultControllerException.php
framework/main/exceptions/controller/class_InvalidControllerException.php
framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php
framework/main/exceptions/crypto/class_EncryptMissingException.php
framework/main/exceptions/database/class_
framework/main/exceptions/database/class_DatabaseException.php
framework/main/exceptions/database/general/class_SqlException.php
framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php
framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php
framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php
framework/main/exceptions/dns/class_UnknownHostnameException.php
framework/main/exceptions/feature/class_FeatureMethodNotCallableException.php
framework/main/exceptions/file_directory/class_DirPointerNotOpenedException.php
framework/main/exceptions/file_directory/class_FileIoException.php
framework/main/exceptions/file_directory/class_FileNotFoundException.php
framework/main/exceptions/file_directory/class_FileReadProtectedException.php
framework/main/exceptions/file_directory/class_FileWriteProtectedException.php
framework/main/exceptions/file_directory/class_InvalidDataLengthException.php
framework/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php
framework/main/exceptions/file_directory/class_InvalidResourceException.php
framework/main/exceptions/file_directory/class_PathIsNoDirectoryException.php
framework/main/exceptions/file_directory/class_PathReadProtectedException.php
framework/main/exceptions/file_directory/class_PathWriteProtectedException.php
framework/main/exceptions/filter/class_FilterChainException.php
framework/main/exceptions/filter/class_InvalidFilterChainException.php
framework/main/exceptions/helper/class_FormClosedException.php
framework/main/exceptions/helper/class_FormGroupClosedException.php
framework/main/exceptions/helper/class_FormOpenedException.php
framework/main/exceptions/helper/class_HelperGroupAlreadyCreatedException.php
framework/main/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php
framework/main/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php
framework/main/exceptions/helper/class_InvalidFormNameException.php
framework/main/exceptions/helper/class_NoGroupOpenedException.php
framework/main/exceptions/helper/class_UserInstanceMissingException.php
framework/main/exceptions/main/class_AssertionException.php
framework/main/exceptions/main/class_ClassMismatchException.php
framework/main/exceptions/main/class_DimNotFoundInArrayException.php
framework/main/exceptions/main/class_FatalErrorException.php
framework/main/exceptions/main/class_IndexOutOfBoundsException.php
framework/main/exceptions/main/class_InvalidArrayCountException.php
framework/main/exceptions/main/class_InvalidCommandException.php
framework/main/exceptions/main/class_MissingArrayElementsException.php
framework/main/exceptions/main/class_NoClassException.php
framework/main/exceptions/main/class_NullPointerException.php
framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php
framework/main/exceptions/main/class_UnsupportedOperationException.php
framework/main/exceptions/main/class_VariableIsNotSetException.php
framework/main/exceptions/result/class_InvalidDatabaseResultException.php
framework/main/exceptions/result/class_ResultUpdateException.php
framework/main/exceptions/socket/class_AbstractSocketException.php
framework/main/exceptions/socket/class_InvalidServerSocketException.php
framework/main/exceptions/socket/class_InvalidSocketException.php
framework/main/exceptions/socket/class_NoSocketErrorDetectedException.php
framework/main/exceptions/socket/class_SocketAlreadyRegisteredException.php
framework/main/exceptions/socket/class_SocketBindingException.php
framework/main/exceptions/socket/class_SocketConnectionException.php
framework/main/exceptions/socket/class_SocketCreationException.php
framework/main/exceptions/socket/class_SocketOperationException.php
framework/main/exceptions/socket/class_SocketOptionException.php
framework/main/exceptions/socket/class_UnsupportedSocketErrorHandlerException.php
framework/main/exceptions/stacker/class_FullStackerException.php
framework/main/exceptions/stacker/class_InvalidMagicException.php
framework/main/exceptions/state/class_InvalidStateInstanceException.php
framework/main/exceptions/state/class_UnexpectedStateException.php
framework/main/exceptions/state/class_UnresolveableStateException.php
framework/main/exceptions/template/class_BasePathReadProtectedException.php
framework/main/exceptions/template/class_InvalidDirectoryException.php
framework/main/exceptions/template/class_NoVariableException.php
framework/main/exceptions/template/class_UnexpectedTemplateTypeException.php
framework/main/exceptions/template/class_UnsupportedTemplateEngineException.php
framework/main/exceptions/user/class_AccountPasswordMismatchException.php
framework/main/exceptions/user/class_UnexpectedGuestAccountException.php
framework/main/exceptions/user/class_UserEmailMissingException.php
framework/main/exceptions/user/class_UserNoGuestException.php
framework/main/exceptions/user/class_UserPasswordMismatchException.php
framework/main/exceptions/user/class_UsernameMissingException.php
framework/main/exceptions/xml/class_InvalidXmlNodeException.php
framework/main/exceptions/xml/class_XmlNodeMismatchException.php
framework/main/exceptions/xml/class_XmlParserException.php
framework/main/interfaces/actions/class_PerformableAction.php
framework/main/interfaces/actions/commands/class_Commandable.php
framework/main/interfaces/application/class_ManageableApplication.php
framework/main/interfaces/auth/class_Authorizeable.php
framework/main/interfaces/block/calculatable/class_CalculatableBlock.php
framework/main/interfaces/block/class_Block.php
framework/main/interfaces/cache/class_Cacheable.php
framework/main/interfaces/captcha/class_SolveableCaptcha.php
framework/main/interfaces/class_
framework/main/interfaces/class_FrameworkInterface.php
framework/main/interfaces/client/class_Client.php
framework/main/interfaces/compressor/class_Compressor.php
framework/main/interfaces/controller/class_Controller.php
framework/main/interfaces/criteria/add/class_AddableCriteria.php
framework/main/interfaces/criteria/class_Criteria.php
framework/main/interfaces/criteria/search/class_LocalSearchCriteria.php
framework/main/interfaces/criteria/store/class_StoreableCriteria.php
framework/main/interfaces/criteria/update/class_LocalUpdateCriteria.php
framework/main/interfaces/crypto/class_Cryptable.php
framework/main/interfaces/database/backend/class_DatabaseBackend.php
framework/main/interfaces/database/class_FrameworkDatabase.php
framework/main/interfaces/database/class_Updateable.php
framework/main/interfaces/database/frontend/account/class_ManageableAccountFrontend.php
framework/main/interfaces/database/frontend/class_DatabaseFrontend.php
framework/main/interfaces/database/frontend/user_points/class_BookablePointsFrontend.php
framework/main/interfaces/database/middleware/class_DatabaseConnector.php
framework/main/interfaces/database/migration/class_MigrateableDatabase.php
framework/main/interfaces/database/migration/format_upgrade/class_UpgradeableDatabaseFormat.php
framework/main/interfaces/debug/class_Debugger.php
framework/main/interfaces/discovery/class_Discoverable.php
framework/main/interfaces/executor/class_Executor.php
framework/main/interfaces/feature/class_Feature.php
framework/main/interfaces/filesystem/binary/class_BinaryFile.php
framework/main/interfaces/filesystem/class_Filesystem.php
framework/main/interfaces/filesystem/index/class_IndexableFile.php
framework/main/interfaces/filesystem/stack/class_FileStacker.php
framework/main/interfaces/filter/class_Filterable.php
framework/main/interfaces/handler/class_Handleable.php
framework/main/interfaces/handler/class_HandleableDataSet.php
framework/main/interfaces/handler/task/class_HandleableTask.php
framework/main/interfaces/helper/class_Helper.php
framework/main/interfaces/helper/login/class_HelpableLogin.php
framework/main/interfaces/helper/template/class_HelpableTemplate.php
framework/main/interfaces/index/class_Indexable
framework/main/interfaces/index/class_Indexable.php
framework/main/interfaces/index/file/class_FileIndexer.php
framework/main/interfaces/index/file/stack/class_IndexableStack.php
framework/main/interfaces/io/class_CloseableFile.php
framework/main/interfaces/io/class_FilePointer.php
framework/main/interfaces/io/class_Streamable.php
framework/main/interfaces/io/class_StreamableInput.php
framework/main/interfaces/io/class_StreamableOutput.php
framework/main/interfaces/io/directory/class_FrameworkDirectory.php
framework/main/interfaces/io/file/class_FileInputStreamer.php
framework/main/interfaces/io/file/class_FileOutputStreamer.php
framework/main/interfaces/io/file/csv/class_CsvInputStreamer.php
framework/main/interfaces/io/file/handler/class_IoHandler.php
framework/main/interfaces/io/output/class_OutputStreamer.php
framework/main/interfaces/io/pointer/class_InputPointer.php
framework/main/interfaces/io/pointer/class_OutputPointer.php
framework/main/interfaces/io/pointer/io/class_InputOutputPointer.php
framework/main/interfaces/iterator/registry/class_IteratableRegistry.php
framework/main/interfaces/language/class_ManageableLanguage.php
framework/main/interfaces/lists/class_Listable.php
framework/main/interfaces/logging/class_Logger.php [new file with mode: 0644]
framework/main/interfaces/login/class_LoginableUser.php
framework/main/interfaces/mailer/class_DeliverableMail.php
framework/main/interfaces/parser/class_Parseable.php
framework/main/interfaces/points/class_BookablePoints.php
framework/main/interfaces/reader/class_ReadableNews.php
framework/main/interfaces/registration/class_UserRegister.php
framework/main/interfaces/registry/class_Register.php
framework/main/interfaces/registry/class_Registerable.php
framework/main/interfaces/registry/format_upgrade/class_RegisterableFormatUpgrade.php
framework/main/interfaces/registry/object/class_ObjectRegister.php [new file with mode: 0644]
framework/main/interfaces/request/class_Requestable.php
framework/main/interfaces/resolver/actions/class_ActionResolver.php
framework/main/interfaces/resolver/class_Resolver.php
framework/main/interfaces/resolver/commands/class_CommandResolver.php
framework/main/interfaces/resolver/controller/class_ControllerResolver.php
framework/main/interfaces/response/class_Responseable.php
framework/main/interfaces/result/class_SearchableResult.php
framework/main/interfaces/result/class_UpdateableResult.php
framework/main/interfaces/stacker/class_Stackable.php
framework/main/interfaces/stacker/file/class_StackableFile.php
framework/main/interfaces/state/class_Stateable.php
framework/main/interfaces/streams/class_Stream.php
framework/main/interfaces/streams/crypto/class_EncryptableStream.php
framework/main/interfaces/streams/input/class_InputStream.php
framework/main/interfaces/streams/output/class_OutputStream.php
framework/main/interfaces/tasks/class_Taskable.php
framework/main/interfaces/template/class_CompileableTemplate.php
framework/main/interfaces/template/view/class_ViewHelper.php
framework/main/interfaces/template/xml/class_CompileableXmlTemplate.php
framework/main/interfaces/user/class_ManageableAccount.php
framework/main/interfaces/user/extended/class_ManageableGuest.php
framework/main/interfaces/user/extended/class_ManageableMember.php
framework/main/interfaces/visitor/class_Visitable.php
framework/main/interfaces/visitor/class_Visitor.php
framework/main/interfaces/visitor/decorator/class_DecoratorVisitor.php
framework/main/interfaces/visitor/tasks/class_TaskVisitor.php
framework/main/middleware/class_BaseMiddleware.php
framework/main/middleware/compressor/class_CompressorChannel.php
framework/main/middleware/database/class_DatabaseConnection.php
framework/main/middleware/debug/class_DebugMiddleware.php
framework/main/middleware/io/class_FileIoHandler.php
framework/main/tests/commands/console/class_TestsConsoleMainCommand.php [deleted file]
framework/main/tests/controller/console/class_TestsConsoleDefaultNewsController.php [deleted file]
framework/main/tests/filter/class_BaseTestsFilter.php [deleted file]
framework/main/tests/filter/tests/class_Tests [deleted file]
framework/main/tests/filter/tests/configuration/class_TestConfiguration [deleted file]
framework/main/tests/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php [deleted file]
framework/main/tests/filter/tests/requirements/class_TestsPhpRequirementsFilter.php [deleted file]
framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php [deleted file]
framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php [deleted file]
framework/main/third_party/akismet/akismet.class.php [deleted file]
framework/main/third_party/scrypt/CREDITS [deleted file]
framework/main/third_party/scrypt/LICENSE [deleted file]
framework/main/third_party/scrypt/README.md [deleted file]
framework/main/traits/cache/class_CacheableTrait.php
framework/main/traits/compressor/class_CompressorChannelTrait.php
framework/main/traits/crypto/class_CryptoTrait.php
framework/main/traits/database/frontend/class_DatabaseFrontendTrait.php
framework/main/traits/file/class_BinaryFileTrait.php
framework/main/traits/handler/io/class_IoHandlerTrait.php
framework/main/traits/helper/class_HelperTrait.php
framework/main/traits/index/class_IndexableTrait.php
framework/main/traits/iterator/class_IteratorTrait.php
framework/main/traits/list/class_ListableTrait.php
framework/main/traits/manager/account/class_ManageableAccountTrait.php
framework/main/traits/registry/class_RegisterTrait.php
framework/main/traits/resolver/class_ResolverTrait.php
framework/main/traits/result/search/class_SearchableResultTrait.php
framework/main/traits/stacker/class_StackableTrait.php
framework/main/traits/state/class_StateableTrait.php
framework/main/traits/stream/input/class_InputStreamTrait.php
framework/main/traits/stream/output/class_OutputStreamTrait.php
framework/main/traits/streamer/file/input/class_FileInputStreamerTrait.php
framework/main/traits/streamer/file/output/class_FileOutputStreamerTrait.php
framework/main/traits/streamer/output/class_OutputStreamerTrait.php
framework/main/traits/template/class_CompileableTemplateTrait.php
framework/main/traits/visitor/class_VisitorTrait.php
index.php
tests/bootstrap.php
tests/framework/bootstrap/class_FrameworkBootstrapTest.php
tests/framework/config/FrameworkConfigurationTest.php

diff --git a/application/.htaccess b/application/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
index 3d69f0fc1673b40e76b9e9767c98d2f2ea355a5a..161f9fc2faa71748d86fbf8bc26f91236918520d 100644 (file)
@@ -8,6 +8,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
@@ -35,7 +36,7 @@ use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -96,9 +97,6 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
         * @return      void
         */
        public function initApplication () {
-               // Get config instance
-               $cfg = FrameworkBootstrap::getConfigurationInstance();
-
                // Initialize output system
                self::createDebugInstance('ApplicationHelper');
 
@@ -107,15 +105,6 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                 * method.
                 */
                FrameworkBootstrap::initDatabaseInstance();
-
-               // Register core tests
-               ClassLoader::registerTestsPath('framework/main/tests');
-
-               // Register own tests
-               ClassLoader::registerTestsPath('application/tests/tests');
-
-               // Scan for them now
-               ClassLoader::scanTestsClasses();
        }
 
        /**
@@ -159,9 +148,9 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance);
 
                // -------------------------- Shutdown phase --------------------------
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown in progress ...');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('MAIN: Shutdown in progress ...');
                $this->getControllerInstance()->executeShutdownFilters($requestInstance, $responseInstance);
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)');
+               self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('MAIN: Shutdown completed. (This is the last line.)');
        }
 
        /**
@@ -195,7 +184,7 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
         * @todo        Nothing to add?
         */
        public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
-               $this->partialStub('Unfinished method. templateInstance=' . $templateInstance->__toString());
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished method. templateInstance=' . $templateInstance->__toString());
        }
 
 }
diff --git a/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php b/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php
new file mode 100644 (file)
index 0000000..a88b097
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Command;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Command\BaseCommand;
+use Org\Mxchange\CoreFramework\Command\Commandable;
+use Org\Mxchange\CoreFramework\Controller\Controller;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+
+/**
+ * A command for the 'main' routine
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestsConsoleMainCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance       An instance of a command resolver class
+        * @return      $commandInstance        An instance a prepared command class
+        */
+       public static final function createTestsConsoleMainCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new TestsConsoleMainCommand();
+
+               // 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) {
+               // Debug message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONSOLE-MAIN-COMMAND: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('MAIN: --- Starting tests ... ---');
+
+               // Get controller
+               $controllerInstance = ObjectRegistry::getRegistry('generic')->getInstance('controller');
+
+               // Run all tests
+               $controllerInstance->executeTestsFilters($requestInstance, $responseInstance);
+
+               // Debug message
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('MAIN: --- Leaving main ... ---');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONSOLE-MAIN-COMMAND: EXIT!');
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add pre filters (e.g. for requirements checks)
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONSOLE-MAIN-COMMAND: controllerInstance=%s,requestInstance=%s - CALLED!', $controllerInstance->__toString(), $requestInstance->__toString()));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('tests_php_requirements_filter_class'));
+
+               // Add 'tests' filters which will run the actual tests
+               $controllerInstance->addTestsFilter(ObjectFactory::createObjectByConfiguredName('tests_configuration_classes_loadable_filter_class'));
+               $controllerInstance->addTestsFilter(ObjectFactory::createObjectByConfiguredName('tests_configuration_is_enabled_filter_class'));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONSOLE-MAIN-COMMAND: EXIT!');
+       }
+
+}
diff --git a/application/tests/classes/controller/console/class_TestsConsoleDefaultNewsController.php b/application/tests/classes/controller/console/class_TestsConsoleDefaultNewsController.php
new file mode 100644 (file)
index 0000000..630cf65
--- /dev/null
@@ -0,0 +1,159 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Controller;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Controller\BaseController;
+use Org\Mxchange\CoreFramework\Controller\Controller;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+
+/**
+ * The default controller with news for e.g. home or news page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestsConsoleDefaultNewsController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: CONSTRUCTED!');
+               parent::__construct(__CLASS__);
+
+               // Init additional filter chains
+               foreach (['bootstrap', 'tests', BaseController::FILTER_CHAIN_SHUTDOWN] as $filterChain) {
+                       // Init filter chain
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Initializing filterChain=%s ...', $filterChain));
+                       $this->initFilterChain($filterChain);
+               }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: EXIT!');
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        */
+       public static final function createTestsConsoleDefaultNewsController (CommandResolver $resolverInstance) {
+               // Create the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: resolverInstance=%s - CALLED!', $resolverInstance->__toString()));
+               $controllerInstance = new TestsConsoleDefaultNewsController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add news filters to this controller
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter_class'));
+
+               // Return the prepared instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: controllerInstance=%s - EXIT!', $controllerInstance->__toString()));
+               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) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // This request was valid! :-D
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Invoking requestInstance->setIsRequestValid(TRUE) ...');
+               $requestInstance->setIsRequestValid(TRUE);
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the post filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Invoking responseInstance->flushBuffer() ...');
+               $responseInstance->flushBuffer();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: EXIT!');
+       }
+
+       /**
+        * Add a bootstrap filter
+        *
+        * @param       $filterInstance         A Filterable class
+        * @return      void
+        */
+       public function addBootstrapFilter (Filterable $filterInstance) {
+               $this->addFilter('bootstrap', $filterInstance);
+       }
+
+       /**
+        * Add a tests filter
+        *
+        * @param       $filterInstance         A Filterable class
+        * @return      void
+        */
+       public function addTestsFilter (Filterable $filterInstance) {
+               $this->addFilter('tests', $filterInstance);
+       }
+
+       /**
+        * Executes all bootstrap filters
+        *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
+        * @return      void
+        */
+       public function executeBootstrapFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->executeFilters('bootstrap', $requestInstance, $responseInstance);
+       }
+
+       /**
+        * Executes all tests filters
+        *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
+        * @return      void
+        */
+       public function executeTestsFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->executeFilters('tests', $requestInstance, $responseInstance);
+       }
+
+}
diff --git a/application/tests/classes/filter/class_BaseTestsFilter.php b/application/tests/classes/filter/class_BaseTestsFilter.php
new file mode 100644 (file)
index 0000000..ca7ea4c
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Filter;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Filter\BaseFilter;
+
+/**
+ * A generic filter for tests
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseTestsFilter extends BaseFilter {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Real name of class
+        * @return      void
+        */
+       protected function __construct (string $className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+}
diff --git a/application/tests/classes/filter/tests/class_Tests b/application/tests/classes/filter/tests/class_Tests
new file mode 100644 (file)
index 0000000..a5a1bc4
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Filter\???;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A ??? filter for tests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Tests???Filter extends BaseTestsFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createTests???Filter () {
+               // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-|||-FILTER: CALLED!');
+               $filterInstance = new Tests???Filter();
+
+               // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-|||-FILTER: filterInstance=%s - EXIT!', $filterInstance->__toString()));
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Init counter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-|||-FILTER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               $passed = $failed = $skipped = $warning = 0;
+
+               // Implement this!
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
+
+               // Calculate percentage
+               $percent = (($passed + $failed) > 0 ? ($passed / ($passed + $failed) * 100) : 0);
+
+               // Output result
+               self::createDebugInstance(__CLASS__, __LINE__)->infoMessage(sprintf('Test result: %d okay, %d failed (%0.02f%% passed), %d skipped, %d warnings', $passed, $failed, $percent, $skipped, $warning));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-|||-FILTER: EXIT!');
+       }
+
+}
diff --git a/application/tests/classes/filter/tests/configuration/class_TestsConfiguration b/application/tests/classes/filter/tests/configuration/class_TestsConfiguration
new file mode 100644 (file)
index 0000000..e6240ea
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Filter\Configuration\???;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A ??? filter for configuration tests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestsConfiguration???Filter extends BaseTestsFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createTestsConfiguration???Filter () {
+               // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONFIGURATION-|||-FILTER: CALLED!');
+               $filterInstance = new TestsConfiguration???Filter();
+
+               // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONFIGURATION-|||-FILTER: filterInstance=%s - EXIT!', $filterInstance->__toString()));
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Init counter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONFIGURATION-|||-FILTER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               $passed = $failed = $skipped = $warning = 0;
+
+               // Implement this!
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
+
+               // Calculate percentage
+               $percent = (($passed + $failed) > 0 ? ($passed / ($passed + $failed) * 100) : 0);
+
+               // Output result
+               self::createDebugInstance(__CLASS__, __LINE__)->infoMessage(sprintf('Test result: %d okay, %d failed (%0.02f%% passed), %d skipped, %d warning - EXIT!', $passed, $failed, $percent, $skipped, $warning));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONFIGURATION-|||-FILTER: EXIT!');
+       }
+
+}
diff --git a/application/tests/classes/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php b/application/tests/classes/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php
new file mode 100644 (file)
index 0000000..38990d1
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Filter\Configuration\Classes;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A LoadableClasses filter for tests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestConfigurationLoadableClassesFilter extends BaseTestsFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createTestConfigurationLoadableClassesFilter () {
+               // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONFIGURATION-LOADABLE-CLASSES-FILTER: CALLED!');
+               $filterInstance = new TestConfigurationLoadableClassesFilter();
+
+               // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONFIGURATION-LOADABLE-CLASSES-FILTER: filterInstance=%s - EXIT!', $filterInstance->__toString()));
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Init counter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONFIGURATION-LOADABLE-CLASSES-FILTER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               $passed = $failed = $skipped = $warning = 0;
+
+               // Loop through all configuration keys
+               foreach (FrameworkBootstrap::getConfigurationInstance()->getConfigurationArray() as $configKey => $configValue) {
+                       // Key must end with _class
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TESTS-CONFIGURATION-LOADABLE-CLASSES-FILTER: configKey[%s]=%s,configValue[%s]=%s', gettype($configKey), $configKey, gettype($configValue), $configValue));
+                       if (substr($configKey, -6, 6) != '_class') {
+                               // Skip this
+                               $skipped++;
+                               continue;
+                       }
+
+                       // This may throw exceptions
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('Testing configKey[%s]=%s,configValue[%s]=%s', gettype($configKey), $configKey, gettype($configValue), $configValue));
+                       try {
+                               // Is the config entry valid and class is there?
+                               if (!is_string($configValue)) {
+                                       // Skip further tests
+                                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('configValue=%s has unexpected type "%s", required: string - FAILED!', $configValue, gettype($configValue)));
+                                       $failed++;
+                                       continue;
+                               } elseif (!class_exists($configValue)) {
+                                       // Skip further tests
+                                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('Class "%s" not found. FAILED!', $configValue));
+                                       $failed++;
+                                       continue;
+                               }
+                       } catch (InvalidArgumentException $e) {
+                               // Maybe not conform?
+                               self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('Class "%s" failed to load. Message: "%s"', $configValue, $e->getMessage()));
+
+                               // Skip further tests
+                               $failed++;
+                               continue;
+                       }
+
+                       // class_exists() didn't fail
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('Class "%s" loaded successfully. OKAY', $configValue));
+                       $passed++;
+               }
+
+               // Calculate percentage
+               $percent = (($passed + $failed) > 0 ? ($passed / ($passed + $failed) * 100) : 0);
+
+               // Output result
+               self::createDebugInstance(__CLASS__, __LINE__)->infoMessage(sprintf('Test result: %d okay, %d failed (%0.02f%% passed), %d skipped, %d warning - EXIT!', $passed, $failed, $percent, $skipped, $warning));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONFIGURATION-LOADABLE-CLASSES-FILTER: EXIT!');
+       }
+
+}
diff --git a/application/tests/classes/filter/tests/configuration/is_enabled/class_TestsConfigurationIsEnabledFilter.php b/application/tests/classes/filter/tests/configuration/is_enabled/class_TestsConfigurationIsEnabledFilter.php
new file mode 100644 (file)
index 0000000..1e4ae6a
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Filter\Configuration\IsEnabled;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A IsEnabled filter for configuration tests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestsConfigurationIsEnabledFilter extends BaseTestsFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createTestsConfigurationIsEnabledFilter () {
+               // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONFIGURATION-IS-ENABLED-FILTER: CALLED!');
+               $filterInstance = new TestsConfigurationIsEnabledFilter();
+
+               // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONFIGURATION-IS-ENABLED-FILTER: filterInstance=%s - EXIT!', $filterInstance->__toString()));
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Init counter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONFIGURATION-IS-ENABLED-FILTER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               $passed = $failed = $skipped = $warning = 0;
+
+               // Loop through all configuration keys
+               foreach (FrameworkBootstrap::getConfigurationInstance()->getConfigurationArray() as $configKey => $configValue) {
+                       // Key must end with _class
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TESTS-CONFIGURATION-IS-ENABLED-FILTER: configKey[%s]=%s,configValue[%s]=%s', gettype($configKey), $configKey, gettype($configValue), $configValue));
+                       if (substr($configKey, 0, 3) != 'is_' && substr($configKey, -8, 8) != '_enabled') {
+                               // Is this a boolean value?
+                               if (is_bool($configValue)) {
+                                       // Issue a warning
+                                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('TESTS-CONFIGURATION-IS-ENABLED-FILTER: comnfigKey=%s has a boolean value[]=%s', $configKey, gettype($configValue)));
+                                       $warning++;
+                               } else {
+                                       // Mark as skipped
+                                       self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TESTS-CONFIGURATION-IS-ENABLED-FILTER: comnfigKey=%s is not wanted here - SKIPPED!', $configKey));
+                                       $skipped++;
+                               }
+
+                               // Skip this
+                               continue;
+                       }
+
+                       // Is it boolean?
+                       if (!is_bool($configValue)) {
+                               // Failed!
+                               self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('Configuration key "%s" is NOT boolean. FAILED', $configKey));
+                               $failed++;
+                       } else {
+                               // Count as success
+                               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('Configuration key "%s" is a boolean feature. OKAY', $configKey));
+                               $passed++;
+                       }
+               }
+
+               // Calculate percentage
+               $percent = (($passed + $failed) > 0 ? ($passed / ($passed + $failed) * 100) : 0);
+
+               // Output result
+               self::createDebugInstance(__CLASS__, __LINE__)->infoMessage(sprintf('Test result: %d okay, %d failed (%0.02f%% passed), %d skipped, $d warnings', $passed, $failed, $percent, $skipped, $warning));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONFIGURATION-IS-ENABLED-FILTER: EXIT!');
+       }
+
+}
diff --git a/application/tests/classes/filter/tests/requirements/class_TestsPhpRequirementsFilter.php b/application/tests/classes/filter/tests/requirements/class_TestsPhpRequirementsFilter.php
new file mode 100644 (file)
index 0000000..2d8b991
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Filter\PhpRequirements;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A PhpRequirements filter for tests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestsPhpRequirementsFilter extends BaseTestsFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createTestsPhpRequirementsFilter () {
+               // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-PHP-REQUIREMENTS-FILTER: CALLED!');
+               $filterInstance = new TestsPhpRequirementsFilter();
+
+               // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-PHP-REQUIREMENTS-FILTER: filterInstance=%s - EXIT!', $filterInstance->__toString()));
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Init counter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-PHP-REQUIREMENTS-FILTER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               $passed = $failed = $skipped = $warning = 0;
+
+               // Implement this!
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
+
+               // Calculate percentage
+               $percent = (($passed + $failed) > 0 ? ($passed / ($passed + $failed) * 100) : 0);
+
+               // Output result
+               self::createDebugInstance(__CLASS__, __LINE__)->infoMessage(sprintf('Test result: %d okay, %d failed (%0.02f%% passed), %d skipped, %d warnings', $passed, $failed, $percent, $skipped, $warning));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-PHP-REQUIREMENTS-FILTER: EXIT!');
+       }
+
+}
diff --git a/application/tests/classes/resolver/command/console/class_TestsConsoleCommandResolver.php b/application/tests/classes/resolver/command/console/class_TestsConsoleCommandResolver.php
new file mode 100644 (file)
index 0000000..72aca8d
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Resolver\Command;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Resolver\Command\BaseCommandResolver;
+use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A command resolver for console commands
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestsConsoleCommandResolver extends BaseCommandResolver implements CommandResolver {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "TestsConsole"
+               $this->setClassPrefix('tests_console');
+       }
+
+       /**
+        * Creates an instance of a TestsConsole command resolver with a given default command
+        *
+        * @param       $commandName                            The default command we shall execute
+        * @return      $resolverInstance                       The prepared command resolver instance
+        * @throws      InvalidArgumentException                Thrown if default command is not set
+        * @throws      InvalidCommandException         Thrown if default command is invalid
+        */
+       public static final function createTestsConsoleCommandResolver (string $commandName) {
+               // Create the new instance
+               $resolverInstance = new TestsConsoleCommandResolver();
+
+               // Is the variable $commandName set and the command is valid?
+               if (empty($commandName)) {
+                       // Then thrown an exception here
+                       throw new InvalidArgumentException('Parameter "commandName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($resolverInstance->isCommandValid('Org\Mxchange\CoreFramework\Tests\Command', $commandName) === false) {
+                       // Invalid command found
+                       throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
+               }
+
+               // Set namespace for command
+               $resolverInstance->setNamespace('Org\Mxchange\CoreFramework\Tests\Command');
+               $resolverInstance->setCommandName($commandName);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+}
diff --git a/application/tests/classes/resolver/controller/class_TestsConsoleControllerResolver.php b/application/tests/classes/resolver/controller/class_TestsConsoleControllerResolver.php
new file mode 100644 (file)
index 0000000..4273cdc
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Tests\Resolver\Controller;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Controller\BaseController;
+use Org\Mxchange\CoreFramework\Controller\Controller;
+use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
+use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A resolver for resolving controllers locally
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestsConsoleControllerResolver extends BaseControllerResolver implements ControllerResolver {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set prefix to "TestsConsole"
+               $this->setClassPrefix('tests_console');
+       }
+
+       /**
+        * Creates an instance of a resolver class with a given command
+        *
+        * @param       $controllerName                         The controller we shall resolve
+        * @return      $resolverInstance                       The prepared controller resolver instance
+        * @throws      InvalidArgumentException                Thrown if default command is not set
+        * @throws      InvalidControllerException      Thrown if default controller is invalid
+        */
+       public static final function createTestsConsoleControllerResolver (string $controllerName) {
+               // Create the new instance
+               $resolverInstance = new TestsConsoleControllerResolver();
+
+               // Is the variable $controllerName set and the command is valid?
+               if (empty($controllerName)) {
+                       // Then thrown an exception here
+                       throw new InvalidArgumentException('Parameter "controllerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($resolverInstance->isControllerValid('Org\Mxchange\CoreFramework\Tests\Controller', $controllerName) === false) {
+                       // Invalid command found
+                       throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
+               }
+
+               // Set namespace and controller name
+               $resolverInstance->setNamespace('Org\Mxchange\CoreFramework\Tests\Controller');
+               $resolverInstance->setControllerName($controllerName);
+
+               // Return the prepared instance
+               return $resolverInstance;
+       }
+
+}
diff --git a/application/tests/config-local.php-dist b/application/tests/config-local.php-dist
new file mode 100644 (file)
index 0000000..84f1ff6
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+
+/**
+ * Local configuration entries which you can customize. Please keep the
+ * comments starting with CFG: as-is or else, the later configuration wizard
+ * (aka. 'admin' project) will not be able to parse it. You need to rename this
+ * file to config-local.php and make in that new file your changes.
+ *
+ * If you want to start an own network (which may accept different types of
+ * objects which would be rejected by the global network) please change
+ * hub_bootstrap_nodes (semicolon-seperated list) to your bootstrapper.
+ *
+ * You can set external_address to a hostname, e.g. me.homelinux.org, which will be
+ * included in the announcement. This is very useful for consumer DSL
+ * connections because they might be disconnected every 24 hours and rotate the
+ * IP number.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Some hub-specific configuration like port hostname where we will listen, etc.
+$cfg = FrameworkBootstrap::getConfigurationInstance();
index 9d5ee1a3f804b213ce59ec89491e7a5cc64c6fda..17ffa86757a05b5dcf0a5168907691820d5a488c 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -52,10 +52,13 @@ $cfg->setConfigEntry('news_reader_main_class', 'Org\Mxchange\CoreFramework\Reade
 $cfg->setConfigEntry('news_main_limit', 5);
 
 // CFG: TESTS-PHP-REQUIREMENTS-FILTER
-$cfg->setConfigEntry('tests_php_requirements_filter_class', 'Org\Mxchange\CoreFramework\Tests\Filter\Requirements\TestsPhpRequirementsFilter');
+$cfg->setConfigEntry('tests_php_requirements_filter_class', 'Org\Mxchange\CoreFramework\Tests\Filter\PhpRequirements\TestsPhpRequirementsFilter');
 
 // CFG: TEST-CONFIGURATION-CLASSES-LOADABLE-TEST-FILTER-CLASS
-$cfg->setConfigEntry('tests_configuration_classes_loadable_test_filter_class', 'Org\Mxchange\CoreFramework\Tests\Filter\Configuration\Classes\TestConfigurationLoadableClassesFilter');
+$cfg->setConfigEntry('tests_configuration_classes_loadable_filter_class', 'Org\Mxchange\CoreFramework\Tests\Filter\Configuration\Classes\TestConfigurationLoadableClassesFilter');
+
+// CFG: TEST-CONFIGURATION-IS-ENABLED-TEST-FILTER-CLASS
+$cfg->setConfigEntry('tests_configuration_is_enabled_filter_class', 'Org\Mxchange\CoreFramework\Tests\Filter\Configuration\IsEnabled\TestsConfigurationIsEnabledFilter');
 
 // CFG: TEST-CONSOLE-CONTROLLER-RESOLVER-CLASS
 $cfg->setConfigEntry('tests_console_controller_resolver_class', 'Org\Mxchange\CoreFramework\Tests\Resolver\Controller\TestsConsoleControllerResolver');
diff --git a/application/tests/data.php b/application/tests/data.php
deleted file mode 100644 (file)
index 6c0572b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * Application data
- *
- * Please remember that this include file is being loaded *before* the class
- * loader is loading classes from "exceptions", "interfaces" and "main"!
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-// Get config instance
-$cfg = FrameworkConfiguration::getSelfInstance();
-
-// Get an instance of the helper
-$app = call_user_func_array(
-       array($cfg->getConfigEntry('app_helper_class'), 'getSelfInstance'),
-       []
-);
-
-// Set application name and version
-$app->setAppName('Unit tests and more');
-$app->setAppVersion('0.0.0');
-$app->setAppShortName('tests');
index 049330d0a21e1c6fdcb272590ead0d03456ce775..7bd77be9c4c32dd1488e6957ef674ad3b86676fc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index 1e960cb85b371d1b382fbceee3f8239fe88077ca..06acedd47625f1bc63e4e6c2e713d68e6cb4660b 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -28,22 +28,28 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  */
 
 // The node's own exception handler
-function tests_exception_handler ($exceptionInstance) {
+function core_exception_handler ($exceptionInstance) {
        // Is it an object and a valid instance?
        if ((is_object($exceptionInstance)) && ($exceptionInstance instanceof Exception)) {
                // Init variable
                $backTrace = '';
 
+               // Generate exception code
+               $exceptionCode = ($exceptionInstance instanceof FrameworkException ? $exceptionInstance->getHexCode() : '0x' . bin2hex($exceptionInstance->getCode()));
+
                // Get all call levels from backtrace
                foreach ($exceptionInstance->getTrace() as $idx => $traceArray) {
                        // Init argument string
                        $argsString = '';
 
-                       // Convert arguments type into human-readable
-                       foreach ($traceArray['args'] as $arg) {
-                               $argsString .= ', ' . gettype($arg);
+                       // Arguments given?
+                       if (isset($traceArray['args'])) {
+                               // Convert arguments type into human-readable
+                               foreach ($traceArray['args'] as $arg) {
+                                       $argsString .= ', ' . gettype($arg);
+                               }
+                               $argsString = substr($argsString, 2);
                        }
-                       $argsString = substr($argsString, 2);
 
                        // Set missing file/line
                        if (!isset($traceArray['file']))  $traceArray['file']  = 'unknown';
@@ -81,7 +87,7 @@ Backtrace:
 --------------------------------------------------------------------------------\n",
                        trim(html_entity_decode(strip_tags(get_class($exceptionInstance)))),
                        trim(html_entity_decode(strip_tags($exceptionInstance->getMessage()))),
-                       ($exceptionInstance instanceof FrameworkException ? $exceptionInstance->getHexCode() : '0x' . bin2hex($exceptionInstance->getCode())),
+                       $exceptionCode,
                        $exceptionInstance->getFile(),
                        $exceptionInstance->getLine(),
                        trim($backTrace)
@@ -89,9 +95,13 @@ Backtrace:
 
                // Output the message
                print($message);
+
+               // Exit with code
+               exit(hexdec($exceptionCode));
        } elseif (is_object($exceptionInstance)) {
                // Output more details
                printf('exceptionInstance=%s', print_r($exceptionInstance, true));
+               exit(255);
        } else {
                /*
                 * Invalid exception instance detected! Do *only* throw exceptions that
@@ -99,13 +109,14 @@ Backtrace:
                 * outputs like above.
                 */
                printf('exceptionInstance[]=%s is invalid! Please inform the core developer team.' . PHP_EOL, gettype($exceptionInstance));
+               exit(255);
        }
 }
 
 // Error handler
-function tests_error_handler ($errno, $errstr, $errfile, $errline, array $errcontext) {
+function core_error_handler (int $errno, string $errstr, string $errfile, int $errline, array $errcontext) {
        // Construct the message
-       $message = sprintf('File: %s, Line: %s, Code: %s, Message: %s',
+       $message = sprintf('File: %s, Line: %d, Code: %d, Message: %s',
                basename($errfile),
                $errline,
                $errno,
@@ -117,9 +128,9 @@ function tests_error_handler ($errno, $errstr, $errfile, $errline, array $errcon
 }
 
 // Assertion handler
-function tests_assert_handler (string $file, int $line, $code) {
+function core_assert_handler (string $file, int $line, int $code) {
        // Empty code?
-       if ($code === '') {
+       if (empty($code)) {
                $code = '<em>Unknown</em>';
        }
 
@@ -138,14 +149,14 @@ function tests_assert_handler (string $file, int $line, $code) {
 }
 
 // Set error handler
-//set_error_handler('tests_error_handler');
+//set_error_handler('core_error_handler');
 
 // Set the new handler
-set_exception_handler('tests_exception_handler');
+set_exception_handler('core_exception_handler');
 
 // Init assert handling
 assert_options(ASSERT_ACTIVE    , true);
-assert_options(ASSERT_WARNING   , false);
+assert_options(ASSERT_WARNING   , true);
 assert_options(ASSERT_BAIL      , true);
 assert_options(ASSERT_QUIET_EVAL, false);
-assert_options(ASSERT_CALLBACK  , 'tests_assert_handler');
+assert_options(ASSERT_CALLBACK  , 'core_assert_handler');
diff --git a/application/tests/loader.php b/application/tests/loader.php
deleted file mode 100644 (file)
index d863d21..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * The application's class loader
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-// Scan for application's classes, exceptions and interfaces
-ClassLoader::scanApplicationClasses();
diff --git a/application/tests/starter.php b/application/tests/starter.php
deleted file mode 100644 (file)
index ddab3da..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * The application launcher
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-// Is there an application helper instance? We need the method main() for
-// maining the application
-$app = call_user_func_array(
-       array(
-               FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class'), 'getSelfInstance'
-       ), []
-);
-
-// Some sanity checks
-if ((empty($app)) || (is_null($app))) {
-       // Something went wrong!
-       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the helper class <span class=\"class_name\">%s</span> is not loaded.",
-               $application,
-               FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class')
-       ));
-} elseif (!is_object($app)) {
-       // No object!
-       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because &#39;app&#39; is not an object.",
-               $application
-       ));
-} elseif (!method_exists($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method'))) {
-       // Method not found!
-       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the method <span class=\"method_name\">%s</span> is missing.",
-               $application,
-               FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')
-       ));
-}
-
-// Call user function
-call_user_func_array(array($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')), []);
index 0663375aa2b2d3aa58c74b0ef567d2334881bf1c..bd19aafdf7310b577d78c2703dc5173542d13c2e 100644 (file)
@@ -7,31 +7,79 @@
     "content-hash": "ed9acb2394cfd19378859e9f830535f2",
     "packages": [],
     "packages-dev": [
+        {
+            "name": "doctrine/deprecations",
+            "version": "1.1.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/deprecations.git",
+                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
+                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1 || ^8.0"
+            },
+            "require-dev": {
+                "doctrine/coding-standard": "^9",
+                "phpstan/phpstan": "1.4.10 || 1.10.15",
+                "phpstan/phpstan-phpunit": "^1.0",
+                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+                "psalm/plugin-phpunit": "0.18.4",
+                "psr/log": "^1 || ^2 || ^3",
+                "vimeo/psalm": "4.30.0 || 5.12.0"
+            },
+            "suggest": {
+                "psr/log": "Allows logging deprecations via PSR-3 logger implementation"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
+            "homepage": "https://www.doctrine-project.org/",
+            "support": {
+                "issues": "https://github.com/doctrine/deprecations/issues",
+                "source": "https://github.com/doctrine/deprecations/tree/1.1.2"
+            },
+            "time": "2023-09-27T20:04:15+00:00"
+        },
         {
             "name": "doctrine/instantiator",
-            "version": "1.4.0",
+            "version": "1.5.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/doctrine/instantiator.git",
-                "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
+                "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
-                "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
+                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
+                "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
                 "shasum": ""
             },
             "require": {
                 "php": "^7.1 || ^8.0"
             },
             "require-dev": {
-                "doctrine/coding-standard": "^8.0",
+                "doctrine/coding-standard": "^9 || ^11",
                 "ext-pdo": "*",
                 "ext-phar": "*",
-                "phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
-                "phpstan/phpstan": "^0.12",
-                "phpstan/phpstan-phpunit": "^0.12",
-                "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
+                "phpbench/phpbench": "^0.16 || ^1",
+                "phpstan/phpstan": "^1.4",
+                "phpstan/phpstan-phpunit": "^1",
+                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+                "vimeo/psalm": "^4.30 || ^5.4"
             },
             "type": "library",
             "autoload": {
                 "constructor",
                 "instantiate"
             ],
+            "support": {
+                "issues": "https://github.com/doctrine/instantiator/issues",
+                "source": "https://github.com/doctrine/instantiator/tree/1.5.0"
+            },
             "funding": [
                 {
                     "url": "https://www.doctrine-project.org/sponsorship.html",
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-10T18:47:58+00:00"
+            "time": "2022-12-30T00:15:36+00:00"
         },
         {
             "name": "myclabs/deep-copy",
-            "version": "1.10.2",
+            "version": "1.11.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/myclabs/DeepCopy.git",
-                "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220"
+                "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220",
-                "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220",
+                "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
+                "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
                 "shasum": ""
             },
             "require": {
                 "php": "^7.1 || ^8.0"
             },
-            "replace": {
-                "myclabs/deep-copy": "self.version"
+            "conflict": {
+                "doctrine/collections": "<1.6.8",
+                "doctrine/common": "<2.13.3 || >=3,<3.2.2"
             },
             "require-dev": {
-                "doctrine/collections": "^1.0",
-                "doctrine/common": "^2.6",
-                "phpunit/phpunit": "^7.1"
+                "doctrine/collections": "^1.6.8",
+                "doctrine/common": "^2.13.3 || ^3.2.2",
+                "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
             },
             "type": "library",
             "autoload": {
-                "psr-4": {
-                    "DeepCopy\\": "src/DeepCopy/"
-                },
                 "files": [
                     "src/DeepCopy/deep_copy.php"
-                ]
+                ],
+                "psr-4": {
+                    "DeepCopy\\": "src/DeepCopy/"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
                 "object",
                 "object graph"
             ],
+            "support": {
+                "issues": "https://github.com/myclabs/DeepCopy/issues",
+                "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
+            },
             "funding": [
                 {
                     "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-13T09:40:50+00:00"
+            "time": "2023-03-08T13:26:56+00:00"
         },
         {
             "name": "phar-io/manifest",
                 }
             ],
             "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
+            "support": {
+                "issues": "https://github.com/phar-io/manifest/issues",
+                "source": "https://github.com/phar-io/manifest/tree/master"
+            },
             "time": "2017-03-05T18:14:27+00:00"
         },
         {
                 }
             ],
             "description": "Library for handling version information and constraints",
+            "support": {
+                "issues": "https://github.com/phar-io/version/issues",
+                "source": "https://github.com/phar-io/version/tree/master"
+            },
             "time": "2017-03-05T17:38:23+00:00"
         },
         {
                 "reflection",
                 "static analysis"
             ],
+            "support": {
+                "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
+                "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
+            },
             "time": "2020-06-27T09:03:43+00:00"
         },
         {
                 }
             ],
             "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+            "support": {
+                "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
+                "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
+            },
             "time": "2021-10-19T17:43:47+00:00"
         },
         {
             "name": "phpdocumentor/type-resolver",
-            "version": "1.6.0",
+            "version": "1.8.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpDocumentor/TypeResolver.git",
-                "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706"
+                "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706",
-                "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706",
+                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fad452781b3d774e3337b0c0b245dd8e5a4455fc",
+                "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc",
                 "shasum": ""
             },
             "require": {
-                "php": "^7.2 || ^8.0",
-                "phpdocumentor/reflection-common": "^2.0"
+                "doctrine/deprecations": "^1.0",
+                "php": "^7.4 || ^8.0",
+                "phpdocumentor/reflection-common": "^2.0",
+                "phpstan/phpdoc-parser": "^1.13"
             },
             "require-dev": {
                 "ext-tokenizer": "*",
-                "psalm/phar": "^4.8"
+                "phpbench/phpbench": "^1.2",
+                "phpstan/extension-installer": "^1.1",
+                "phpstan/phpstan": "^1.8",
+                "phpstan/phpstan-phpunit": "^1.1",
+                "phpunit/phpunit": "^9.5",
+                "rector/rector": "^0.13.9",
+                "vimeo/psalm": "^4.25"
             },
             "type": "library",
             "extra": {
                 }
             ],
             "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
-            "time": "2022-01-04T19:58:01+00:00"
+            "support": {
+                "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
+                "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.0"
+            },
+            "time": "2024-01-11T11:49:22+00:00"
         },
         {
             "name": "phpspec/prophecy",
                 "spy",
                 "stub"
             ],
+            "support": {
+                "issues": "https://github.com/phpspec/prophecy/issues",
+                "source": "https://github.com/phpspec/prophecy/tree/v1.10.3"
+            },
             "time": "2020-03-05T15:02:03+00:00"
         },
+        {
+            "name": "phpstan/phpdoc-parser",
+            "version": "1.25.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpstan/phpdoc-parser.git",
+                "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bd84b629c8de41aa2ae82c067c955e06f1b00240",
+                "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.2 || ^8.0"
+            },
+            "require-dev": {
+                "doctrine/annotations": "^2.0",
+                "nikic/php-parser": "^4.15",
+                "php-parallel-lint/php-parallel-lint": "^1.2",
+                "phpstan/extension-installer": "^1.0",
+                "phpstan/phpstan": "^1.5",
+                "phpstan/phpstan-phpunit": "^1.1",
+                "phpstan/phpstan-strict-rules": "^1.0",
+                "phpunit/phpunit": "^9.5",
+                "symfony/process": "^5.2"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "PHPStan\\PhpDocParser\\": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "PHPDoc parser with support for nullable, intersection and generic types",
+            "support": {
+                "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.25.0"
+            },
+            "time": "2024-01-04T17:06:16+00:00"
+        },
         {
             "name": "phpunit/php-code-coverage",
             "version": "5.3.2",
                 "testing",
                 "xunit"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/5.3"
+            },
             "time": "2018-04-06T15:36:58+00:00"
         },
         {
                 "filesystem",
                 "iterator"
             ],
+            "support": {
+                "irc": "irc://irc.freenode.net/phpunit",
+                "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+                "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5"
+            },
             "time": "2017-11-27T13:52:08+00:00"
         },
         {
             "keywords": [
                 "template"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+                "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1"
+            },
             "time": "2015-06-21T13:50:34+00:00"
         },
         {
             "keywords": [
                 "timer"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/php-timer/issues",
+                "source": "https://github.com/sebastianbergmann/php-timer/tree/master"
+            },
             "time": "2017-02-26T11:10:40+00:00"
         },
         {
             "keywords": [
                 "tokenizer"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
+                "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master"
+            },
             "abandoned": true,
             "time": "2017-11-27T05:48:46+00:00"
         },
                 "testing",
                 "xunit"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
+                "source": "https://github.com/sebastianbergmann/phpunit/tree/6.5.14"
+            },
             "time": "2019-02-01T05:22:47+00:00"
         },
         {
                 "mock",
                 "xunit"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues",
+                "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/5.0.10"
+            },
             "abandoned": true,
             "time": "2018-08-09T05:50:03+00:00"
         },
             ],
             "description": "Looks up which function or method a line of code belongs to",
             "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
+                "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2"
+            },
             "funding": [
                 {
                     "url": "https://github.com/sebastianbergmann",
                 "compare",
                 "equality"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/comparator/issues",
+                "source": "https://github.com/sebastianbergmann/comparator/tree/master"
+            },
             "time": "2018-02-01T13:46:46+00:00"
         },
         {
             "keywords": [
                 "diff"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/diff/issues",
+                "source": "https://github.com/sebastianbergmann/diff/tree/master"
+            },
             "time": "2017-08-03T08:09:46+00:00"
         },
         {
                 "environment",
                 "hhvm"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/environment/issues",
+                "source": "https://github.com/sebastianbergmann/environment/tree/master"
+            },
             "time": "2017-07-01T08:51:00+00:00"
         },
         {
             "name": "sebastian/exporter",
-            "version": "3.1.4",
+            "version": "3.1.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/exporter.git",
-                "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db"
+                "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db",
-                "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db",
+                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6",
+                "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6",
                 "shasum": ""
             },
             "require": {
                 "export",
                 "exporter"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/exporter/issues",
+                "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5"
+            },
             "funding": [
                 {
                     "url": "https://github.com/sebastianbergmann",
                     "type": "github"
                 }
             ],
-            "time": "2021-11-11T13:51:24+00:00"
+            "time": "2022-09-14T06:00:17+00:00"
         },
         {
             "name": "sebastian/global-state",
             "keywords": [
                 "global state"
             ],
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/global-state/issues",
+                "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0"
+            },
             "time": "2017-04-27T15:39:26+00:00"
         },
         {
             ],
             "description": "Traverses array structures and object graphs to enumerate all referenced objects",
             "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
+                "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4"
+            },
             "funding": [
                 {
                     "url": "https://github.com/sebastianbergmann",
             ],
             "description": "Allows reflection of object attributes, including inherited and non-public ones",
             "homepage": "https://github.com/sebastianbergmann/object-reflector/",
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
+                "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2"
+            },
             "funding": [
                 {
                     "url": "https://github.com/sebastianbergmann",
             ],
             "description": "Provides functionality to recursively process PHP variables",
             "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+                "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1"
+            },
             "funding": [
                 {
                     "url": "https://github.com/sebastianbergmann",
             ],
             "description": "Provides a list of PHP built-in functions that operate on resources",
             "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
+                "source": "https://github.com/sebastianbergmann/resource-operations/tree/master"
+            },
             "time": "2015-07-28T20:34:47+00:00"
         },
         {
             ],
             "description": "Library that helps with managing the version number of Git-hosted PHP projects",
             "homepage": "https://github.com/sebastianbergmann/version",
-            "time": "2016-10-03T07:35:21+00:00"
-        },
-        {
-            "name": "symfony/polyfill-ctype",
-            "version": "v1.24.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/symfony/polyfill-ctype.git",
-                "reference": "30885182c981ab175d4d034db0f6f469898070ab"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
-                "reference": "30885182c981ab175d4d034db0f6f469898070ab",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=7.1"
-            },
-            "provide": {
-                "ext-ctype": "*"
-            },
-            "suggest": {
-                "ext-ctype": "For best performance"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-main": "1.23-dev"
-                },
-                "thanks": {
-                    "name": "symfony/polyfill",
-                    "url": "https://github.com/symfony/polyfill"
-                }
+            "support": {
+                "issues": "https://github.com/sebastianbergmann/version/issues",
+                "source": "https://github.com/sebastianbergmann/version/tree/master"
             },
-            "autoload": {
-                "files": [
-                    "bootstrap.php"
-                ],
-                "psr-4": {
-                    "Symfony\\Polyfill\\Ctype\\": ""
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Gert de Pagter",
-                    "email": "BackEndTea@gmail.com"
-                },
-                {
-                    "name": "Symfony Community",
-                    "homepage": "https://symfony.com/contributors"
-                }
-            ],
-            "description": "Symfony polyfill for ctype functions",
-            "homepage": "https://symfony.com",
-            "keywords": [
-                "compatibility",
-                "ctype",
-                "polyfill",
-                "portable"
-            ],
-            "funding": [
-                {
-                    "url": "https://symfony.com/sponsor",
-                    "type": "custom"
-                },
-                {
-                    "url": "https://github.com/fabpot",
-                    "type": "github"
-                },
-                {
-                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
-                    "type": "tidelift"
-                }
-            ],
-            "time": "2021-10-20T20:35:02+00:00"
+            "time": "2016-10-03T07:35:21+00:00"
         },
         {
             "name": "theseer/tokenizer",
-            "version": "1.2.1",
+            "version": "1.2.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/theseer/tokenizer.git",
-                "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
+                "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
-                "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
+                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
+                "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
                 "shasum": ""
             },
             "require": {
                 }
             ],
             "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+            "support": {
+                "issues": "https://github.com/theseer/tokenizer/issues",
+                "source": "https://github.com/theseer/tokenizer/tree/1.2.2"
+            },
             "funding": [
                 {
                     "url": "https://github.com/theseer",
                     "type": "github"
                 }
             ],
-            "time": "2021-07-28T10:34:58+00:00"
+            "time": "2023-11-20T00:12:19+00:00"
         },
         {
             "name": "webmozart/assert",
-            "version": "1.10.0",
+            "version": "1.11.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/webmozarts/assert.git",
-                "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25"
+                "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25",
-                "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25",
+                "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991",
+                "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991",
                 "shasum": ""
             },
             "require": {
-                "php": "^7.2 || ^8.0",
-                "symfony/polyfill-ctype": "^1.8"
+                "ext-ctype": "*",
+                "php": "^7.2 || ^8.0"
             },
             "conflict": {
                 "phpstan/phpstan": "<0.12.20",
                 "check",
                 "validate"
             ],
-            "time": "2021-03-09T10:59:23+00:00"
+            "support": {
+                "issues": "https://github.com/webmozarts/assert/issues",
+                "source": "https://github.com/webmozarts/assert/tree/1.11.0"
+            },
+            "time": "2022-06-03T18:03:27+00:00"
         }
     ],
     "aliases": [],
     "prefer-lowest": false,
     "platform": [],
     "platform-dev": [],
-    "plugin-api-version": "1.1.0"
+    "plugin-api-version": "2.3.0"
 }
diff --git a/contrib/cleanup.sh b/contrib/cleanup.sh
new file mode 100755 (executable)
index 0000000..0dc5a86
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Cleans up all created files to start from scratch
+
+echo "$0: Cleaning up database ..."
+rm -f db/*/*.serial*
+rm -f db/*.cache
+
+echo "$0: All done."
+exit 0
index bb35a593ced262e6169c782b2805a25a40e8cfe1..d8153dfbad47de2f9875b0412935204b9cc07d09 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Really lame ...
-find */ -type f -print0 | xargs -0 sed -i 's/2022 Core/2022 Core/g'
+find */ -type f -print0 | xargs -0 sed -i 's/2023 Core/2023 Core/g'
diff --git a/db/.gitkeep b/db/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/db/.htaccess b/db/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/db/news/.gitkeep b/db/news/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/db/news/.htaccess b/db/news/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/docs/scrypt/CREDITS b/docs/scrypt/CREDITS
new file mode 100644 (file)
index 0000000..79c72e5
--- /dev/null
@@ -0,0 +1,2 @@
+scrypt
+Dominic Black
\ No newline at end of file
diff --git a/docs/scrypt/LICENSE b/docs/scrypt/LICENSE
new file mode 100644 (file)
index 0000000..381d3af
--- /dev/null
@@ -0,0 +1,15 @@
+Original Scrypt Implementation;
+  Copyright (c) 2009 Colin Percival
+
+PHP Module;
+  Copyright (c) 2012, Dominic Black
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/docs/scrypt/README.md b/docs/scrypt/README.md
new file mode 100644 (file)
index 0000000..fef282b
--- /dev/null
@@ -0,0 +1,90 @@
+PHP scrypt module
+=================
+
+[![Build Status](https://travis-ci.org/DomBlack/php-scrypt.svg?branch=master)](https://travis-ci.org/DomBlack/php-scrypt)
+
+This is a PHP library providing a wrapper to [Colin Percival's scrypt implementation](http://www.tarsnap.com/scrypt.html). Scrypt is a key derivation function designed to be far more secure against hardware brute-force attacks than alternative functions such as PBKDF2 or bcrypt.
+
+Details of the scrypt key derivation function are given in a paper by Colin Percival, Stronger Key Derivation via Sequential Memory-Hard Functions: [PDF](http://www.tarsnap.com/scrypt/scrypt-slides.pdf).
+
+An example class using this module can be found in; scrypt.php
+
+Join in!
+--------
+
+We are happy to receive bug reports, fixes, documentation enhancements, and other improvements.
+
+Please report bugs via the [github issue tracker](http://github.com/DomBlack/php-scrypt/issues).
+
+Master [git repository](https://github.com/DomBlack/php-scrypt):
+
+    git clone git://github.com/DomBlack/php-scrypt.git
+
+Authors
+-------
+
+This library is written and maintained by Dominic Black, <thephenix@gmail.com>.
+
+----
+
+PECL Install
+============
+
+This extension is now avaible through PECL.
+
+```
+pecl install scrypt
+```
+
+Build From Source
+=================
+
+Unix/OSX
+--------
+
+1. `phpize`
+2. If on OSX; `export CFLAGS='-arch i386 -arch x86_64'`
+3. `./configure --enable-scrypt`
+4. `make`
+5. `make install`
+6. Add the extension to your php.ini
+
+````
+    ; Enable scrypt extension module
+    extension=scrypt.so
+````
+
+Windows
+-------
+
+Using Visual Studio 2008 (or Visual C++ Express 2008) open up the attached project
+inside the VS2008 folder. This project assumes you have the PHP thread safe source at;
+`C:\phpsrcts\`, a PHP install at `C:\php\` and this source code extracted to
+`C:\php-scrypt\`.
+
+1. Build the project.
+2. Copy the resultant `scrypt.dll` to your ext directory in PHP.
+3. Add the extension to your php.ini
+
+````
+    ; Enable scrypt extension module
+    extension=scrypt.dll
+````
+
+Legal Stuff
+===========
+This works is licensed under the BSD 2-Clause license.
+
+Original Scrypt Implementation;
+ Copyright (c) 2009 Colin Percival
+
+PHP Module;
+ Copyright (c) 2012, Dominic Black
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
index 6c8493089742a7860a3cff49e881f7e7c979215b..b451b5eea294ae0aca1fa8e15b9d55c82fb91202 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 92dca68ecd641361c20ce12d787c618aa3174049..004b4c6fa87b1aefad2e04a915d72a44f9569dfb 100644 (file)
@@ -9,6 +9,7 @@ use Org\Mxchange\CoreFramework\Connector\Database\DatabaseConnector;
 use Org\Mxchange\CoreFramework\Console\Tools\ConsoleTools;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Localization\ManageableLanguage;
@@ -16,7 +17,6 @@ use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
@@ -31,7 +31,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -186,30 +186,36 @@ final class FrameworkBootstrap {
         */
        public static function isReachableFilePath (SplFileInfo $fileInstance) {
                // Is not reachable by default
+               //* NOISY-DEBUG: */ printf('[%s:%d]: fileInstance=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, get_class($fileInstance));
                $isReachable = false;
 
                // Get open_basedir parameter
                $openBaseDir = trim(ini_get('open_basedir'));
 
                // Is it set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: openBaseDir=%s' . PHP_EOL, __METHOD__, __LINE__, $openBaseDir);
                if (!empty($openBaseDir)) {
                        // Check all entries
                        foreach (explode(PATH_SEPARATOR, $openBaseDir) as $dir) {
                                // Check on existence
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: dir=%s' . PHP_EOL, __METHOD__, __LINE__, $dir);
                                if (substr($fileInstance->getPathname(), 0, strlen($dir)) == $dir) {
                                        // Is reachable
                                        $isReachable = true;
 
                                        // Abort lookup as it has been found in open_basedir
+                                       //* NOISY-DEBUG: */ printf('[%s:%d]: BREAK!' . PHP_EOL, __METHOD__, __LINE__);
                                        break;
                                }
                        }
                } else {
                        // If open_basedir is not set, all is allowed
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: All is allowed - BREAK!' . PHP_EOL, __METHOD__, __LINE__);
                        $isReachable = true;
                }
 
                // Return status
+               //* NOISY-DEBUG: */ printf('[%s:%d]: isReachable=%d - EXIT' . PHP_EOL, __METHOD__, __LINE__, intval($isReachable));
                return $isReachable;
        }
 
@@ -221,10 +227,8 @@ final class FrameworkBootstrap {
         * @return      $isReadable             Whether the file is readable (and therefor exists)
         */
        public static function isReadableFile (SplFileInfo $fileInstance) {
-               // Default is not readable
-               $isReadable = false;
-
                // Check if it is a file and readable
+               //* NOISY-DEBUG: */ printf('[%s:%d]: fileInstance=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, get_class($fileInstance));
                $isReadable = (
                        (
                                self::isReachableFilePath($fileInstance)
@@ -236,6 +240,7 @@ final class FrameworkBootstrap {
                );
 
                // Return status
+               //* NOISY-DEBUG: */ printf('[%s:%d]: isReadable=%d - EXIT!' . PHP_EOL, __METHOD__, __LINE__, intval($isReadable));
                return $isReadable;
        }
 
@@ -248,10 +253,16 @@ final class FrameworkBootstrap {
         */
        public static function loadInclude (SplFileInfo $fileInstance) {
                // Should be there ...
-               //* NOISY-DEBUG: */ printf('[%s:%d]: fileInstance=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $fileInstance);
+               //* NOISY-DEBUG: */ printf('[%s:%d]: fileInstance=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $fileInstance->__toString());
                if (!self::isReadableFile($fileInstance)) {
                        // Abort here
                        throw new InvalidArgumentException(sprintf('Cannot find fileInstance.pathname=%s.', $fileInstance->getPathname()));
+               } elseif (!$fileInstance->isFile()) {
+                       // Not a file
+                       throw new InvalidArgumentException(sprintf('fileInstance.pathname=%s is not a file', $fileInstance->getPathname()));
+               } elseif (substr($fileInstance->__toString(), -4, 4) != '.php') {
+                       // Not PHP script
+                       throw new InvalidArgumentException(sprintf('fileInstance.pathname=%s is not a PHP script', $fileInstance->getPathname()));
                }
 
                // Load it
@@ -300,6 +311,7 @@ final class FrameworkBootstrap {
                 * 1) Load class loader and scan framework classes, interfaces and
                 *    exceptions.
                 */
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                self::scanFrameworkClasses();
 
                /*
@@ -316,6 +328,9 @@ final class FrameworkBootstrap {
                 *    found, continue below with next step.
                 */
                self::validateApplicationParameter();
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -330,8 +345,10 @@ final class FrameworkBootstrap {
                 * Now check and load all files, found deprecated files will throw a
                 * warning at the user.
                 */
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::configAppIncludes()=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, count(self::$configAppIncludes));
                foreach (self::$configAppIncludes as $fileName => $status) {
                        // Construct file instance
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: fileName=%s,status=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName, $status);
                        $fileInstance = new SplFileInfo(sprintf('%s%s.php', self::getDetectedApplicationPath(), $fileName));
 
                        // Determine if this file is wanted/readable/deprecated
@@ -343,6 +360,7 @@ final class FrameworkBootstrap {
                                ApplicationEntryPoint::exitApplication(sprintf('File "%s.php" from application "%s" cannot be read. Please fix CHMOD.', $fileInstance->getBasename(), self::getDetectedApplicationName()));
                        } elseif (($status != 'required') && (!self::isReadableFile($fileInstance))) {
                                // Not found but optional/deprecated file, skip it
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: fileName=%s,status=%s - SKIPPED!' . PHP_EOL, __METHOD__, __LINE__, $fileName, $status);
                                continue;
                        }
 
@@ -356,6 +374,7 @@ final class FrameworkBootstrap {
                        }
 
                        // Load it
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking self::loadInclude(%s) ...' . PHP_EOL, __METHOD__, __LINE__, $fileInstance->__toString());
                        self::loadInclude($fileInstance);
                }
 
@@ -364,6 +383,9 @@ final class FrameworkBootstrap {
 
                // Scan for application's classes, exceptions and interfaces
                ClassLoader::scanApplicationClasses();
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -374,13 +396,15 @@ final class FrameworkBootstrap {
         */
        public static function startApplication () {
                // Is there an application helper instance?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $applicationInstance = call_user_func_array(
-                       array(
+                       [
                                'Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper', 'getSelfInstance'
-                       ), []
+                       ], []
                );
 
                // Some sanity checks
+               //* NOISY-DEBUG: */ printf('[%s:%d]: applicationInstance=%s' . PHP_EOL, __METHOD__, __LINE__, $applicationInstance->__toString());
                if ((empty($applicationInstance)) || (is_null($applicationInstance))) {
                        // Something went wrong!
                        ApplicationEntryPoint::exitApplication(sprintf('[Main:] The application <span class="app_name">%s</span> could not be launched because the helper class <span class="class_name">%s</span> is not loaded.',
@@ -401,23 +425,30 @@ final class FrameworkBootstrap {
                }
 
                // Now call all methods in one go
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Initializing application ...' . PHP_EOL, __METHOD__, __LINE__);
                foreach (['setupApplicationData', 'initApplication', 'launchApplication'] as $methodName) {
                        // Call method
-                       //*NOISY-DEBUG: */ printf('[%s:%d]: Calling methodName=%s ...' . PHP_EOL, __METHOD__, __LINE__, $methodName);
+                       //*NOISY-DEBUG: */ printf('[%s:%d]: Invoking methodName=%s ...' . PHP_EOL, __METHOD__, __LINE__, $methodName);
                        call_user_func([$applicationInstance, $methodName]);
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
         * Initializes database instance, no need to double-call this method
         *
         * @return      void
+        * @throws      BadMethodCallException  If this method was invoked twice
         */
        public static function initDatabaseInstance () {
                // Get application instance
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $applicationInstance = ApplicationHelper::getSelfInstance();
 
                // Is the database instance already set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::databaseInstance[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype(self::getDatabaseInstance()));
                if (self::getDatabaseInstance() instanceof DatabaseConnector) {
                        // Yes, then abort here
                        throw new BadMethodCallException('Method called twice.');
@@ -427,10 +458,14 @@ final class FrameworkBootstrap {
                $databaseInstance = ObjectFactory::createObjectByConfiguredName(self::getConfigurationInstance()->getConfigEntry('database_type') . '_class');
 
                // Prepare database instance
-               $connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getSelfInstance(), $databaseInstance);
+               $connectionInstance = DatabaseConnection::createDatabaseConnection($databaseInstance);
 
                // Set it in application helper
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Setting connectionInstance=%s ...' . PHP_EOL, __METHOD__, __LINE__, $connectionInstance->__toString());
                self::setDatabaseInstance($connectionInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -442,16 +477,20 @@ final class FrameworkBootstrap {
         */
        public static function detectServerAddress () {
                // Is the entry set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                if (!isset(self::$serverAddress)) {
                        // Is it set in $_SERVER?
                        if (!empty($_SERVER['SERVER_ADDR'])) {
                                // Set it from $_SERVER
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: Setting self::serverAddress=%s from SERVER_ADDR ...' . PHP_EOL, __METHOD__, __LINE__, $_SERVER['SERVER_ADDR']);
                                self::$serverAddress = $_SERVER['SERVER_ADDR'];
                        } elseif (isset($_SERVER['SERVER_NAME'])) {
                                // Resolve IP address
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: Resolving SERVER_NAME=%s ...' . PHP_EOL, __METHOD__, __LINE__, $_SERVER['SERVER_NAME']);
                                $serverIp = ConsoleTools::resolveIpAddress($_SERVER['SERVER_NAME']);
 
                                // Is it valid?
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: serverId[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($serverIp), $serverIp);
                                if ($serverIp === false) {
                                        /*
                                         * Why is gethostbyname() returning the host name and not
@@ -461,14 +500,17 @@ final class FrameworkBootstrap {
                                }
 
                                // Al fine, set it
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: Setting self::serverAddress=%s from resolver ...' . PHP_EOL, __METHOD__, __LINE__, $serverAddress);
                                self::$serverAddress = $serverIp;
                        } else {
                                // Run auto-detecting through console tools lib
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking ConsoleTools::acquireSelfIpAddress() ...' . PHP_EOL, __METHOD__, __LINE__);
                                self::$serverAddress = ConsoleTools::acquireSelfIpAddress();
                        }
                }
 
                // Return it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::serverAddress=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, self::$serverAddress);
                return self::$serverAddress;
        }
 
@@ -481,9 +523,10 @@ final class FrameworkBootstrap {
         */
        public static function setDefaultTimezone (string $timezone) {
                // Is it set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: timezone=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $timezone);
                if (empty($timezone)) {
                        // Entry is empty
-                       throw new InvalidArgumentException('timezone is empty');
+                       throw new InvalidArgumentException('Parameter "timezone" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Default success
@@ -496,6 +539,7 @@ final class FrameworkBootstrap {
                $success = date_default_timezone_set($timezone);
 
                // Return status
+               //* NOISY-DEBUG: */ printf('[%s:%d]: success=%d - EXIT!' . PHP_EOL, __METHOD__, __LINE__, intval($success));
                return $success;
        }
 
@@ -506,6 +550,7 @@ final class FrameworkBootstrap {
         * @todo        Test more fields
         */
        public static function isHttpSecured () {
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                return (
                        (
                                (
@@ -530,6 +575,7 @@ final class FrameworkBootstrap {
         */
        public static function detectBaseUrl () {
                // Initialize the URL
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $protocol = 'http';
 
                // Do we have HTTPS?
@@ -542,6 +588,7 @@ final class FrameworkBootstrap {
                $baseUrl = sprintf('%s://%s%s', $protocol, self::detectDomain(), self::detectScriptPath());
 
                // Return the URL
+               //* NOISY-DEBUG: */ printf('[%s:%d]: baseUrl=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, $baseUrl);
                return $baseUrl;
        }
 
@@ -552,6 +599,7 @@ final class FrameworkBootstrap {
         */
        public static function detectDomain () {
                // Full domain is localnet.invalid by default
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $fullDomain = 'localnet.invalid';
 
                // Is the server name there?
@@ -561,6 +609,7 @@ final class FrameworkBootstrap {
                }
 
                // Return it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: fullDomain=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, $fullDomain);
                return $fullDomain;
        }
 
@@ -572,6 +621,7 @@ final class FrameworkBootstrap {
         */
        public static function detectScriptPath () {
                // Default is empty
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $scriptPath = '';
 
                // Is the scriptname set?
@@ -581,6 +631,7 @@ final class FrameworkBootstrap {
                }
 
                // Return it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: scriptPath=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, $scriptPath);
                return $scriptPath;
        }
 
@@ -598,6 +649,7 @@ final class FrameworkBootstrap {
         */
        private static function scanFrameworkClasses () {
                // Include class loader
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                require self::getConfigurationInstance()->getConfigEntry('framework_base_path') . 'loader/class_ClassLoader.php';
 
                // Register auto-load function with the SPL
@@ -605,6 +657,9 @@ final class FrameworkBootstrap {
 
                // Scan for all framework classes, exceptions and interfaces
                ClassLoader::scanFrameworkClasses();
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -615,13 +670,16 @@ final class FrameworkBootstrap {
         */
        private static function determineRequestType () {
                // Determine request type
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $request = self::getRequestTypeFromSystem();
                $requestType = self::getRequestTypeFromSystem();
 
                // Create a new request object
+               //* NOISY-DEBUG: */ printf('[%s:%d]: request=%s,requestType=%s' . PHP_EOL, __METHOD__, __LINE__, $request, $requestType);
                $requestInstance = ObjectFactory::createObjectByName(sprintf('Org\Mxchange\CoreFramework\Request\%sRequest', StringUtils::convertToClassName($request)));
 
                // Remember request instance here
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Setting requestInstance=%s ...' . PHP_EOL, __METHOD__, __LINE__, $requestInstance->__toString());
                self::setRequestInstance($requestInstance);
 
                // Do we have another response?
@@ -632,10 +690,15 @@ final class FrameworkBootstrap {
                }
 
                // ... and a new response object
+               //* NOISY-DEBUG: */ printf('[%s:%d]: request=%s,requestType=%s - AFTER!' . PHP_EOL, __METHOD__, __LINE__, $request, $requestType);
                $responseInstance = ObjectFactory::createObjectByName(sprintf('Org\Mxchange\CoreFramework\Response\%sResponse', StringUtils::convertToClassName($request)));
 
                // Remember response instance here
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Setting responseInstance=%s ...' . PHP_EOL, __METHOD__, __LINE__, $responseInstance->__toString());
                self::setResponseInstance($responseInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -645,6 +708,7 @@ final class FrameworkBootstrap {
         */
        private static function validateApplicationParameter () {
                // Is the parameter set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                if (!self::getRequestInstance()->isRequestElementSet('app')) {
                        /*
                         * Don't continue here, the application 'selector' is no longer
@@ -658,12 +722,15 @@ final class FrameworkBootstrap {
                $applicationName = self::getRequestInstance()->getRequestElement('app');
 
                // Secure it, by keeping out tags
+               //* NOISY-DEBUG: */ printf('[%s:%d]: applicationName=%s' . PHP_EOL, __METHOD__, __LINE__, $applicationName);
                $applicationName = htmlentities(strip_tags($applicationName), ENT_QUOTES);
 
                // Secure it a little more with a reg.exp.
+               //* NOISY-DEBUG: */ printf('[%s:%d]: applicationName=%s' . PHP_EOL, __METHOD__, __LINE__, $applicationName);
                $applicationName = preg_replace('/([^a-z0-9_-])+/i', '', $applicationName);
 
                // Construct FQPN (Full-Qualified Path Name) for ApplicationHelper class
+               //* NOISY-DEBUG: */ printf('[%s:%d]: applicationName=%s' . PHP_EOL, __METHOD__, __LINE__, $applicationName);
                $applicationPath = sprintf(
                        '%s%s%s',
                        self::getConfigurationInstance()->getConfigEntry('application_base_path'),
@@ -673,14 +740,19 @@ final class FrameworkBootstrap {
 
                // Full path for application
                // Is the path there? This secures a bit the parameter (from untrusted source).
+               //* NOISY-DEBUG: */ printf('[%s:%d]: applicationPath=%s' . PHP_EOL, __METHOD__, __LINE__, $applicationPath);
                if ((!is_dir($applicationPath)) || (!is_readable($applicationPath))) {
                        // Not found or not readable
                        ApplicationEntryPoint::exitApplication(sprintf('Application "%s" not found.', $applicationName));
                }
 
                // Set the detected application's name and full path for later usage
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Setting applicationPath=%s,applicationName=%s' . PHP_EOL, __METHOD__, __LINE__, $applicationPath, $applicationName);
                self::$detectedApplicationPath = $applicationPath;
                self::$detectedApplicationName = $applicationName;
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
index 1daa27d5ab99a1526e425deabb2a6e0edc3d18f0..6f019d43673e53256ab40d01a3f63326b3bd3944 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -61,9 +61,6 @@ $cfg->setConfigEntry('raw_template_extension', '.tpl');
 // CFG: CODE-TEMPLATE-EXTENSION
 $cfg->setConfigEntry('code_template_extension', '.ctp');
 
-// CFG: SELECTOR-PATH
-$cfg->setConfigEntry('selector_path', 'selector');
-
 // CFG: TEMPLATE-BASE-PATH
 $cfg->setConfigEntry('tpl_base_path', 'templates/');
 
@@ -118,9 +115,6 @@ $cfg->setConfigEntry('output_class', 'Org\Mxchange\CoreFramework\Output\WebOutpu
 // CFG: LANGUAGE-SYSTEM-CLASS
 $cfg->setConfigEntry('language_system_class', 'Org\Mxchange\CoreFramework\Localization\LanguageSystem');
 
-// CFG: SELECTOR-TEMPLATE-PREFIX
-$cfg->setConfigEntry('tpl_selector_prefix', 'selector');
-
 // CFG: WEB-CONTENT-TYPE
 $cfg->setConfigEntry('web_content_type', 'text/html');
 
@@ -139,21 +133,6 @@ $cfg->setConfigEntry('meta_keywords', 'test,test,test');
 // CFG: META-DESCRIPTION
 $cfg->setConfigEntry('meta_description', 'A description for your website');
 
-// CFG: SELECTOR-MAIN-TEMPLATE
-$cfg->setConfigEntry('selector_main_tpl', 'selector_main');
-
-// CFG: SELECTOR-APPS-TEMPLATE
-$cfg->setConfigEntry('selector_apps_tpl', 'selector_apps');
-
-// CFG: SELECTOR-NAME
-$cfg->setConfigEntry('selector_name', 'selector');
-
-// CFG: DEFAULT-APPLICATION
-$cfg->setConfigEntry('default_application', 'selector');
-
-// CFG: VERBOSE-LEVEL
-$cfg->setConfigEntry('verbose_level', 0);
-
 // CFG: CACHE-CLASS
 $cfg->setConfigEntry('cache_class', 'Org\Mxchange\CoreFramework\Cache\Memory\MemoryCache');
 
@@ -277,9 +256,6 @@ $cfg->setConfigEntry('hash_extra_mask', '%1s:%2s:%3s'); // 1=salt, 2=extra salt,
 // CFG: HASH-NORMAL-MASK
 $cfg->setConfigEntry('hash_normal_mask', '%1s:%2s'); // 1=salt, 2=plain password/string
 
-// CFG: IS-SINGLE-SERVER
-$cfg->setConfigEntry('is_single_server', 'Y');
-
 // CFG: POST-REGISTRATION-CLASS
 $cfg->setConfigEntry('post_registration_class', 'Org\Mxchange\CoreFramework\Action\PostRegistration\Login\LoginAfterRegistrationAction');
 
@@ -301,12 +277,6 @@ $cfg->setConfigEntry('cookie_domain', FrameworkBootstrap::detectDomain()); // Is
 // CFG: COOKIE-SSL
 $cfg->setConfigEntry('cookie_ssl', FrameworkBootstrap::isHttpSecured());
 
-// CFG: CRYPT-FIXED-SALT
-$cfg->setConfigEntry('crypt_fixed_salt', 'N');
-
-// CFG: DB-UPDATE-PRIMARY-FORCED
-$cfg->setConfigEntry('db_update_primary_forced', 'Y');
-
 // CFG: GERMAN-DATE-TIME
 $cfg->setConfigEntry('german_date_time', "%3\$s.%2\$s.%1\$s, %4\$s:%5\$s:%6\$s");
 
@@ -331,12 +301,6 @@ $cfg->setConfigEntry('local_file_database_class', 'Org\Mxchange\CoreFramework\Da
 // CFG: COMPRESSOR-CHANNEL-CLASS
 $cfg->setConfigEntry('compressor_channel_class', 'Org\Mxchange\CoreFramework\Middleware\Compressor\CompressorChannel');
 
-// CFG: DEBUG-HTML-OUTPUT-TIMINGS
-$cfg->setConfigEntry('debug_html_output_timings', 'N');
-
-// CFG: DEBUG-CONSOLE-OUTPUT-TIMINGS
-$cfg->setConfigEntry('debug_console_output_timings', 'Y');
-
 // CFG: PROXY-HOST
 $cfg->setConfigEntry('proxy_host', '');
 
@@ -349,15 +313,9 @@ $cfg->setConfigEntry('proxy_username', '');
 // CFG: PROXY-PASSWORD
 $cfg->setConfigEntry('proxy_password', '');
 
-// CFG: PROXY-CONNECT-METHOD
-$cfg->setConfigEntry('proxy_connect_method', 'Y');
-
 // CFG: HOSTNAME-FILE
 $cfg->setConfigEntry('hostname_file', '/etc/hostname');
 
-// CFG: DATABASE-CACHE-ENABLED
-$cfg->setConfigEntry('database_cache_enabled', false);
-
 // CFG: DIRECTORY-CLASS
 $cfg->setConfigEntry('directory_class', 'Org\Mxchange\CoreFramework\Filesytem\Pointer\FrameworkDirectoryPointer');
 
@@ -379,18 +337,12 @@ $cfg->setConfigEntry('csv_input_file_class', 'Org\Mxchange\CoreFramework\Filesys
 // CFG: FILE-ITERATOR-CLASS
 $cfg->setConfigEntry('file_iterator_class', 'Org\Mxchange\CoreFramework\Iterator\File\FileIterator');
 
-// CFG: FILE-STACK-PRE-ALLOCATE-ENABLED
-$cfg->setConfigEntry('file_stack_pre_allocate_enabled', 'Y');
-
 // CFG: FILE-STACK-PRE-ALLOCATE-COUNT
 $cfg->setConfigEntry('file_stack_pre_allocate_count', 10000);
 
 // CFG: INDEX-INDEX-CLASS
 $cfg->setConfigEntry('file_stack_index_class', 'Org\Mxchange\CoreFramework\Index\File\Stack\FileStackIndex');
 
-// CFG: INDEX-PRE-ALLOCATE-ENABLED
-$cfg->setConfigEntry('index_pre_allocate_enabled', 'Y');
-
 // CFG: INDEX-PRE-ALLOCATE-COUNT
 $cfg->setConfigEntry('index_pre_allocate_count', 10000);
 
@@ -460,26 +412,89 @@ $cfg->setConfigEntry('extension_uuid_loaded', false);
 // CFG: REGISTRY-ITERATOR-CLASS
 $cfg->setConfigEntry('registry_iterator_class', 'Org\Mxchange\CoreFramework\Iterator\Registry\RegistryIterator');
 
-// CFG: QUIET-DNS-RESOLVER
-$cfg->setConfigEntry('quiet_dns_resolver', false);
-
 // CFG: THOUSANDS-SEPARATOR
 $cfg->setConfigEntry('thousands_separator', '.');
 
 // CFG: DECIMALS-SEPARATOR
 $cfg->setConfigEntry('decimals_separator', ',');
 
-// CFG: CRYPTO-MCRYPT-STREAM-CLASS
-$cfg->setConfigEntry('crypto_mcrypt_stream_class', 'Org\Mxchange\CoreFramework\Stream\Crypto\Mcrypt\McryptStream');
-
 // CFG: CRYPTO-OPENSSL-STREAM-CLASS
 $cfg->setConfigEntry('crypto_openssl_stream_class', 'Org\Mxchange\CoreFramework\Stream\Crypto\OpenSsl\OpenSslStream');
 
 // CFG: CRYPTO-NULL-STREAM-CLASS
 $cfg->setConfigEntry('crypto_null_stream_class', 'Org\Mxchange\CoreFramework\Stream\Crypto\Null\NullCryptoStream');
 
-// CFG: DEVELOPER-MODE-ENABLED
-$cfg->setConfigEntry('developer_mode_enabled', true);
-
 // CFG: CRYPTO-HASH-FUNCTION-NAME
 $cfg->setConfigEntry('crypto_hash_function_name', 'sha256');
+
+/**
+ * -------------------------------------------------------------
+ * Boolean is_*_enabled configuration keys
+ * -------------------------------------------------------------
+ */
+
+// CFG: IS-DEVELOPER-MODE-ENABLED
+$cfg->setConfigEntry('is_developer_mode_enabled', true);
+
+// CFG: IS-DATABASE-CACHE-ENABLED
+$cfg->setConfigEntry('is_database_cache_enabled', false);
+
+// CFG: IS-DEBUG-HTML-OUTPUT-TIMINGS-ENABLED
+$cfg->setConfigEntry('is_debug_html_output_timings_enabled', false);
+
+// CFG: IS-DEBUG-CONSOLE-OUTPUT-TIMINGS-ENABLED
+$cfg->setConfigEntry('is_debug_console_output_timings_enabled', true);
+
+// CFG: IS-REGISTER-EMAIL-UNIQUE-ENABLED
+$cfg->setConfigEntry('is_register_email_unique_enabled', true);
+
+// CFG: IS-BLOCK-SHOWS-REGISTRATION-ENABLED
+$cfg->setConfigEntry('is_block_shows_registration_enabled', true);
+
+// CFG: IS-REGISTER-REQUIRES-EMAIl-ENABLED
+$cfg->setConfigEntry('is_register_requires_email_enabled', true);
+
+// CFG: IS-REGISTER-INCLUDES-PROFILE-ENABLED
+$cfg->setConfigEntry('is_register_includes_profile_enabled', true);
+
+// CFG: IS-REGISTER-PERSONAL-DATA-ENABLED
+$cfg->setConfigEntry('is_register_personal_data_enabled', true);
+
+// CFG: IS-PROFILE-INCLUDES-BIRTHDAY-ENABLED
+$cfg->setConfigEntry('is_profile_includes_birthday_enabled', true);
+
+// CFG: IS-USER-LOGIN-ENABLED
+$cfg->setConfigEntry('is_user_login_enabled', true);
+
+// CFG: IS-GUEST-LOGIN-ENABLED
+$cfg->setConfigEntry('is_guest_login_enabled', true);
+
+// CFG: IS-EMAIL-CHANGE-CONFIRMATION-ENABLED
+$cfg->setConfigEntry('is_email_change_confirmation_enabled', true);
+
+// CFG: IS-EMAIL-CHANGE-ENABLED
+$cfg->setConfigEntry('is_email_change_enabled', true);
+
+// CFG: IS-REFILL-PAGE-ACTIVE-ENABLED
+$cfg->setConfigEntry('is_refill_page_active_enabled', true);
+
+// CFG: IS-PROXY-CONNECT-METHOD-ENABLED
+$cfg->setConfigEntry('is_proxy_connect_method_enabled', true);
+
+// CFG: IS-SINGLE-SERVER-ENABLED
+$cfg->setConfigEntry('is_single_server_enabled', true);
+
+// CFG: IS-CRYPT-FIXED-SALT-ENABLED
+$cfg->setConfigEntry('is_crypt_fixed_salt_enabled', false);
+
+// CFG: IS-DB-UPDATE-PRIMARY-FORCED-ENABLED
+$cfg->setConfigEntry('is_db_update_primary_forced_enabled', true);
+
+// CFG: IS-QUIET-DNS-RESOLVER-ENABLED
+$cfg->setConfigEntry('is_quiet_dns_resolver_enabled', false);
+
+// CFG: IS-FILE-STACK-PRE-ALLOCATE-ENABLED
+$cfg->setConfigEntry('is_file_stack_pre_allocate_enabled', true);
+
+// CFG: IS-INDEX-PRE-ALLOCATE-ENABLED
+$cfg->setConfigEntry('is_index_pre_allocate_enabled', true);
index 199b15b8b71f0db1a29022d58e0cc41daf47407c..98dd71b987dd6f63aa6d3cbed369b80da4332fb8 100644 (file)
@@ -7,12 +7,12 @@ namespace Org\Mxchange\CoreFramework\Configuration;
 use Org\Mxchange\CoreFramework\Configuration\NoConfigEntryException;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
-use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 // Import SPL stuff
 use \InvalidArgumentException;
+use \UnexpectedValueException;
 
 /**
  * A class for the configuration stuff implemented in a singleton design pattern
@@ -23,7 +23,7 @@ use \InvalidArgumentException;
  * @see                        ClassLoader
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            1.0.1
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -89,7 +89,7 @@ class FrameworkConfiguration implements Registerable {
                //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $configKey);
                if (empty($configKey)) {
                        // Entry is empty
-                       throw new InvalidArgumentException('Parameter "configKey" is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+                       throw new InvalidArgumentException('Parameter "configKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Is it set?
@@ -113,11 +113,11 @@ class FrameworkConfiguration implements Registerable {
                //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $configKey);
                if (empty($configKey)) {
                        // Entry is empty
-                       throw new InvalidArgumentException('Parameter "configKey" is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+                       throw new InvalidArgumentException('Parameter "configKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Convert dashes to underscore
-               $configKey = StringUtils::convertDashesToUnderscores($configKey);
+               $configKey = str_replace('-', '_', $configKey);
 
                // Is a valid configuration key provided?
                //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s - AFTER!' . PHP_EOL, __METHOD__, __LINE__, $configKey);
@@ -142,20 +142,20 @@ class FrameworkConfiguration implements Registerable {
         */
        public final function setConfigEntry (string $configKey, $configValue) {
                // Is a valid configuration key key provided?
-               //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s,configValue[]=%s' . PHP_EOL, __METHOD__, __LINE__, $configKey, gettype($configValue));
+               //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s,configValue[]=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $configKey, gettype($configValue));
                if (empty($configKey)) {
                        // Entry is empty
-                       throw new InvalidArgumentException('Parameter "configKey" is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+                       throw new InvalidArgumentException('Parameter "configKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ((is_array($configValue)) || (is_object($configValue)) || (is_resource($configValue))) {
                        // These cannot be set as this is not intended for configuration values, please use FrameworkArrayObject instead.
                        throw new InvalidArgumentException(sprintf('configValue[]=%s for configKey=%s is not supported.', gettype($configValue), $configKey), self::EXCEPTION_CONFIG_VALUE_TYPE_UNSUPPORTED);
                }
 
                // Cast to string
-               $configKey = StringUtils::convertDashesToUnderscores($configKey);
+               $configKey = str_replace('-', '_', $configKey);
 
                // Set the configuration value
-               //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s,configValue[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, $configKey, gettype($configValue), $configValue);
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Setting configKey=%s,configValue[%s]=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, $configKey, gettype($configValue), $configValue);
                self::$configData[$configKey] = $configValue;
        }
 
@@ -200,11 +200,11 @@ class FrameworkConfiguration implements Registerable {
                //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $configKey);
                if (empty($configKey)) {
                        // Entry is empty
-                       throw new InvalidArgumentException('Parameter "configKey" is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+                       throw new InvalidArgumentException('Parameter "configKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Convert dashes to underscore
-               $configKey = StringUtils::convertDashesToUnderscores($configKey);
+               $configKey = str_replace('-', '_', $configKey);
 
                // Is the configuration key there?
                //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s - AFTER!' . PHP_EOL, __METHOD__, __LINE__, $configKey);
@@ -221,6 +221,41 @@ class FrameworkConfiguration implements Registerable {
                //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
+       /**
+        * Checks if a configuration entry is_*_enabled set to 'Y'
+        *
+        * @param       $keyPart        Configuration to expand with is_$keyPart_enabled
+        * @return      $enabled        Whether it has been set to Y or N
+        * @throws      InvalidArgumentException        If a parameter is invalid
+        * @throws      UnexpectedValueException        If a returned value is of an unexpected type or value
+        */
+       public function isEnabled (string $keyPart) {
+               // Validate parameters
+               //* NOISY-DEBUG: */ printf('[%s:%d]: keyPart=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $keyPart);
+               if (empty($keyPart)) {
+                       // Entry is empty
+                       throw new InvalidArgumentException('Parameter "keyPart" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Construct final config key
+               $configKey = sprintf('is_%s_enabled', $keyPart);
+
+               // Get value from it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: configKey=%s' . PHP_EOL, __METHOD__, __LINE__, $configKey);
+               $isEnabled = $this->getConfigEntry($configKey);
+
+               // Is it Y/N?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: isEnabled[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($isEnabled));
+               if (!is_bool($isEnabled)) {
+                       // Throw exception
+                       throw new UnexpectedValueException(sprintf('isEnabled[]=%s is unexpected', gettype($isEnabled)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
+
+               // Return it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: isEnabled=%d - EXIT!' . PHP_EOL, __METHOD__, __LINE__, intval($isEnabled));
+               return $isEnabled;
+       }
+
        /**
         * Generates a code for hashes from this class
         *
@@ -268,7 +303,7 @@ class FrameworkConfiguration implements Registerable {
         */
        public final function getField (string $fieldName) {
                // The super interface "FrameworkInterface" requires this
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -280,7 +315,7 @@ class FrameworkConfiguration implements Registerable {
         */
        public function isFieldSet (string $fieldName) {
                // The super interface "FrameworkInterface" requires this
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 7f51e62e02316f8cca4679ec4ffcde7e60a35440..dd131b3000e02e68b155a9f8fa28691c5811f2d7 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
index ffb4c4368d852a3c7a296a82fe183c3b4f889639..3f4422cd291a5c5864ffd61defac14b9fe2fdf29 100644 (file)
@@ -4,19 +4,21 @@ namespace Org\Mxchange\CoreFramework\Loader;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 
 // Import SPL stuff
 use \InvalidArgumentException;
 use \RecursiveDirectoryIterator;
 use \RecursiveIteratorIterator;
 use \SplFileInfo;
+use \UnexpectedValueException;
 
 /**
  * This class loads class include files with a specific prefix and suffix
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            1.6.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @version            1.7.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -34,6 +36,10 @@ use \SplFileInfo;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  * ----------------------------------
+ * 1.7.0
+ *  - "Cached" more like config instance and root/application base path for
+ *    shorter call stacks and lesser methods invoked
+ *  - More debug logging
  * 1.6.0
  *  - This class loader is now 100% singleton, no other instance is really
  *    required, therefore the factory method can be removed safely
@@ -67,9 +73,14 @@ final class ClassLoader {
        private static $selfInstance = NULL;
 
        /**
-        * Cached configuration entry 'developer_mode_enabled'
+        * Instance of a FrameworkConfiguration class
         */
-       private static $developerModeEnabled = false;
+       private static $configInstance = NULL;
+
+       /**
+        * Cached configuration entry 'is_developer_mode_enabled'
+        */
+       private static $developerModeEnabled = NULL;
 
        /**
         * Array with all valid but pending for loading file names (class,
@@ -150,6 +161,11 @@ final class ClassLoader {
         */
        private static $testPaths = [];
 
+       /**
+        * Cached includes that needs to be flushed
+        */
+       private $flushCache = [];
+
        /**
         * The protected constructor. Please use the factory method below, or use
         * getSelfInstance() for singleton
@@ -157,8 +173,18 @@ final class ClassLoader {
         * @return      void
         */
        private function __construct () {
-               // Cache config entry
-               self::$developerModeEnabled = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled');
+               // Is developerModeEnabled set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CONSTRUCTED!' . PHP_EOL, __METHOD__, __LINE__);
+               if (is_null(self::$developerModeEnabled)) {
+                       // Cache config instance
+                       self::$configInstance = FrameworkBootstrap::getConfigurationInstance();
+
+                       // Cache config entry
+                       self::$developerModeEnabled = self::$configInstance->isEnabled('developer_mode');
+               }
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::developerModeEnabled=%d - EXIT!' . PHP_EOL, __METHOD__, __LINE__, intval(self::$developerModeEnabled));
        }
 
        /**
@@ -168,41 +194,67 @@ final class ClassLoader {
         */
        public function __destruct () {
                // Skip here if dev-mode
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::developerModeEnabled=%d - DESTRUCTED!' . PHP_EOL, __METHOD__, __LINE__, intval(self::$developerModeEnabled));
                if (self::$developerModeEnabled) {
+                       // Is enabled, don't cache
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Developer mode enabled, not caching classes - EXIT!' . PHP_EOL, __METHOD__, __LINE__);
                        return;
                }
 
+               // Init content
+               $cacheContent = '';
+
                // Skip here if already cached
+               //* NOISY-DEBUG: */ printf('[%s:%d]: this->listCached=%d' . PHP_EOL, __METHOD__, __LINE__, intval($this->listCached));
                if ($this->listCached === false) {
                        // Writes the cache file of our list away
                        $cacheContent = json_encode($this->pendingFiles);
 
                        // Open cache instance
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: cacheContent()=%d' . PHP_EOL, __METHOD__, __LINE__, strlen($cacheContent));
                        $fileObject = $this->listCacheFile->openFile('w');
 
                        // And write whole list
                        $fileObject->fwrite($cacheContent);
+
+                       // Close it
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Closing file %s ...' . PHP_EOL, __METHOD__, __LINE__, $fileObject->getPathName());
+                       unset($fileObject);
                }
 
+               // Init content
+               $cacheContent = '';
+
                // Skip here if already cached
+               //* NOISY-DEBUG: */ printf('[%s:%d]: this->classesCached=%d' . PHP_EOL, __METHOD__, __LINE__, intval($this->classesCached));
                if ($this->classesCached === false) {
                        // Generate a full-cache of all classes
-                       $cacheContent = '';
-                       foreach (array_keys($this->loadedClasses) as $fileInstance) {
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: this->flushCache()=%d' . PHP_EOL, __METHOD__, __LINE__, count($this->flushCache));
+                       foreach ($this->flushCache as $key => $fileInstance) {
                                // Open file
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: key=%s,fileInstance[]=%s' . PHP_EOL, __METHOD__, __LINE__, $key, gettype($fileInstance));
                                $fileObject = $fileInstance->openFile('r');
 
                                // Load the file
                                // @TODO Add some uglifying code (compress) here
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: Adding fileInstance->size=%d bytes ...' . PHP_EOL, __METHOD__, __LINE__, $fileInstance->getSize());
                                $cacheContent .= $fileObject->fread($fileInstance->getSize());
                        }
 
                        // Open file
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: cacheContent()=%d' . PHP_EOL, __METHOD__, __LINE__, strlen($cacheContent));
                        $fileObject = $this->classCacheFile->openFile('w');
 
                        // And write it away
                        $fileObject->fwrite($cacheContent);
+
+                       // Close it
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Closing file %s ...' . PHP_EOL, __METHOD__, __LINE__, $fileObject->getPathName());
+                       unset($fileObject);
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -216,8 +268,7 @@ final class ClassLoader {
                $loaderInstance = self::getSelfInstance();
 
                // "Cache" configuration instance and framework base path
-               $configInstance = FrameworkBootstrap::getConfigurationInstance();
-               $frameworkBasePath = $configInstance->getConfigEntry('framework_base_path');
+               $frameworkBasePath = self::$configInstance->getConfigEntry('framework_base_path');
 
                // Load all classes
                //* NOISY-DEBUG: */ printf('[%s:%d]: frameworkBasePath=%s,self::$frameworkPaths()=%d,' . PHP_EOL, __METHOD__, __LINE__, $frameworkBasePath, count(self::$frameworkPaths));
@@ -254,71 +305,47 @@ final class ClassLoader {
         * Scans for application's classes, etc.
         *
         * @return      void
+        * @throws      UnexpectedValueException        If a given path isn't one or not readable
         */
        public static function scanApplicationClasses () {
                // Get loader instance
                //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $loaderInstance = self::getSelfInstance();
 
-               // "Cache" configuration instance
-               $configInstance = FrameworkBootstrap::getConfigurationInstance();
+               // "Cache" application base path
+               $basePath = self::$configInstance->getConfigEntry('application_base_path');
 
                // Load all classes for the application
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::frameworkPaths()=%d,basePath=%s' . PHP_EOL, __METHOD__, __LINE__, count(self::$frameworkPaths), $basePath);
                foreach (self::$frameworkPaths as $shortPath) {
                        // Create path name
                        //* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
-                       $pathName = realpath(sprintf(
+                       $realPathName = realpath(sprintf(
                                '%s%s%s%s%s',
-                               $configInstance->getConfigEntry('application_base_path'),
+                               $basePath,
                                DIRECTORY_SEPARATOR,
                                FrameworkBootstrap::getDetectedApplicationName(),
                                DIRECTORY_SEPARATOR,
                                $shortPath
                        ));
 
-                       // Is the path readable?
-                       //* NOISY-DEBUG: */ printf('[%s:%d]: pathName[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($pathName), $pathName);
-                       if (is_dir($pathName)) {
-                               // Try to load the application classes
-                               $loaderInstance->scanClassPath($pathName);
-                       }
-               }
-
-               // Trace message
-               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
-       }
-
-       /**
-        * Scans for test classes, etc.
-        *
-        * @return      void
-        */
-       public static function scanTestsClasses () {
-               // "Cache" configuration instance
-               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
-               $configInstance = FrameworkBootstrap::getConfigurationInstance();
-
-               // Load all classes for the application
-               foreach (self::$testPaths as $shortPath) {
-                       // Construct path name
-                       //* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
-                       $pathName = sprintf(
-                               '%s%s%s',
-                               $configInstance->getConfigEntry('root_base_path'),
-                               DIRECTORY_SEPARATOR,
-                               $shortPath
-                       );
-
-                       // Try to find it
-                       //* NOISY-DEBUG: */ printf('[%s:%d]: pathName[%s]=%s - BEFORE!' . PHP_EOL, __METHOD__, __LINE__, gettype($pathName), $pathName);
-                       $realPathName = realpath($pathName);
-
                        // Is the path readable?
                        //* NOISY-DEBUG: */ printf('[%s:%d]: realPathName[%s]=%s - AFTER!' . PHP_EOL, __METHOD__, __LINE__, gettype($realPathName), $realPathName);
-                       if ((is_dir($realPathName)) && (is_readable($realPathName))) {
-                               // Try to load the application classes
-                               ClassLoader::getSelfInstance()->scanClassPath($realPathName);
+                       if (!is_string($realPathName)) {
+                               // Skip this cone
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: realPathName[]=%s - SKIPPED!' . PHP_EOL, __METHOD__, __LINE__, gettype($realPathName));
+                               continue;
+                       } elseif (!is_dir($realPathName)) {
+                               // Is not a directory
+                               throw new UnexpectedValueException(sprintf('realPathName=%s is not a directory', $realPathName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+                       } elseif (!is_readable($realPathName)) {
+                               // Not readable
+                               throw new UnexpectedValueException(sprintf('realPathName=%s cannot be read from', $realPathName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                        }
+
+                       // Try to load the application classes
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Scanning for classes/interfaces at realPathName=%s ...' . PHP_EOL, __METHOD__, __LINE__, $realPathName);
+                       $loaderInstance->scanClassPath($realPathName);
                }
 
                // Trace message
@@ -335,29 +362,6 @@ final class ClassLoader {
                self::$strictNamingConvention = $strictNamingConvention;
        }
 
-       /**
-        * Registeres given relative path where test classes reside. For regular
-        * framework uses, they should not be loaded (and used).
-        *
-        * @param       $relativePath   Relative path to test classes
-        * @return      void
-        * @throws      InvalidArgumentException        If a parameter is invalid
-        */
-       public static function registerTestsPath (string $relativePath) {
-               // Validate parameter
-               if (empty($relativePath)) {
-                       // Should not be empty
-                       throw new InvalidArgumentException('Parameter "relativePath" is empty');
-               }
-
-               // "Register" it
-               //* NOISY-DEBUG: */ printf('[%s:%d]: relativePath=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $relativePath);
-               self::$testPaths[$relativePath] = $relativePath;
-
-               // Trace message
-               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
-       }
-
        /**
         * Autoload-function
         *
@@ -370,20 +374,21 @@ final class ClassLoader {
                //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
                if (empty($className)) {
                        // Should not be empty
-                       throw new InvalidArgumentException('Parameter "className" is empty');
+                       throw new InvalidArgumentException('Parameter "className" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // The class name MUST be at least Tld\Domain\Project\Package\SomeFooBar so split at them
                $classNameParts = explode("\\", $className);
 
                // At least 3 parts should be there
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::strictNamingConvention=%d,classNameParts()=%d' . PHP_EOL, __METHOD__, __LINE__, intval(self::$strictNamingConvention), count($classNameParts));
                if ((self::$strictNamingConvention === true) && (count($classNameParts) < 5)) {
                        // Namespace scheme is: Tld\Domain\Project\Package[\SubPackage...]
                        throw new InvalidArgumentException(sprintf('Class name "%s" is not conform to naming-convention: Tld\Domain\Project\Package[\SubPackage...]\SomeFooBar', $className));
                }
 
                // Try to include this class
-               //* NOISY-DEBUG: */ printf('[%s:%d]: Calling self->loadClassFile(%s) ...' . PHP_EOL, __METHOD__, __LINE__, $className);
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking self->loadClassFile(%s) ...' . PHP_EOL, __METHOD__, __LINE__, $className);
                self::getSelfInstance()->loadClassFile($className);
 
                // Trace message
@@ -397,13 +402,16 @@ final class ClassLoader {
         */
        public static final function getSelfInstance () {
                // Is the instance there?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::selfInstance[]=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, gettype(self::$selfInstance));
                if (is_null(self::$selfInstance)) {
                        // Get a new one and initialize it
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Initializing class loader ...' . PHP_EOL, __METHOD__, __LINE__);
                        self::$selfInstance = new ClassLoader();
                        self::$selfInstance->initClassLoader();
                }
 
                // Return the instance
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::selfInstance=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, get_class(self::$selfInstance));
                return self::$selfInstance;
        }
 
@@ -424,7 +432,7 @@ final class ClassLoader {
        public function getPrintableIncludeList () {
                // Prepare the list
                $includeList = '';
-               foreach ($this->loadedClasses as $classFile) {
+               foreach (array_keys($this->loadedClasses) as $classFile) {
                        $includeList .= basename($classFile) . '<br />' . PHP_EOL;
                }
 
@@ -445,7 +453,7 @@ final class ClassLoader {
                //* NOISY-DEBUG: */ printf('[%s:%d] basePath=%s,ignoreList()=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $basePath, count($ignoreList));
                if (empty($basePath)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "basePath" is empty');
+                       throw new InvalidArgumentException('Parameter "basePath" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->listCached === true) {
                        // Abort here
                        //* NOISY-DEBUG: */ printf('[%s:%d] this->listCache=true - EXIT!' . PHP_EOL, __METHOD__, __LINE__);
@@ -460,16 +468,13 @@ final class ClassLoader {
                 * should be used here so is_dir(), is_file() and so on will always
                 * find the correct files and dirs.
                 */
-               $basePath2 = realpath($basePath);
+               $basePath = realpath($basePath);
 
                // If the basePath is false it is invalid
-               //* NOISY-DEBUG: */ printf('[%s:%d] basePath2[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($basePath2), $basePath2);
-               if ($basePath2 === false) {
+               //* NOISY-DEBUG: */ printf('[%s:%d] basePath[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($basePath), $basePath);
+               if (!is_string($basePath)) {
                        /* @TODO: Do not exit here. */
                        exit(__METHOD__ . ': Cannot read ' . $basePath . ' !' . PHP_EOL);
-               } else {
-                       // Set base path
-                       $basePath = $basePath2;
                }
 
                // Get a new iterator
@@ -482,9 +487,11 @@ final class ClassLoader {
                        $currentEntry = $iteratorInstance->current();
 
                        // Get filename from iterator which is the class' name (according naming-convention)
+                       //* NOISY-DEBUG: */ printf('[%s:%d] currentEntry=%s,currentEntry->size=%d' . PHP_EOL, __METHOD__, __LINE__, $currentEntry->__toString(), $currentEntry->getSize());
                        $fileName = $currentEntry->getFilename();
 
                        // Current entry must be a file, not smaller than 100 bytes and not on ignore list
+                       //* NOISY-DEBUG: */ printf('[%s:%d] fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
                        if (!$currentEntry->isFile() || isset($this->ignoreList[$fileName]) || $currentEntry->getSize() < 100) {
                                // Advance to next entry
                                $iteratorInstance->next();
@@ -520,28 +527,33 @@ final class ClassLoader {
         * @return      void
         */
        private function initClassLoader () {
-               // Construct the FQFN for the cache
-               if (!self::$developerModeEnabled) {
-                       // Init cache instances
-                       $this->listCacheFile  = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . 'list-' . FrameworkBootstrap::getDetectedApplicationName() . '.cache');
-                       $this->classCacheFile = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . 'class-' . FrameworkBootstrap::getDetectedApplicationName() . '.cache');
-               }
-
                // Set suffix and prefix from configuration
-               $this->suffix = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('class_suffix');
-               $this->prefix = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('class_prefix');
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+               $this->suffix = self::$configInstance->getConfigEntry('class_suffix');
+               $this->prefix = self::$configInstance->getConfigEntry('class_prefix');
 
                // Set own instance
+               //* NOISY-DEBUG: */ printf('[%s:%d]: this->suffix=%s,this->prefix=%s' . PHP_EOL, __METHOD__, __LINE__, $this->suffix, $this->prefix);
                self::$selfInstance = $this;
 
                // Skip here if no dev-mode
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::developerModeEnabled=%d' . PHP_EOL, __METHOD__, __LINE__, intval(self::$developerModeEnabled));
                if (self::$developerModeEnabled) {
+                       // Developer mode is enabled
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Developer mode is enabled - EXIT!' . PHP_EOL, __METHOD__, __LINE__);
                        return;
                }
 
+               // Init cache instances
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Initializing cache file instances ...' . PHP_EOL, __METHOD__, __LINE__);
+               $this->listCacheFile  = new SplFileInfo(self::$configInstance->getConfigEntry('local_database_path') . 'list-' . FrameworkBootstrap::getDetectedApplicationName() . '.cache');
+               $this->classCacheFile = new SplFileInfo(self::$configInstance->getConfigEntry('local_database_path') . 'class-' . FrameworkBootstrap::getDetectedApplicationName() . '.cache');
+
                // Is the cache there?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Checking this->listCacheFile=%s ...' . PHP_EOL, __METHOD__, __LINE__, $this->listCacheFile);
                if (FrameworkBootstrap::isReadableFile($this->listCacheFile)) {
                        // Load and convert it
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Loading %s ...' . PHP_EOL, __METHOD__, __LINE__, $this->listCacheFile);
                        $this->pendingFiles = json_decode(file_get_contents($this->listCacheFile->getPathname()));
 
                        // List has been restored from cache!
@@ -549,13 +561,18 @@ final class ClassLoader {
                }
 
                // Does the class cache exist?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Checking this->classCacheFile=%s ...' . PHP_EOL, __METHOD__, __LINE__, $this->classCacheFile);
                if (FrameworkBootstrap::isReadableFile($this->classCacheFile)) {
                        // Then include it
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking FrameworkBootstrap::loadInclude(%s) ...' . PHP_EOL, __METHOD__, __LINE__, $this->classCacheFile);
                        FrameworkBootstrap::loadInclude($this->classCacheFile);
 
                        // Mark the class cache as loaded
                        $this->classesCached = true;
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -569,16 +586,19 @@ final class ClassLoader {
         */
        private function loadClassFile (string $className) {
                // The class name should contain at least 2 back-slashes, so split at them
-               //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
+               //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
                $classNameParts = explode("\\", $className);
 
                // Get last element
+               //* NOISY-DEBUG: */ printf('[%s:%d]: classNameParts()=%d' . PHP_EOL, __METHOD__, __LINE__, count($classNameParts));
                $shortClassName = array_pop($classNameParts);
 
                // Create a name with prefix and suffix
+               //* NOISY-DEBUG: */ printf('[%s:%d]: this->prefix=%s,shortClassName=%s,this->suffix=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $this->prefix, $shortClassName, $this->suffix);
                $fileName = sprintf('%s%s%s', $this->prefix, $shortClassName, $this->suffix);
 
                // Now look it up in our index
+               //* DEBUG-DIE: */ die(sprintf('[%s:%d]: this->pendingFiles=%s', __METHOD__, __LINE__, print_r($this->pendingFiles, TRUE)));
                //* NOISY-DEBUG: */ printf('[%s:%d] ISSET: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
                if ((isset($this->pendingFiles[$fileName])) && (!isset($this->loadedClasses[$this->pendingFiles[$fileName]->getPathname()]))) {
                        // File is found and not loaded so load it only once
@@ -590,18 +610,21 @@ final class ClassLoader {
                        $this->total++;
 
                        // Mark this class as loaded for other purposes than loading it.
+                       //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: fileName=%s marked as loaded ...' . PHP_EOL, __METHOD__, __LINE__, $fileName);
                        $this->loadedClasses[$this->pendingFiles[$fileName]->getPathname()] = true;
 
-                       // Remove it from classes list so it won't be found twice.
-                       //* NOISY-DEBUG: */ printf('[%s:%d] UNSET: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-                       unset($this->pendingFiles[$fileName]);
-
                        // Developer mode excludes caching (better debugging)
+                       //* NOISY-DEBUG: */ printf('[%s:%d] self::developerModeEnabled=%d' . PHP_EOL, __METHOD__, __LINE__, intval(self::$developerModeEnabled));
                        if (!self::$developerModeEnabled) {
-                               // Reset cache
-                               //* NOISY-DEBUG: */ printf('[%s:%d] classesCached=false' . PHP_EOL, __METHOD__, __LINE__);
+                               // Reset cache and mark file for flushing
+                               //* NOISY-DEBUG: */ printf('[%s:%d] Setting this->classesCached=false ...' . PHP_EOL, __METHOD__, __LINE__);
                                $this->classesCached = false;
+                               $this->flushCache[$fileName] = $this->pendingFiles[$fileName];
                        }
+
+                       // Remove it from classes list so it won't be found twice.
+                       //* NOISY-DEBUG: */ printf('[%s:%d] UNSET: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
+                       unset($this->pendingFiles[$fileName]);
                } else {
                        // Not found
                        //* NOISY-DEBUG: */ printf('[%s:%d] 404: fileName=%s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
index 816f474033d7af8b9bc5a4ef82280bcb85cd92dc..80eefba526d1ba3fb83526a59478a15ad57c2290 100644 (file)
@@ -4,13 +4,14 @@ namespace Org\Mxchange\CoreFramework\Action\!!!;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Action\BaseAction;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * An action for ???
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -60,7 +61,7 @@ class ???Action extends BaseAction implements Commandable {
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub("You have to implement me.");
+               DebugMiddleware::getSelfInstance()->partialStub("You have to implement me.");
        }
 
 }
index bd3049f9f2e06d1d2e7697c6cd065bf6e4d12848..33e995ab1c501255a52116fcb107a7dacc199e57 100644 (file)
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Traits\Resolver\ResolverTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f8f8337b0fcc0e8b913693fc2c2bdb8ec919d153..36e73d9c5ce24bae03d0931e7b7babc1ae3156ea 100644 (file)
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -52,12 +52,14 @@ class HtmlLoginProfileAction extends BaseAction implements PerformableAction, Re
         */
        public static final function createHtmlLoginProfileAction (ActionResolver $resolverInstance) {
                // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('HTML-LOGIN-PROFILE-ACTION: resolverInstance=%s - CALLED!', $resolverInstance->__toString()));
                $actionInstance = new HtmlLoginProfileAction();
 
                // Set the resolver instance
                $actionInstance->setResolverInstance($resolverInstance);
 
                // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('HTML-LOGIN-PROFILE-ACTION: actionInstance=%s - EXIT!', $actionInstance->__toString()));
                return $actionInstance;
        }
 
@@ -70,6 +72,7 @@ class HtmlLoginProfileAction extends BaseAction implements PerformableAction, Re
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Dummy method
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('HTML-LOGIN-PROFILE-ACTION: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
        }
 
        /**
@@ -81,7 +84,11 @@ class HtmlLoginProfileAction extends BaseAction implements PerformableAction, Re
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Add user status filter here
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('HTML-LOGIN-PROFILE-ACTION: controllerInstance=%s,requestInstance=%s - CALLED!', $controllerInstance->__toString(), $requestInstance->__toString()));
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter_class'));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('HTML-LOGIN-PROFILE-ACTION: EXIT!');
        }
 
 }
index abb69709801a249ade7f909492b1f7acd5128d64..6868102faead7cd7ca062227b02408f7aeee328d 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -49,9 +49,11 @@ class LoginAfterRegistrationAction extends BaseAction implements PerformableActi
         */
        public static final function createLoginAfterRegistrationAction () {
                // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('LOGIN-REGISTRATION-ACTION: CALLED!');
                $actionInstance = new LoginAfterRegistrationAction();
 
                // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('LOGIN-REGISTRATION-ACTION: actionInstance=%s - EXIT!', $actionInstance->__toString()));
                return $actionInstance;
        }
 
@@ -64,6 +66,7 @@ class LoginAfterRegistrationAction extends BaseAction implements PerformableActi
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a login class from factory
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('LOGIN-REGISTRATION-ACTION: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $loginInstance = LoginFactory::createLoginObjectByRequest($requestInstance);
 
                // Login the user by the request instance
@@ -86,6 +89,9 @@ class LoginAfterRegistrationAction extends BaseAction implements PerformableActi
                        // Attach error message to the response
                        $responseInstance->addFatalMessage('failed_login_after_registration');
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('LOGIN-REGISTRATION-ACTION: EXIT!');
        }
 
 }
index f187b18fce5b39b59c9a80480af6c9db87ff9da4..59c2c662a33b14106c9a8d96af66a1a36e638615 100644 (file)
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 003ca8a2e4f778b9cec028f443be7b20d818d405..e14fd5df23344b23488149e7381afed152a54df1 100644 (file)
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index ffac7ff097908b1843a56c54d8bd3b1840ab656a..2294ba7e726203a33a24fd72b977a952c583b56f 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\ObjectArray\FrameworkArrayObject;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Rename to InProgressCache
index 824dfece060315ede7cb4d8d550859ba6bf465e4..c2700e48871bd085e3ae5ce9d2591ff41b23326d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6bff46dae16665edda6058c30b3a289f5a65c567..2741ceeac6ee423ac81002fd314f6513283570fa 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 36e7bd6b64d49a8103407e060403f212fe29a2e5..2200b370ec90173a227b73debde5ec609f77954e 100644 (file)
@@ -15,17 +15,18 @@ use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Result\Database\CachedDatabaseResult;
 use Org\Mxchange\CoreFramework\State\Stateable;
 use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 // Import SPL stuff
-use \stdClass;
+use \BadMethodCallException;
 use \InvalidArgumentException;
 use \ReflectionClass;
 use \SplFileInfo;
+use \stdClass;
 
 /**
  * The simulator system class is the super class of all other classes. This
@@ -33,7 +34,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -56,6 +57,11 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         */
        private static $selfInstance = NULL;
 
+       /**
+        * Debug instance
+        */
+       private static $debugInstance = NULL;
+
        /**
         * Stub methods
         */
@@ -85,7 +91,6 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         ***********************/
 
        // @todo Try to clean these constants up
-       const EXCEPTION_IS_NULL_POINTER              = 0x001;
        const EXCEPTION_IS_NO_OBJECT                 = 0x002;
        const EXCEPTION_IS_NO_ARRAY                  = 0x003;
        const EXCEPTION_MISSING_METHOD               = 0x004;
@@ -112,7 +117,6 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
        const EXCEPTION_DIR_POINTER_INVALID          = 0x019;
        const EXCEPTION_FILE_POINTER_INVALID         = 0x01a;
        const EXCEPTION_INVALID_RESOURCE             = 0x01b;
-       const EXCEPTION_UNEXPECTED_OBJECT            = 0x01c;
        const EXCEPTION_LIMIT_ELEMENT_IS_UNSUPPORTED = 0x01d;
        const EXCEPTION_GETTER_IS_MISSING            = 0x01e;
        const EXCEPTION_ARRAY_EXPECTED               = 0x01f;
@@ -130,24 +134,22 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
        const EXCEPTION_ATTRIBUTES_ARE_MISSING       = 0x02b;
        const EXCEPTION_ARRAY_ELEMENTS_MISSING       = 0x02c;
        const EXCEPTION_TEMPLATE_ENGINE_UNSUPPORTED  = 0x02d;
-       const EXCEPTION_UNSPPORTED_OPERATION         = 0x02e;
-       const EXCEPTION_FACTORY_REQUIRE_PARAMETER    = 0x02f;
-       const EXCEPTION_MISSING_ELEMENT              = 0x030;
-       const EXCEPTION_HEADERS_ALREADY_SENT         = 0x031;
-       const EXCEPTION_DEFAULT_CONTROLLER_GONE      = 0x032;
-       const EXCEPTION_CLASS_NOT_FOUND              = 0x033;
-       const EXCEPTION_REQUIRED_INTERFACE_MISSING   = 0x034;
-       const EXCEPTION_FATAL_ERROR                  = 0x035;
-       const EXCEPTION_FILE_NOT_FOUND               = 0x036;
-       const EXCEPTION_ASSERTION_FAILED             = 0x037;
-       const EXCEPTION_FILE_NOT_REACHABLE           = 0x038;
-       const EXCEPTION_FILE_CANNOT_BE_READ          = 0x039;
-       const EXCEPTION_FILE_CANNOT_BE_WRITTEN       = 0x03a;
-       const EXCEPTION_PATH_CANNOT_BE_WRITTEN       = 0x03b;
-       const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x03c;
-       const EXCEPTION_FILTER_CHAIN_INTERCEPTED     = 0x03d;
-       const EXCEPTION_INVALID_SOCKET               = 0x03e;
-       const EXCEPTION_SELF_INSTANCE                = 0x03f;
+       const EXCEPTION_FACTORY_REQUIRE_PARAMETER    = 0x02e;
+       const EXCEPTION_MISSING_ELEMENT              = 0x02f;
+       const EXCEPTION_HEADERS_ALREADY_SENT         = 0x030;
+       const EXCEPTION_DEFAULT_CONTROLLER_GONE      = 0x031;
+       const EXCEPTION_REQUIRED_INTERFACE_MISSING   = 0x033;
+       const EXCEPTION_FATAL_ERROR                  = 0x034;
+       const EXCEPTION_FILE_NOT_FOUND               = 0x035;
+       const EXCEPTION_ASSERTION_FAILED             = 0x036;
+       const EXCEPTION_FILE_NOT_REACHABLE           = 0x037;
+       const EXCEPTION_FILE_CANNOT_BE_READ          = 0x038;
+       const EXCEPTION_FILE_CANNOT_BE_WRITTEN       = 0x039;
+       const EXCEPTION_PATH_CANNOT_BE_WRITTEN       = 0x03a;
+       const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x03b;
+       const EXCEPTION_FILTER_CHAIN_INTERCEPTED     = 0x03c;
+       const EXCEPTION_INVALID_SOCKET               = 0x03d;
+       const EXCEPTION_SELF_INSTANCE                = 0x03e;
 
        /**
         * Startup time in miliseconds
@@ -183,13 +185,13 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
                        $this->setRealClass('DestructedObject');
                } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
                        // Already destructed object
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('The object <span class="object_name">%s</span> is already destroyed.',
+                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('The object <span class="object_name">%s</span> is already destroyed.',
                                $this->__toString()
                        ));
                } else {
                        // Do not call this twice
                        trigger_error(__METHOD__ . ': Called twice.');
-                       exit;
+                       exit(255);
                }
        }
 
@@ -289,7 +291,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
 
                // Output stub message
                // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s::%s]: Stub! Args: %s',
+               self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('[%s::%s]: Stub! Args: %s',
                        $className,
                        $methodName,
                        $argsString
@@ -354,7 +356,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @throws      UnsupportedOperationException   Objects of this framework cannot be serialized
         */
        public final function __sleep () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -364,7 +366,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @throws      UnsupportedOperationException   Objects of this framework cannot be serialized
         */
        public final function __wakeup () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -374,7 +376,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @throws      UnsupportedOperationException   Objects of this framework cannot be serialized
         */
        public final function __invoke () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -395,7 +397,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @return      void
         */
        public final function setDebugInstance (DebugMiddleware $debugInstance) {
-               GenericRegistry::getRegistry()->addInstance('debug', $debugInstance);
+               self::$debugInstance = $debugInstance;
        }
 
        /**
@@ -404,11 +406,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @return      $debugInstance  Instance to class DebugConsoleOutput or DebugWebOutput
         */
        public final function getDebugInstance () {
-               // Get debug instance
-               $debugInstance = GenericRegistry::getRegistry()->getInstance('debug');
-
-               // Return it
-               return $debugInstance;
+               return self::$debugInstance;
        }
 
        /**
@@ -418,7 +416,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @return      void
         */
        public final function setWebOutputInstance (OutputStreamer $webInstance) {
-               GenericRegistry::getRegistry()->addInstance('web_output', $webInstance);
+               ObjectRegistry::getRegistry('generic')->addInstance('web_output', $webInstance);
        }
 
        /**
@@ -427,8 +425,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @return      $webOutputInstance - Instance to class WebOutput
         */
        public final function getWebOutputInstance () {
-               $webOutputInstance = GenericRegistry::getRegistry()->getInstance('web_output');
-               return $webOutputInstance;
+               return ObjectRegistry::getRegistry('generic')->getInstance('web_output');
        }
 
        /**
@@ -485,14 +482,23 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         *
         * @param       $str    A string (maybe) without trailing slash
         * @return      $str    A string with an auto-appended trailing slash
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public final function addMissingTrailingSlash (string $str) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: str=%s - CALLED!', $str));
+               if (empty($str)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is there a trailing slash?
                if (substr($str, -1, 1) != '/') {
                        $str .= '/';
                }
 
                // Return string with trailing slash
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: str=%s - EXIT!', $str));
                return $str;
        }
 
@@ -501,8 +507,16 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         *
         * @param       $message        Optional message to show in debug output
         * @return      void
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public final function debugInstance (string $message = '') {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s - CALLED!', $message));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Restore the error handler to avoid trouble with missing array elements or undeclared variables
                restore_error_handler();
 
@@ -543,41 +557,22 @@ Loaded includes:
                ));
        }
 
-       /**
-        * Output a partial stub message for the caller method
-        *
-        * @param       $message        An optional message to display
-        * @return      void
-        */
-       protected function partialStub (string $message = '') {
-               // Init variable
-               $stubMessage = 'Partial stub!';
-
-               // Is an extra message given?
-               if (!empty($message)) {
-                       // Then add it as well
-                       $stubMessage .= ' Message: ' . $message;
-               }
-
-               // Debug instance is there?
-               if (!is_null($this->getDebugInstance())) {
-                       // Output stub message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($stubMessage);
-               } else {
-                       // Trigger an error
-                       trigger_error($stubMessage);
-                       exit;
-               }
-       }
-
        /**
         * Outputs a debug backtrace and stops further script execution
         *
         * @param       $message        An optional message to output
         * @param       $doExit         Whether exit the program (true is default)
         * @return      void
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public function debugBackTrace (string $message = '', bool $doExit = true) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s,doExit=%d - CALLED!', $message, intval($doExit)));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Sorry, there is no other way getting this nice backtrace
                if (!empty($message)) {
                        // Output message
@@ -590,7 +585,8 @@ Loaded includes:
 
                // Exit program?
                if ($doExit === true) {
-                       exit();
+                       // Yes, with error code
+                       exit(255);
                }
        }
 
@@ -600,38 +596,37 @@ Loaded includes:
         * @param       $className              Name of the class (currently unsupported)
         * @param       $lineNumber             Line number where the call was made
         * @return      $debugInstance  An instance of a debugger class
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         * @deprecated  Not fully, as the new Logger facilities are not finished yet.
         */
        public final static function createDebugInstance (string $className, int $lineNumber = NULL) {
                // Validate parameter
+               //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s,lineNumber[%s]=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className, gettype($lineNumber), $lineNumber);
                if (empty($className)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "className" is empty');
-               } elseif (!GenericRegistry::getRegistry()->instanceExists('debug')) {
+                       throw new InvalidArgumentException('Parameter "className" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Is the debug instance set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::debugInstance[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype(self::$debugInstance));
+               if (is_null(self::$debugInstance)) {
                        // Init debug instance
-                       $debugInstance = NULL;
+                       self::$debugInstance = NULL;
 
                        // Try it
                        try {
                                // Get a debugger instance
-                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className);
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s' . PHP_EOL, __METHOD__, __LINE__, $className);
+                               self::$debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className);
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit(sprintf('[%s:%d]: Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, __METHOD__, __LINE__, $e->__toString(), $e->getMessage(), $className, $lineNumber));
                        }
-
-                       // Empty string should be ignored and used for testing the middleware
-                       DebugMiddleware::getSelfInstance()->output('');
-
-                       // Set it in registry
-                       GenericRegistry::getRegistry()->addInstance('debug', $debugInstance);
-               } else {
-                       // Get instance from registry
-                       $debugInstance = GenericRegistry::getRegistry()->getDebugInstance();
                }
 
                // Return it
-               return $debugInstance;
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::debugInstance=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, self::$debugInstance->__toString());
+               return self::$debugInstance;
        }
 
        /**
@@ -639,81 +634,18 @@ Loaded includes:
         *
         * @param       $message        Message to output
         * @return      void
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public function outputLine (string $message) {
-               // Simply output it
-               print($message . PHP_EOL);
-       }
-
-       /**
-        * Outputs a debug message whether to debug instance (should be set!) or
-        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
-        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
-        *
-        * @param       $message        Message we shall send out...
-        * @param       $doPrint        Whether print or die here (default: print)
-        * @paran       $stripTags      Whether to strip tags (default: false)
-        * @return      void
-        */
-       public function debugOutput (string $message, bool $doPrint = true, bool $stripTags = false) {
-               // Set debug instance to NULL
-               $debugInstance = NULL;
-
-               // Get backtrace
-               $backtrace = debug_backtrace(!DEBUG_BACKTRACE_PROVIDE_OBJECT);
-
-               // Is function partialStub/__callStatic ?
-               if (isset(self::$stubMethods[$backtrace[1]['function']])) {
-                       // Prepend class::function:line from 3rd element
-                       $message = sprintf('[%s::%s:%d]: %s',
-                               $backtrace[2]['class'],
-                               $backtrace[2]['function'],
-                               (isset($backtrace[2]['line']) ? $backtrace[2]['line'] : '0'),
-                               $message
-                       );
-               } else {
-                       // Prepend class::function:line from 2nd element
-                       $message = sprintf('[%s::%s:%d]: %s',
-                               $backtrace[1]['class'],
-                               $backtrace[1]['function'],
-                               (isset($backtrace[1]['line']) ? $backtrace[1]['line'] : '0'),
-                               $message
-                       );
-               }
-
-               // Try it:
-               try {
-                       // Get debug instance
-                       $debugInstance = $this->getDebugInstance();
-               } catch (NullPointerException $e) {
-                       // The debug instance is not set (yet)
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s - CALLED!', $message));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
-               // Is the debug instance there?
-               if (is_object($debugInstance)) {
-                       // Use debug output handler
-                       $debugInstance->output($message, $stripTags);
-
-                       if ($doPrint === false) {
-                               // Die here if not printed
-                               exit();
-                       }
-               } else {
-                       // Are debug times enabled?
-                       if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
-                               // Prepent it
-                               $message = $this->getPrintableExecutionTime() . $message;
-                       }
-
-                       // Put directly out
-                       if ($doPrint === true) {
-                               // Print message
-                               $this->outputLine($message);
-                       } else {
-                               // Die here
-                               exit($message);
-                       }
-               }
+               // Simply output it
+               print($message . PHP_EOL);
        }
 
        /**
@@ -721,8 +653,16 @@ Loaded includes:
         *
         * @param       $phpCode                Unmarked PHP code
         * @return      $markedCode             Marked PHP code
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public function markupCode (string $phpCode) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: phpCode=%s - CALLED!', $phpCode));
+               if (empty($phpCode)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "phpCode" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Init marked code
                $markedCode = '';
 
@@ -759,31 +699,40 @@ Loaded includes:
         * @return      $entry  An array with database entries
         * @throws      NullPointerException    If the database result is not found
         * @throws      InvalidDatabaseResultException  If the database result is invalid
-        * @todo        Monolithic method, should be moved to proper classes
+        * @deprecated  Monolithic method, should be moved to proper classes
         */
        protected final function getDatabaseEntry () {
+               // This method is deprecated
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
+               $this->deprecationWarning('Monolithic method, should be moved to proper classes');
+
                // Is there an instance?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: this->resultInstance[]=%s', gettype($this->getResultInstance())));
                if (!$this->getResultInstance() instanceof SearchableResult) {
                        // Throw an exception here
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Rewind it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: Invoking this->resultInstance->rewind() ...');
                $this->getResultInstance()->rewind();
 
                // Do we have an entry?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: this->resultInstance->isValid()=%d', intval($this->getResultInstance()->isValid())));
                if ($this->getResultInstance()->valid() === false) {
                        // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available
                        throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), CachedDatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
                }
 
                // Get next entry
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: Invoking this->resultInstance->next() ...');
                $this->getResultInstance()->next();
 
                // Fetch it
                $entry = $this->getResultInstance()->current();
 
                // And return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: entry[]=%s - EXIT!', gettype($entry)));
                return $entry;
        }
 
@@ -793,8 +742,20 @@ Loaded includes:
         * @param       $fieldName              Field name which we shall get
         * @return      $fieldValue             Field value from the user
         * @throws      NullPointerException    If the result instance is null
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @deprecated  Monolithic method, should be moved to proper classes
         */
        public final function getField (string $fieldName) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldName=%s - CALLED!', $fieldName));
+               if (empty($fieldName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // This method is deprecated
+               $this->deprecationWarning('Monolithic method, should be moved to proper classes');
+
                // Default field value
                $fieldValue = NULL;
 
@@ -802,31 +763,34 @@ Loaded includes:
                $resultInstance = $this->getResultInstance();
 
                // Is this instance null?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: resultInstance[]=%s', gettype($resultInstance)));
                if (is_null($resultInstance)) {
                        // Then the user instance is no longer valid (expired cookies?)
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Get current array
                $fieldArray = $resultInstance->current();
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
 
                // Convert dashes to underscore
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldArray()=%d', count($fieldArray)));
                $fieldName2 = StringUtils::convertDashesToUnderscores($fieldName);
 
                // Does the field exist?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldName2=%s', $fieldName2));
                if ($this->isFieldSet($fieldName)) {
                        // Get it
                        $fieldValue = $fieldArray[$fieldName2];
-               } elseif (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
+               } elseif (FrameworkBootstrap::getConfigurationInstance()->isEnabled('developer_mode')) {
                        // Missing field entry, may require debugging
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: fieldArray<pre>=' . print_r($fieldArray, true) . '</pre>,fieldName=' . $fieldName . ' not found!');
+                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('BASE-FRAMEWORK-SYSTEM: fieldArray<pre>=' . print_r($fieldArray, true) . '</pre>,fieldName=' . $fieldName . ' not found!');
                } else {
                        // Missing field entry, may require debugging
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: fieldName=' . $fieldName . ' not found!');
+                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('BASE-FRAMEWORK-SYSTEM: fieldName=' . $fieldName . ' not found!');
                }
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldValue[]=%s - EXIT!', gettype($fieldValue)));
                return $fieldValue;
        }
 
@@ -836,29 +800,40 @@ Loaded includes:
         * @param       $fieldName      Field name to check
         * @return      $isSet          Whether the given field name is set
         * @throws      NullPointerException    If the result instance is null
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function isFieldSet (string $fieldName) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldName=%s - CALLED!', $fieldName));
+               if (empty($fieldName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get result instance
                $resultInstance = $this->getResultInstance();
 
                // Is this instance null?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: resultInstance[]=%s', gettype($resultInstance)));
                if (is_null($resultInstance)) {
                        // Then the user instance is no longer valid (expired cookies?)
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Get current array
                $fieldArray = $resultInstance->current();
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=<pre>'.print_r($fieldArray, true).'</pre>');
 
                // Convert dashes to underscore
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldArray()=%d,fieldName=%s - BEFORE!', count($fieldArray), $fieldName));
                $fieldName = StringUtils::convertDashesToUnderscores($fieldName);
 
                // Determine it
-               $isSet = isset($fieldArray[$fieldName]);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fieldName=%s - AFTER!', $fieldName));
+               $isset = isset($fieldArray[$fieldName]);
 
                // Return result
-               return $isSet;
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isset=%d - EXIT!', intval($isset)));
+               return $isset;
        }
 
        /**
@@ -866,24 +841,35 @@ Loaded includes:
         *
         * @param       $message        The message we shall output to the developer
         * @return      void
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         * @todo        Write a logging mechanism for productive mode
         */
        public function deprecationWarning (string $message) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: message=%s - CALLED!', $message));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is developer mode active?
-               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
+               if (FrameworkBootstrap::getConfigurationInstance()->isEnabled('developer_mode')) {
                        // Debug instance is there?
                        if (!is_null($this->getDebugInstance())) {
                                // Output stub message
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($message);
+                               self::createDebugInstance(__CLASS__, __LINE__)->warningMessage($message);
                        } else {
                                // Trigger an error
                                trigger_error($message . "<br />\n");
-                               exit;
+                               exit(255);
                        }
                } else {
                        // @TODO Finish this part!
-                       $this->partialStub('Developer mode inactive. Message:' . $message);
+                       DebugMiddleware::getSelfInstance()->partialStub('Developer mode inactive. Message:' . $message);
                }
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -891,12 +877,21 @@ Loaded includes:
         *
         * @param       $phpExtension   The PHP extension we shall check
         * @return      $isLoaded       Whether the PHP extension is loaded
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public final function isPhpExtensionLoaded (string $phpExtension) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: phpExtension=%s - CALLED!', $phpExtension));
+               if (empty($phpExtension)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "phpExtension" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is it loaded?
                $isLoaded = in_array($phpExtension, get_loaded_extensions());
 
                // Return result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isLoaded=%d - EXIT!', intval($isLoaded)));
                return $isLoaded;
        }
 
@@ -908,9 +903,11 @@ Loaded includes:
         */
        public function getMilliTime () {
                // Get the time of day as float
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
                $milliTime = gettimeofday(true);
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: milliTime=%s - EXIT!', $milliTime));
                return $milliTime;
        }
 
@@ -918,8 +915,16 @@ Loaded includes:
         * Idles (sleeps) for given milliseconds
         *
         * @return      $hasSlept       Whether it goes fine
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function idle (int $milliSeconds) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: milliSeconds=%s - CALLED!', $milliSeconds));
+               if ($milliSeconds < 1) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('milliSeconds=%d are not a reasonable value to idle', $milliSeconds));
+               }
+
                // Sleep is fine by default
                $hasSlept = true;
 
@@ -939,6 +944,7 @@ Loaded includes:
                }
 
                // Return result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: hasSlept=%d - EXIT!', intval($hasSlept)));
                return $hasSlept;
        }
 
@@ -947,12 +953,21 @@ Loaded includes:
         *
         * @param       $encodedData    Encoded data we shall check
         * @return      $isBase64               Whether the encoded data is Base64
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        protected function isBase64Encoded (string $encodedData) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: encodedData=%s - CALLED!', $encodedData));
+               if (empty($encodedData)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "encodedData" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Determine it
                $isBase64 = (@base64_decode($encodedData, true) !== false);
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isBase64=%d - EXIT!', intval($isBase64)));
                return $isBase64;
        }
 
@@ -986,13 +1001,30 @@ Loaded includes:
         * @param       $key            Key to check
         * @param       $element        Element to check
         * @return      $isset          Whether the given key is set
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function isGenericArrayElementSet (string $keyGroup, string $subGroup, $key, $element) {
+       protected final function isGenericArrayElementSet (string $keyGroup, string $subGroup, string $key, string $element) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s - CALLED!', $keyGroup, $subGroup, $key, $element));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($element === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is it there?
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isset=%d - EXIT!', intval($isset)));
                return $isset;
        }
        /**
@@ -1002,30 +1034,54 @@ Loaded includes:
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to check
         * @return      $isset          Whether the given key is set
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function isGenericArrayKeySet (string $keyGroup, string $subGroup, $key) {
+       protected final function isGenericArrayKeySet (string $keyGroup, string $subGroup, string $key) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is it there?
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isset=%d - EXIT!', intval($isset)));
                return $isset;
        }
 
-
        /**
         * Determines if a group is set in the generic array
         *
         * @param       $keyGroup       Main group
         * @param       $subGroup       Sub group
         * @return      $isset          Whether the given group is set
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        protected final function isGenericArrayGroupSet (string $keyGroup, string $subGroup) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is it there?
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
                $isset = isset($this->genericArray[$keyGroup][$subGroup]);
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isset=%d - EXIT!', intval($isset)));
                return $isset;
        }
 
@@ -1035,17 +1091,25 @@ Loaded includes:
         * @param       $keyGroup       Main key group
         * @param       $subGroup       Sub key group
         * @return      $array          An array with all array elements
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
        protected final function getGenericSubArray (string $keyGroup, string $subGroup) {
-               // Is it there?
-               if (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) {
                        // No, then abort here
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' not found.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s not found.', $keyGroup, $subGroup), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Return it
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: this->genericArray[%s][%s][]=%s - EXIT!', $keyGroup, $subGroup, gettype($this->genericArray[$keyGroup][$subGroup])));
                return $this->genericArray[$keyGroup][$subGroup];
        }
 
@@ -1056,11 +1120,27 @@ Loaded includes:
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to unset
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function unsetGenericArrayKey (string $keyGroup, string $subGroup, $key) {
+       protected final function unsetGenericArrayKey (string $keyGroup, string $subGroup, string $key) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Remove it
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
                unset($this->genericArray[$keyGroup][$subGroup][$key]);
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1071,13 +1151,30 @@ Loaded includes:
         * @param       $key            Key to unset
         * @param       $element        Element to unset
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function unsetGenericArrayElement (string $keyGroup, string $subGroup, $key, $element) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
+       protected final function unsetGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s - CALLED!', $keyGroup, $subGroup, $key, $element));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($element === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
 
                // Remove it
                unset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1088,19 +1185,33 @@ Loaded includes:
         * @param       $key            Key to unset
         * @param       $value          Value to add/append
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function appendStringToGenericArrayKey (string $keyGroup, string $subGroup, $key, string $value, $appendGlue = '') {
-               // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue);
+       protected final function appendStringToGenericArrayKey (string $keyGroup, string $subGroup, string $key, string $value, string $appendGlue = '') {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,value=%s,appendGlue=%s - CALLED!', $keyGroup, $subGroup, $key, $value, $appendGlue));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
 
                // Is it already there?
                if ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Append it
-                       $this->genericArray[$keyGroup][$subGroup][$key] .= $appendGlue . (string) $value;
+                       $this->genericArray[$keyGroup][$subGroup][$key] .= $appendGlue . $value;
                } else {
                        // Add it
-                       $this->genericArray[$keyGroup][$subGroup][$key] = (string) $value;
+                       $this->genericArray[$keyGroup][$subGroup][$key] = $value;
                }
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1112,37 +1223,36 @@ Loaded includes:
         * @param       $element        Element to check
         * @param       $value          Value to add/append
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function appendStringToGenericArrayElement (string $keyGroup, string $subGroup, $key, $element, $value, $appendGlue = '') {
-               // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue);
+       protected final function appendStringToGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, string $value, string $appendGlue = '') {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,value=%s,appendGlue=%s - CALLED!', $keyGroup, $subGroup, $key, $element, $value, $appendGlue));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($element === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
 
                // Is it already there?
                if ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
                        // Append it
-                       $this->genericArray[$keyGroup][$subGroup][$key][$element] .= $appendGlue . (string) $value;
+                       $this->genericArray[$keyGroup][$subGroup][$key][$element] .= $appendGlue . $value;
                } else {
                        // Add it
-                       $this->setStringGenericArrayElement($keyGroup, $subGroup, $key, $element, $value);
+                       $this->setGenericArrayElement($keyGroup, $subGroup, $key, $element, $value);
                }
-       }
-
-       /**
-        * Sets a string in a given generic array element
-        *
-        * @param       $keyGroup       Main group for the key
-        * @param       $subGroup       Sub group for the key
-        * @param       $key            Key to unset
-        * @param       $element        Element to check
-        * @param       $value          Value to add/append
-        * @return      void
-        */
-       protected final function setStringGenericArrayElement (string $keyGroup, string $subGroup, $key, $element, $value, $appendGlue = '') {
-               // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue);
 
-               // Set it
-               $this->genericArray[$keyGroup][$subGroup][$key][$element] = (string) $value;
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1153,20 +1263,28 @@ Loaded includes:
         * @param       $key            Key to use
         * @param       $forceInit      Optionally force initialization
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group has already been initialized
         */
        protected final function initGenericArrayGroup (string $keyGroup, string $subGroup, bool $forceInit = false) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',forceInit=' . intval($forceInit));
-
-               // Is it already set?
-               if (($forceInit === false) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,forceInit=%d - CALLED!', $keyGroup, $subGroup, intval($forceInit)));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (($forceInit === false) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) {
                        // Already initialized
-                       trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' already initialized.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s already initialized.', $keyGroup, $subGroup), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Initialize it
                $this->genericArray[$keyGroup][$subGroup] = [];
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1177,20 +1295,31 @@ Loaded includes:
         * @param       $key            Key to use
         * @param       $forceInit      Optionally force initialization
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group has already been initialized
         */
-       protected final function initGenericArrayKey (string $keyGroup, string $subGroup, $key, bool $forceInit = false) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',forceInit=' . intval($forceInit));
-
-               // Is it already set?
-               if (($forceInit === false) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
+       protected final function initGenericArrayKey (string $keyGroup, string $subGroup, string $key, bool $forceInit = false) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,forceInit=%d - CALLED!', $keyGroup, $subGroup, $key, intval($forceInit)));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (($forceInit === false) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
                        // Already initialized
-                       trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' already initialized.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s already initialized.', $keyGroup, $subGroup, gettype($key), $key), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Initialize it
                $this->genericArray[$keyGroup][$subGroup][$key] = [];
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1202,37 +1331,59 @@ Loaded includes:
         * @param       $element        Element to use
         * @param       $forceInit      Optionally force initialization
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
-       protected final function initGenericArrayElement (string $keyGroup, string $subGroup, $key, $element, bool $forceInit = false) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',forceInit=' . intval($forceInit));
-
-               // Is it already set?
-               if (($forceInit === false) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) {
+       protected final function initGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, bool $forceInit = false) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,forceInit=%d - CALLED!', $keyGroup, $subGroup, $key, $element, intval($forceInit)));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($element === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (($forceInit === false) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) {
                        // Already initialized
-                       trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ' already initialized.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s,element[%s]=%s already initialized.', $keyGroup, $subGroup, gettype($key), $key, gettype($element), $element), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Initialize it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = [];
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
-        * Pushes an element to a generic key
+        * Pushes an element to a generic key. If the key isn't found, it will be initialized.
         *
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to use
         * @param       $value          Value to add/append
         * @return      $count          Number of array elements
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function pushValueToGenericArrayKey (string $keyGroup, string $subGroup, $key, $value) {
-               // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true));
-
-               // Is it set?
-               if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
+       protected final function pushValueToGenericArrayKey (string $keyGroup, string $subGroup, string $key, $value) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, gettype($value)));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Initialize array
                        $this->initGenericArrayKey($keyGroup, $subGroup, $key);
                }
@@ -1242,12 +1393,12 @@ Loaded includes:
 
                // Return count
                //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
-               //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: count=%d - EXIT!', $count));
                return $count;
        }
 
        /**
-        * Pushes an element to a generic array element
+        * Pushes an element to a generic array element. If the key isn't found, it will be initialized.
         *
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
@@ -1255,14 +1406,26 @@ Loaded includes:
         * @param       $element        Element to check
         * @param       $value          Value to add/append
         * @return      $count          Number of array elements
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function pushValueToGenericArrayElement (string $keyGroup, string $subGroup, $key, $element, $value) {
-               // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true));
-
-               // Is it set?
-               if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
+       protected final function pushValueToGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, $value) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, $element, gettype($value)));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($element === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
                        // Initialize array
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: Invoking this->initGenericArrayElement(%s,%s,%s,%s) ...', $keyGroup, $subGroup, $key, $element));
                        $this->initGenericArrayElement($keyGroup, $subGroup, $key, $element);
                }
 
@@ -1271,7 +1434,7 @@ Loaded includes:
 
                // Return count
                //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
-               //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: count=%d - EXIT!', $count));
                return $count;
        }
 
@@ -1282,16 +1445,24 @@ Loaded includes:
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to unset
         * @return      $value          Last "popped" value
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
-       protected final function popGenericArrayElement (string $keyGroup, string $subGroup, $key) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
-
-               // Is it set?
-               if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
+       protected final function popGenericArrayElement (string $keyGroup, string $subGroup, string $key) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Not found
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' not found.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Then "pop" it
@@ -1299,7 +1470,7 @@ Loaded includes:
 
                // Return value
                //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
-               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, true) . PHP_EOL);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: value[]=%s - EXIT!', gettype($value)));
                return $value;
        }
 
@@ -1309,17 +1480,25 @@ Loaded includes:
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to unset
-        * @return      $value          Last "popped" value
-        */
-       protected final function shiftGenericArrayElement (string $keyGroup, string $subGroup, $key) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
-
-               // Is it set?
-               if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
+        * @return      $value          Last "shifted" value
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
+        */
+       protected final function shiftGenericArrayElement (string $keyGroup, string $subGroup, string $key) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Not found
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' not found.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Then "shift" it
@@ -1327,7 +1506,7 @@ Loaded includes:
 
                // Return value
                //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
-               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, true) . PHP_EOL);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: value[]=%s - EXIT!', gettype($value)));
                return $value;
        }
 
@@ -1336,25 +1515,25 @@ Loaded includes:
         *
         * @param       $keyGroup       Main group for the key
         * @return      $count          Count of given group
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key group isn't there but this method is invoked
         */
        protected final function countGenericArray (string $keyGroup) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
-
-               // Is it there?
-               if (!isset($this->genericArray[$keyGroup])) {
-                       // Abort here
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ' not found.');
-                       exit;
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s - CALLED!', $keyGroup));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!isset($this->genericArray[$keyGroup])) {
+                       // Not found
+                       throw new BadMethodCallException(sprintf('keyGroup=%s not found.', $keyGroup), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Then count it
                $count = count($this->genericArray[$keyGroup]);
 
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',count=' . $count);
-
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: count=%d - EXIT!', $count));
                return $count;
        }
 
@@ -1364,25 +1543,28 @@ Loaded includes:
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
         * @return      $count          Count of given group
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
        protected final function countGenericArrayGroup (string $keyGroup, string $subGroup) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
-
-               // Is it there?
-               if (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) {
                        // Abort here
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' not found.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s not found.', $keyGroup, $subGroup), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Then count it
                $count = count($this->genericArray[$keyGroup][$subGroup]);
 
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',count=' . $count);
-
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: count=%d - EXIT!', $count));
                return $count;
        }
 
@@ -1391,31 +1573,36 @@ Loaded includes:
         *
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
-        * @para        $key            Key to count
+        * @param       $key            Key to count
         * @return      $count          Count of given key
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
-       protected final function countGenericArrayElements (string $keyGroup, string $subGroup, $key) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
-
-               // Is it there?
-               if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
+       protected final function countGenericArrayElements (string $keyGroup, string $subGroup, string $key) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Abort here
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' not found.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif (!$this->isValidGenericArrayGroup($keyGroup, $subGroup)) {
                        // Not valid
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' is not an array.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s is not a valid key/sub group.', $keyGroup, $subGroup), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Then count it
                $count = count($this->genericArray[$keyGroup][$subGroup][$key]);
 
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',count=' . $count);
-
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: count=%d - EXIT!', $count));
                return $count;
        }
 
@@ -1424,19 +1611,22 @@ Loaded includes:
         *
         * @param       $keyGroup       Key group to get
         * @return      $array          Whole generic array group
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
        protected final function getGenericArray (string $keyGroup) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
-
-               // Is it there?
-               if (!isset($this->genericArray[$keyGroup])) {
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s - CALLED!', $keyGroup));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!isset($this->genericArray[$keyGroup])) {
                        // Then abort here
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ' does not exist.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s not found', $keyGroup), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: this->genericArray[%s][]=%s - EXIT!', $keyGroup, gettype($this->genericArray[$keyGroup])));
                return $this->genericArray[$keyGroup];
        }
 
@@ -1448,13 +1638,31 @@ Loaded includes:
         * @param       $key            Key to unset
         * @param       $value          Mixed value from generic array element
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
-       protected final function setGenericArrayKey (string $keyGroup, string $subGroup, $key, $value) {
-               // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true));
+       protected final function setGenericArrayKey (string $keyGroup, string $subGroup, string $key, $value) {
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, gettype($value)));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isValidGenericArrayGroup($keyGroup, $subGroup)) {
+                       // Then abort here
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s not found', $keyGroup), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
+               }
 
                // Set value here
                $this->genericArray[$keyGroup][$subGroup][$key] = $value;
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1464,19 +1672,28 @@ Loaded includes:
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to unset
         * @return      $value          Mixed value from generic array element
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
-       protected final function getGenericArrayKey (string $keyGroup, string $subGroup, $key) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
-
-               // Is it there?
-               if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
+       protected final function getGenericArrayKey (string $keyGroup, string $subGroup, string $key) {
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Then abort here
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' does not exist.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: this->genericArray[%s][%s][%s][]=%s - EXIT!', $keyGroup, $subGroup, $key, gettype($this->genericArray[$keyGroup][$subGroup][$key])));
                return $this->genericArray[$keyGroup][$subGroup][$key];
        }
 
@@ -1489,13 +1706,33 @@ Loaded includes:
         * @param       $element        Element to set
         * @param       $value          Value to set
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function setGenericArrayElement (string $keyGroup, string $subGroup, $key, $element, $value) {
-               // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true));
+       protected final function setGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element, $value) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s,value[]=%s - CALLED!', $keyGroup, $subGroup, $key, $element, gettype($value)));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($element === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
+                       // Initialize array
+                       $this->initGenericArrayElement($keyGroup, $subGroup, $key, $element);
+               }
 
                // Then set it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = $value;
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1506,19 +1743,31 @@ Loaded includes:
         * @param       $key            Key to look for
         * @param       $element        Element to look for
         * @return      $value          Mixed value from generic array element
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      BadMethodCallException  If key/sub group isn't there but this method is invoked
         */
-       protected final function getGenericArrayElement (string $keyGroup, string $subGroup, $key, $element) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
-
-               // Is it there?
-               if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
+       protected final function getGenericArrayElement (string $keyGroup, string $subGroup, string $key, string $element) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s,element=%s - CALLED!', $keyGroup, $subGroup, $key, $element));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($element === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
                        // Then abort here
-                       trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ' does not exist.');
-                       exit;
+                       throw new BadMethodCallException(sprintf('keyGroup=%s,subGroup=%s,key[%s]=%s,element[%s]=%s not found.', $keyGroup, $subGroup, gettype($key), $key, gettype($element), $element), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: this->genericArray[%s][%s][%s][%s][]=%s - EXIT!', $keyGroup, $subGroup, $key, gettype($this->genericArray[$keyGroup][$subGroup][$key][$element])));
                return $this->genericArray[$keyGroup][$subGroup][$key][$element];
        }
 
@@ -1528,15 +1777,24 @@ Loaded includes:
         * @param       $keyGroup       Key group to get
         * @param       $subGroup       Sub group for the key
         * @return      $isValid        Whether given sub group is valid
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        protected final function isValidGenericArrayGroup (string $keyGroup, string $subGroup) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s - CALLED!', $keyGroup, $subGroup));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
 
                // Determine it
                $isValid = (($this->isGenericArrayGroupSet($keyGroup, $subGroup)) && (is_array($this->getGenericSubArray($keyGroup, $subGroup))));
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isValid=%d - EXIT!', intval($isValid)));
                return $isValid;
        }
 
@@ -1548,14 +1806,25 @@ Loaded includes:
         * @param       $key            Key to check
         * @return      $isValid        Whether given sub group is valid
         */
-       protected final function isValidGenericArrayKey (string $keyGroup, string $subGroup, $key) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
+       protected final function isValidGenericArrayKey (string $keyGroup, string $subGroup, string $key) {
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: keyGroup=%s,subGroup=%s,key=%s - CALLED!', $keyGroup, $subGroup, $key));
+               if (empty($keyGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "keyGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($subGroup)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
 
                // Determine it
                $isValid = (($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) && (is_array($this->getGenericArrayKey($keyGroup, $subGroup, $key))));
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: isValid=%d - EXIT!', intval($isValid)));
                return $isValid;
        }
 
@@ -1566,10 +1835,14 @@ Loaded includes:
         */
        protected function initWebOutputInstance () {
                // Init web output instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
                $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class');
 
                // Set it locally
                $this->setWebOutputInstance($outputInstance);
+
+               // Trace mesage
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: EXIT!');
        }
 
        /**
@@ -1580,9 +1853,11 @@ Loaded includes:
         */
        public static final function translateBooleanToYesNo (bool $boolean) {
                // "Translate" it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: boolean=%d - CALLED!', intval($boolean)));
                $translated = ($boolean === true) ? 'Y' : 'N';
 
                // ... and return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: translated=%s - EXIT!', $translated));
                return $translated;
        }
 
@@ -1591,40 +1866,51 @@ Loaded includes:
         * a configured temporary file path to it.
         *
         * @param       $infoInstance   An instance of a SplFileInfo class
-        * @return      $tempInstance   An instance of a SplFileInfo class (temporary file)
+        * @return      $fileInfoInstance       An instance of a SplFileInfo class (temporary file)
         * @throw       PathWriteProtectedException If the path in 'temp_file_path' is write-protected
         * @throws      FileIoException If the file cannot be written
         */
         protected static function createTempPathForFile (SplFileInfo $infoInstance) {
                // Get config entry
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: infoInstance=%s - CALLED!', $infoInstance->__toString()));
                $basePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('temp_file_path');
 
                // Is the path writeable?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: basePath=%s', $basePath));
                if (!is_writable($basePath)) {
                        // Path is write-protected
                        throw new PathWriteProtectedException($infoInstance, self::EXCEPTION_PATH_CANNOT_BE_WRITTEN);
                }
 
                // Add it
-               $tempInstance = new SplFileInfo($basePath . DIRECTORY_SEPARATOR . $infoInstance->getBasename());
+               $fileInfoInstance = new SplFileInfo($basePath . DIRECTORY_SEPARATOR . $infoInstance->getBasename());
 
                // Is it reachable?
-               if (!FrameworkBootstrap::isReachableFilePath($tempInstance)) {
+               if (!FrameworkBootstrap::isReachableFilePath($fileInfoInstance)) {
                        // Not reachable
-                       throw new FileIoException($tempInstance, self::EXCEPTION_FILE_NOT_REACHABLE);
+                       throw new FileIoException($fileInfoInstance, self::EXCEPTION_FILE_NOT_REACHABLE);
                }
 
                // Return it
-               return $tempInstance;
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: fileInfoInstance=%s - EXIT!', $fileInfoInstance->__toString()));
+               return $fileInfoInstance;
         }
 
        /**
         * "Getter" for a printable state name
         *
         * @return      $stateName      Name of the node's state in a printable format
+        * @throws      BadMethodCallException  If this instance doesn't have a callable getter for stateInstance
         * @todo        Move this class away from this monolithic place (not whole class is monolithic)
         */
        public final function getPrintableState () {
+               // Check if getter is there
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: CALLED!');
+               if (!is_callable($this, 'getStateInstance')) {
+                       // Throw BMCE
+                       throw new BadMethodCallException(sprintf('this=%s has no callable getter for stateInstance', $this->__toString()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
+               }
+
                // Default is 'null'
                $stateName = 'null';
 
@@ -1632,12 +1918,14 @@ Loaded includes:
                $stateInstance = $this->getStateInstance();
 
                // Is it an instance of Stateable?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: stateInstance[]=%s', gettype($stateInstance)));
                if ($stateInstance instanceof Stateable) {
                        // Then use that state name
                        $stateName = $stateInstance->getStateName();
                }
 
                // Return result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FRAMEWORK-SYSTEM: stateName=%s - EXIT!', $stateName));
                return $stateName;
        }
 
index 3a1457aa796721e0e804552e6156c236e371509b..d1860fc272858dfadd7138d3d36c12b456380489 100644 (file)
@@ -12,7 +12,7 @@ use \ArrayObject;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0e7faf1386b994ff2cacf88b80311361d33d86ef..d970e8d99e768f9cdc17cd82cce6b171b24b5e72 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index b8244f7c58d4bac501ac39ac0a8a7640f402bf80..6333bf18dbebe97028233f50b9d99a24bbe5a877 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index f8a68c76a855ef15d0478a546a2e16256930b292..fc955edab11c7442ec9c251b3c689288d78b8267 100644 (file)
@@ -6,13 +6,18 @@ namespace Org\Mxchange\CoreFramework\Client\Http;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Client\BaseClient;
 use Org\Mxchange\CoreFramework\Client\Client;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+use \UnexpectedValueException;
 
 /**
  * A HTTP client class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -55,12 +60,14 @@ class HttpClient extends BaseClient implements Client {
         */
        public final static function createHttpClient ($socketResouce = FALSE) {
                // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: socketResource[%s]=%s - CALLED!', gettype($socketResource), $socketResource));
                $clientInstance = new HttpClient();
 
                // Set socket resource
                $clientInstance->setSocketResource($socketResource);
 
                // Return the prepared instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: clientInstance=%s - EXIT!', $clientInstance->__toString()));
                return $clientInstance;
        }
 
@@ -71,12 +78,14 @@ class HttpClient extends BaseClient implements Client {
         */
        protected function isProxyUsed () {
                // Do we have cache?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HTTP-CLIENT: CALLED!');
                if (!isset($GLOBALS[__METHOD__])) {
                        // Determine it
                        $GLOBALS[__METHOD__] = ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host') != '') && (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port') > 0));
                }
 
                // Return cache
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: isProxyUsed=%d - EXIT!', $GLOBALS[__METHOD__]));
                return $GLOBALS[__METHOD__];
        }
 
@@ -86,22 +95,43 @@ class HttpClient extends BaseClient implements Client {
         * @param       $host           Host to connect to
         * @param       $port           Port number to connect to
         * @return      $response       Response array
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
+        * @throws      UnexpectedValueException        If an unexpected value was found
         */
        protected function setupProxyTunnel (string $host, int $port) {
+               // Check paramters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: host=%s,port=%d - CALLED!', $host, $port));
+               if (empty($host)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "host" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($port < 1) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('port=%d is not a valid port number', $port), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Initialize array
                $response = ['', '', ''];
 
                // Do the connect
-               $respArray = $this->doConnectRequest($host, $port);
+               $responseArray = $this->doConnectRequest($host, $port);
+
+               // Check array
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: responseArray()=%d', count($responseArray)));
+               if (count($responseArray) < 2) {
+                       // Not expected count
+                       throw new UnexpectedValueException(sprintf('responseArray()=%d must have at least two elements', count($responseArray)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
 
                // Analyze first header line
-               if (((strtolower($respArray[0]) !== 'http/1.0') && (strtolower($respArray[0]) !== 'http/1.1')) || ($respArray[1] != '200')) {
+               if (((strtolower($responseArray[0]) !== 'http/1.0') && (strtolower($responseArray[0]) !== 'http/1.1')) || ($responseArray[1] != '200')) {
                        // Response code is not 200
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HTTP-CLIENT: Returning empty response array - EXIT!');
                        return $response;
                }
 
                // All fine!
-               return $respArray;
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: responseArray()=%d - EXIT!', count($responseArray)));
+               return $responseArray;
        }
 
        /**
@@ -114,6 +144,7 @@ class HttpClient extends BaseClient implements Client {
         */
        private function sendRawHttpRequest (string $method, string $host, int $port, array $header = []) {
                // Minimum raw HTTP/1.1 request
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: method=%s,host=%s,port=%d,header()=%d - CALLED!', $method, $host, $port, count($header)));
                $rawRequest  = $method . ' ' . $host . ':' . $port . ' HTTP/1.1' . self::HTTP_EOL;
                $rawRequest .= 'Host: ' . $host . ':' . $port . self::HTTP_EOL;
 
@@ -129,21 +160,27 @@ class HttpClient extends BaseClient implements Client {
                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HTTP-CLIENT: rawRequest=' . $rawRequest);
 
                // Write request
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Sending %d bytes to this->socketResource=%s ...', strlen($rawRequest), $this->getSocketResource()));
                fwrite($this->getSocketResource(), $rawRequest);
 
                // Got response?
-               if (feof($this->getSocketResource())) {
+               $feof = feof($this->getSocketResource());
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: this->socketResource=%s,feof=%d', $this->getSocketResource(), intval($feof)));
+               if ($feof) {
                        // No response received
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: this->socketResource=%s has reached EOF - EXIT!', $this->getSocketResource()));
                        return $response;
                }
 
                // Read the first line
-               $resp = trim(fgets($this->getSocketResource(), 10240));
+               $rawResponse = trim(fgets($this->getSocketResource(), 10240));
 
                // "Explode" the string to an array
-               $responseArray = explode(' ', $resp);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Received %d bytes back from this->socketResource=%s ...', strlen($rawResponse), $this->getSocketResource()));
+               $responseArray = explode(' ', $rawResponse);
 
                // And return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: responseArray()=%d - EXIT!', count($responseArray)));
                return $responseArray;
        }
 
@@ -153,17 +190,30 @@ class HttpClient extends BaseClient implements Client {
         * @param       $host   Host to connect to
         * @param       $port   Port number to connect to
         * @return      $responseArray  An array with the read response
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public function doConnectRequest (string $host, int $port) {
+               // Check paramters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: host=%s,port=%d - CALLED!', $host, $port));
+               if (empty($host)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "host" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($port < 1) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('port=%d is not a valid port number', $port), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Prepare extra header(s)
                $headers = [
                        'Proxy-Connection' => 'Keep-Alive'
                ];
 
                // Prepare raw request
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Invoking this->sendRawHttpRequest(CONNECT,%s,%d,headers()=%d) ...', $host, $port, count($headers)));
                $responseArray = $this->sendRawHttpRequest('CONNECT', $host, $port, $headers);
 
                // Return response array
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: responseArray()=%d - EXIT!', count($responseArray)));
                return $responseArray;
        }
 
index 8d00b13a6166355335e266bc0b10024289f48770..195b0b02754014216921d2771b2b8cc104c65b39 100644 (file)
@@ -1,10 +1,13 @@
 <?php
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+
 /**
  * 
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -57,7 +60,7 @@ class ???Command extends BaseCommand implements Commandable {
         * @return      void
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub('Unfinished!');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished!');
        }
 
        /**
@@ -68,7 +71,7 @@ class ???Command extends BaseCommand implements Commandable {
         * @return      void
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
-               $this->partialStub('Unfinished!');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished!');
        }
 
 }
index dc94d64a8d2ceaf31a44767aea4427e1f05e5ed9..754217da9c796984b6b8a9d919e31875b2609332 100644 (file)
@@ -6,19 +6,23 @@ namespace Org\Mxchange\CoreFramework\Command;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\Traits\Resolver\ResolverTrait;
 use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
 
+// Import SPL stuff
+use \BadMethodCallException;
+use \InvalidArgumentException;
+
 /**
  * A general (base) command
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -56,13 +60,25 @@ abstract class BaseCommand extends BaseFrameworkSystem {
         *
         * @param       $templateType   Type of template, e.g. 'html', 'image', 'console' ...
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public final function initTemplateEngine (string $templateType) {
+               // Check paramter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-COMMAND: templateType=%s - CALLED!', $templateType));
+               if (empty($templateType)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "templateType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Prepare a template instance
                $templateInstance = ObjectFactory::createObjectByConfiguredName(sprintf('%s_template_class', $templateType));
 
                // Set it here
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-COMMAND: templateInstance=%s', $templateInstance->__toString()));
                $this->setTemplateInstance($templateInstance);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-COMMAND: EXIT!');
        }
 
        /**
@@ -72,24 +88,33 @@ abstract class BaseCommand extends BaseFrameworkSystem {
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @param       $suffix                         Optional template suffix, e.g. '_form' for forms
         * @return      void
+        * @throws      BadMethodCallException  If a POST request ended here
         */
        protected function sendGenericGetResponse (Requestable $requestInstance, Responseable $responseInstance, string $suffix = '') {
-               // This command doesn't handle any POST requests, so only handle get request
-               assert(!$requestInstance->isPostRequestMethod());
-
-               // Get the application instance
-               $applicationInstance = ApplicationHelper::getSelfInstance();
+               // Check conditions
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-COMMAND: requestInstance=%s,responseInstance=%s,suffix=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString(), $suffix));
+               if ($requestInstance->isPostRequestMethod()) {
+                       // POST request isn't handled here
+                       throw new BadMethodCallException('This method does only handle GET/HEAD requests', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
+               }
 
                // Transfer application data
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-COMMAND: Invoking this->templateInstance->assignApplicationData() ...');
                $this->getTemplateInstance()->assignApplicationData();
 
                // Assign base URL
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-COMMAND: Invoking this->templateInstance->assignConfigVariable(base_url) ...');
                $this->getTemplateInstance()->assignConfigVariable('base_url');
 
+               // Get the application instance
+               $applicationInstance = ApplicationHelper::getSelfInstance();
+
                // Load the master template
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-COMMAND: applicationInstance=%s', $applicationInstance->__toString()));
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
 
                // Load header template
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-COMMAND: masterTemplate=%s', $masterTemplate));
                $this->getTemplateInstance()->loadCodeTemplate('header');
 
                // Compile and assign it with a variable
@@ -115,8 +140,11 @@ abstract class BaseCommand extends BaseFrameworkSystem {
                // Set title
                $this->getTemplateInstance()->assignVariable('title', FrameworkBootstrap::getLanguageInstance()->getMessage('page_' . $applicationInstance->getAppShortName() . '_' . $this->getResolverInstance()->getCommandName() . '_title'));
 
-               // Construct the menu in every command. We could do this in BaseCommand class. But this means
-               // *every* command has a navigation system and that is want we don't want.
+               /*
+                * Construct the menu in every command. We could do this in BaseCommand
+                * class. But this means *every* command has a navigation system and
+                * that is want we don't want.
+                */
                $menuInstance = ObjectFactory::createObjectByConfiguredName($applicationInstance->getAppShortName() . '_' . $this->getResolverInstance()->getCommandName() . '_menu_class');
 
                // Render the menu
@@ -134,6 +162,9 @@ abstract class BaseCommand extends BaseFrameworkSystem {
 
                // Get the content back from the template engine and put it in response class
                $this->getTemplateInstance()->transferToResponse($responseInstance);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-COMMAND: EXIT!');
        }
 
 }
index b606f47cc23d01d94ec08cb7670a49dcdc044aca..e2bb4de34d36be66ab8a9fd03c35817be66722cd 100644 (file)
@@ -1,10 +1,13 @@
 <?php
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+
 /**
  * A ??? console command
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -57,7 +60,7 @@ class Console???Command extends BaseCommand implements Commandable {
         * @return      void
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub('Unfinished!');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished!');
        }
 
        /**
@@ -68,7 +71,7 @@ class Console???Command extends BaseCommand implements Commandable {
         * @return      void
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
-               $this->partialStub('Unfinished!');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished!');
        }
 
 }
index 3738c9f6c122569dea4a82a2cc321905f1c8b7e3..c8061ffcc295b9766e2911fe23d6ad28c1e602c2 100644 (file)
@@ -7,6 +7,7 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Feature\FrameworkFeature;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -16,7 +17,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -82,7 +83,7 @@ class ConsoleFuseCommand extends BaseCommand implements Commandable {
                }
 
                // @TODO Unfinished
-               $this->partialStub('Still unfinished! ;-)');
+               DebugMiddleware::getSelfInstance()->partialStub('Still unfinished! ;-)');
        }
 
        /**
index ef59d70201c3958f9614934a8510493f3d1183b8..2db86e39dc4af02f0af76e960da64f3895eceabd 100644 (file)
@@ -1,10 +1,13 @@
 <?php
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+
 /**
  * A command for ??? page
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -58,7 +61,7 @@ class Html???Command extends BaseCommand implements Commandable {
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub('Unfinished method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished method.');
        }
 
        /**
index d2eac8c18dacaa3396e7e8b22683bfc73e98e759..79f8bdf4968ebe6d0626adf0712d2f77a3218d2d 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -21,7 +21,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -114,7 +114,7 @@ class HtmlConfirmCommand extends BaseCommand implements Commandable {
 
                // Get user instance
                try {
-                       $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+                       $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
                } catch (NullPointerException $e) {
                        // Not found user, e.g. when the user is somehow invalid
                        $responseInstance->redirectToConfiguredUrl('html_cmd_user_is_null');
index b44ccd897db4d072cd2c9bb126f2e6c206fe5c44..c03af4aae44b258740d95738afe43034277013a2 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3c3288abe339cce33fdc238492e0430de3ab9772..e532c2d2b329505f3fc1a604212895b4de9a1acf 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -19,7 +18,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 966364cde70ad0d1ddb7146d83fee238fde64fe9..0c59b7ef3122ca5e1a89fbd47fce9122925b1949 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -21,7 +21,7 @@ use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -92,7 +92,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the action instance from registry
-               $actionInstance = GenericRegistry::getRegistry()->getInstance('action');
+               $actionInstance = ObjectRegistry::getRegistry('generic')->getInstance('action');
 
                // Do we have an action here?
                if ($actionInstance instanceof PerformableAction) {
@@ -200,7 +200,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
                $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
 
                // Remember this action in registry
-               GenericRegistry::getRegistry()->addInstance('action', $actionInstance);
+               ObjectRegistry::getRegistry('generic')->addInstance('action', $actionInstance);
        }
 
 }
index 047230cc6991c5a3093174c489f028bcdfba1093..bea535beb0a73dfda0d0990b4c5efac3b2799b3b 100644 (file)
@@ -9,7 +9,7 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -19,7 +19,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -73,7 +73,7 @@ class HtmlLoginCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Set request instance as extra instance
-               GenericRegistry::getRegistry()->addInstance('extra', $this);
+               ObjectRegistry::getRegistry('generic')->addInstance('extra', $this);
 
                // Get the application instance
                $applicationInstance = ApplicationHelper::getSelfInstance();
index 9a7321fc738a1e9e9bb3bc03163927ad26de7dae..e64f6ec09a1aff31a99322487dc0433b22b2e69b 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -19,7 +18,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d7a5bfdbc65aafdb14793a21a3af17255ad3bdaf..9951a262b3a8841b8bc37cfd0a515f75aa638575 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -17,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 26c56ebcfe2c14abeab4aa67680817a8bee45016..b70a9d4cdbc4bad3844ae87a88efd5d204715de3 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -19,7 +18,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 096df92fc68e69b867bd3d0352374f15d819f2ca..c6f35a7274f4fbc946acd605efcbcd3bfa38374e 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Command\Failed;
 use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -70,7 +70,7 @@ class HtmlProblemCommand extends BaseCommand implements Commandable {
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->partialStub('Unfinished method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished method.');
        }
 
        /**
index 193300c7bae73470ad9a7617dd373fe54f8906d1..56b2608516f83b0599696dffa59a14d8b1b556d8 100644 (file)
@@ -9,7 +9,7 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -19,7 +19,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -73,7 +73,7 @@ class HtmlRegisterCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Set request instance as extra instance
-               GenericRegistry::getRegistry()->addInstance('extra', $this);
+               ObjectRegistry::getRegistry('generic')->addInstance('extra', $this);
 
                // Get the application instance
                $applicationInstance = ApplicationHelper::getSelfInstance();
index 06951322309e871cb1eb5a6296750ae1a695827a..9d4a57d4fa2d55161658aa1ce3b468aa34635ca1 100644 (file)
@@ -10,7 +10,8 @@ use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -20,7 +21,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -74,7 +75,7 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get user instance from registry
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Get an application instance
                $applicationInstance = ApplicationHelper::getSelfInstance();
@@ -86,7 +87,7 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
                $randomString = $rngInstance->randomString(255);
 
                // Get a crypto instance
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
 
                // Hash and encrypt the string
                $hashedString = $cryptoInstance->hashString($cryptoInstance->encryptString($randomString));
index a6e95df8775ae2fbc99d868ea0d73767e68f2c68..e53e02b7e0a9fd282ec60b815883df9dd204fce0 100644 (file)
@@ -18,7 +18,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a1629588093e61b6495bd23db22b8302d26b24b2..0491a9525d4c3bd31403b8c37227a935e55419a4 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -17,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 64602350a65addc0dc3e109c0cf53614e636f0f7..66c5ab0211a42616b393d373eabc3862de1521ce 100644 (file)
@@ -6,15 +6,12 @@ namespace Org\Mxchange\CoreFramework\Compressor\Bzip2;
 use Org\Mxchange\CoreFramework\Compressor\Compressor;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
-// Load SPL stuff
-use \InvalidArgumentException;
-
 /**
  * BZIP2 compression and decompression class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -52,7 +49,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
                $compressorInstance = NULL;
 
                // Get new instance
-               if ((function_exists('bzcompress')) && (function_exists('bzdecompress'))) {
+               if (extension_loaded('bzip2')) {
                        // Compressor can maybe be used
                        $compressorInstance = new Bzip2Compressor();
                }
@@ -66,17 +63,13 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
         *
         * @param       $streamData             Mixed non-object stream data
         * @return      $streamData             The compressed stream data
-        * @throws      InvalidArgumentException        If the stream is not compressable or decompressable
         */
        public function compressStream (string $streamData) {
-               // Validate parameter
-               if (is_object($streamData) || is_resource($streamData)) {
-                       // Throw an exception
-                       throw new InvalidArgumentException(sprintf('streamData[]=%s cannot be compressed/decompressed', gettype($streamData)));
-               }
+               // Compress it
+               $streamData = bzcompress($streamData, 1);
 
                // Return the compressed stream
-               return bzcompress($streamData, 1);
+               return $streamData;
        }
 
        /**
@@ -84,15 +77,8 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
         *
         * @param       $streamData             Mixed non-object stream data
         * @return      $streamData             The decompressed stream data
-        * @throws      InvalidArgumentException        If the stream is not compressable or decompressable
         */
        public function decompressStream (string $streamData) {
-               // Validate parameter
-               if (is_object($streamData) || is_resource($streamData)) {
-                       // Throw an exception
-                       throw new InvalidArgumentException(sprintf('streamData[]=%s cannot be compressed/decompressed', gettype($streamData)));
-               }
-
                // Decompress it
                $streamData = bzdecompress($streamData, true);
 
index 7f7f9ca414d9709f45f89ab7344913a371f3ef38..d8446a8d0d41760aa6bd9d17785e37bfc73cb876 100644 (file)
@@ -6,15 +6,12 @@ namespace Org\Mxchange\CoreFramework\Compressor\Gzip;
 use Org\Mxchange\CoreFramework\Compressor\Compressor;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
-// Load SPL stuff
-use \InvalidArgumentException;
-
 /**
  * GZIP compression and decompression class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -66,17 +63,13 @@ class GzipCompressor extends BaseFrameworkSystem implements Compressor {
         *
         * @param       $streamData             Mixed non-object stream data
         * @return      $streamData             The compressed stream data
-        * @throws      InvalidArgumentException        If the stream is not compressable or decompressable
         */
        public function compressStream (string $streamData) {
-               // Validate parameter
-               if (is_object($streamData) || is_resource($streamData)) {
-                       // Throw an exception
-                       throw new InvalidArgumentException(sprintf('streamData[]=%s cannot be compressed/decompressed', gettype($streamData)));
-               }
+               // Compress stream
+               $streamData = gzencode($streamData, 1);
 
-               // Return the compressed stream
-               return gzencode($streamData, 1);
+               // Return it
+               return $streamData;
        }
 
        /**
@@ -84,17 +77,13 @@ class GzipCompressor extends BaseFrameworkSystem implements Compressor {
         *
         * @param       $streamData             Mixed non-object stream data
         * @return      $streamData             The decompressed stream data
-        * @throws      InvalidArgumentException        If the stream is not compressable or decompressable
         */
        public function decompressStream (string $streamData) {
-               // Validate parameter
-               if (is_object($streamData) || is_resource($streamData)) {
-                       // Throw an exception
-                       throw new InvalidArgumentException(sprintf('streamData[]=%s cannot be compressed/decompressed', gettype($streamData)));
-               }
+               // Decompress string
+               $streamData = gzdecode($streamData);
 
-               // Return the decompressed stream
-               return gzdecode($streamData);
+               // Return it
+               return $streamData;
        }
 
        /**
index dd813fec294587dbc5cb958648246cfc61d5ab71..e3d2af01b566f454a5a72c41e9d5faa2b453d5c1 100644 (file)
@@ -14,7 +14,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index fc36c2b94c0a1291fefc8dc4d48e134d6855404f..a5db0382cf57d92a72486fe381bd82688972d222 100644 (file)
@@ -6,15 +6,12 @@ namespace Org\Mxchange\CoreFramework\Compressor\Zlib;
 use Org\Mxchange\CoreFramework\Compressor\Compressor;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
-// Load SPL stuff
-use \InvalidArgumentException;
-
 /**
  * ZLIB compression and decompression class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -66,17 +63,13 @@ class ZlibCompressor extends BaseFrameworkSystem implements Compressor {
         *
         * @param       $streamData             Mixed non-object stream data
         * @return      $streamData             The compressed stream data
-        * @throws      InvalidArgumentException        If the stream is not compressable or decompressable
         */
        public function compressStream (string $streamData) {
-               // Validate parameter
-               if (is_object($streamData) || is_resource($streamData)) {
-                       // Throw an exception
-                       throw new InvalidArgumentException(sprintf('streamData[]=%s cannot be compressed/decompressed', gettype($streamData)));
-               }
+               // Compress string
+               $streamData = gzcompress($streamData, 1);
 
-               // Return the compressed stream
-               return gzcompress($streamData, 1);
+               // Return it
+               return $streamData;
        }
 
        /**
@@ -84,17 +77,13 @@ class ZlibCompressor extends BaseFrameworkSystem implements Compressor {
         *
         * @param       $streamData             Mixed non-object stream data
         * @return      $streamData             The decompressed stream data
-        * @throws      InvalidArgumentException        If the stream is not compressable or decompressable
         */
        public function decompressStream (string $streamData) {
-               // Validate parameter
-               if (is_object($streamData) || is_resource($streamData)) {
-                       // Throw an exception
-                       throw new InvalidArgumentException(sprintf('streamData[]=%s cannot be compressed/decompressed', gettype($streamData)));
-               }
-
                // Return the decompressed stream
-               return gzuncompress($streamData);
+               $streamData = gzuncompress($streamData);
+
+               // Return it
+               return $streamData;
        }
 
        /**
index 5b6c22c0dca4613888c0d839359cdc6c7a7f0023..1c704a1001fb7725ea8adb8b3e7086fc8f3f61c1 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Registry\Registerable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 969184fcc39a6b37b4152ce2bbc2fb377b532547..1e994c58fd82be23a6bcf5be69d4158b99b1c057 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4cd0ee81c5fb39fdf1c8aaa5f0bb01b46120117a..b9c5bde42a4ae795e6f84d91cdd548889f4f0260 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 675e87363746366c14aa32341423f798a4a4e368..421ba3b2fee9ddd9457a1cec5c9b5801962d410a 100644 (file)
@@ -3,16 +3,20 @@
 namespace Org\Mxchange\CoreFramework\Controller;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\Chain\Filter\InvalidFilterChainException;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\Traits\Resolver\ResolverTrait;
 
+// Import SPL stuff
+use \BadMethodCallException;
+use \InvalidArgumentException;
+
 /**
  * A generic controller class. You should extend this base class if you want to
  * write your own controller. You get the advantage that you can use the pre and
@@ -20,7 +24,7 @@ use Org\Mxchange\CoreFramework\Traits\Resolver\ResolverTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -47,6 +51,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
        // Names of controller's own filter chains
        const FILTER_CHAIN_PRE_COMMAND  = 'controller_pre_command';
        const FILTER_CHAIN_POST_COMMAND = 'controller_post_command';
+       const FILTER_CHAIN_SHUTDOWN     = 'shutdown';
 
        /**
         * Generic filter chains
@@ -61,14 +66,23 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
 
                // Initialize both filter chains
-               $this->initFilterChain(self::FILTER_CHAIN_PRE_COMMAND);
-               $this->initFilterChain(self::FILTER_CHAIN_POST_COMMAND);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('BASE-CONTROLLER: Initializing filter chains ...');
+               foreach([self::FILTER_CHAIN_PRE_COMMAND, self::FILTER_CHAIN_POST_COMMAND] as $filterChain) {
+                       // Init it
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: Invoking this->initFilterChain(=%s) ...', $filterChain));
+                       $this->initFilterChain($filterChain);
+               }
 
                // Add this controller to the registry
-               GenericRegistry::getRegistry()->addInstance('controller', $this);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-CONTROLLER: Registering this=%s ...', $this->__toString()));
+               ObjectRegistry::getRegistry('generic')->addInstance('controller', $this);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -80,6 +94,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         */
        public function executeGenericPrePostCommand (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the command instance from the resolver by sending a request instance to the resolver
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // Add more filters by the command
@@ -89,7 +104,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
                $this->executePreFilters($requestInstance, $responseInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
@@ -99,6 +114,9 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
 
                // Flush the response out
                $responseInstance->flushBuffer();
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -111,6 +129,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         */
        public function genericHanleRequestLoginFailedRedirect (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the "form action"
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $formAction = $requestInstance->getRequestElement('form');
 
                // Get command instance from resolver
@@ -128,7 +147,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
                        $responseInstance->redirectToConfiguredUrl('login_failed');
 
                        // Exit here
-                       exit();
+                       exit;
                }
 
                /*
@@ -145,6 +164,9 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
 
                // Flush the buffer out
                $responseInstance->flushBuffer();
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -157,6 +179,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         */
        public function genericHanleRequestLoginAreaFailedRedirect (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the command instance from the resolver by sending a request instance to the resolver
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // Add more filters by the command
@@ -171,11 +194,11 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
                        $responseInstance->redirectToConfiguredUrl('login_failed');
 
                        // Exit here
-                       exit();
+                       exit;
                }
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
@@ -185,6 +208,9 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
 
                // Flush the response out
                $responseInstance->flushBuffer();
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -192,11 +218,26 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         *
         * @param       $filterChain    Name of the filter chain
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      BadMethodCallException  If the given filter chain is already initialized
         */
        protected function initFilterChain (string $filterChain) {
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: START');
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: filterChain=%s - CALLED!', $filterChain));
+               if (empty($filterChain)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "filterChain" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (isset($this->filterChains[$filterChain])) {
+                       // Throw BMCE
+                       throw new BadMethodCallException(sprintf('filterChain=%s is already initialized', $filterChain), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
+               }
+
+               // Initialize filter chain
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-CONTROLLER: Initializing filterChain=%s ...', $filterChain));
                $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: FINISHED');
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -205,20 +246,26 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         * @param       $filterChain    Chain of the filter
         * @param       $filterInstance         An instance of a filter
         * @return      void
-        * @throws      InvalidFilterChainException     If the filter chain is invalid
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      BadMethodCallException  If the given filter chain is not yet initialized
         */
        protected function addFilter (string $filterChain, Filterable $filterInstance) {
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: START');
-
-               // Test if the filter is there
-               if (!isset($this->filterChains[$filterChain])) {
-                       // Throw an exception here
-                       throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: filterChain=%s,filterInstance=%s - CALLED!', $filterChain, $filterInstance->__toString()));
+               if (empty($filterChain)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "filterChain" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!isset($this->filterChains[$filterChain])) {
+                       // Throw IAE
+                       throw new BadMethodCallException(sprintf('filterChain=%s is not a valid chain', $filterChain), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Add the filter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-CONTROLLER: Adding filterInstance=%s to filterChain=%s ...', $filterInstance->__toString(), $filterChain));
                $this->filterChains[$filterChain]->addFilter($filterInstance);
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: FINISH');
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -229,7 +276,11 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         */
        public function addPreFilter (Filterable $filterInstance) {
                // Add the pre filter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: filterInstance=%s - CALLED!', $filterInstance->__toString()));
                $this->addFilter(self::FILTER_CHAIN_PRE_COMMAND, $filterInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -239,8 +290,12 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         * @return      void
         */
        public function addPostFilter (Filterable $filterInstance) {
-               // Add the post filter
+               // Add post filter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: filterInstance=%s - CALLED!', $filterInstance->__toString()));
                $this->addFilter(self::FILTER_CHAIN_POST_COMMAND, $filterInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -250,7 +305,12 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         * @return      void
         */
        public function addShutdownFilter (Filterable $filterInstance) {
-               $this->addFilter('shutdown', $filterInstance);
+               // Add shutdown filter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: filterInstance=%s - CALLED!', $filterInstance->__toString()));
+               $this->addFilter(self::FILTER_CHAIN_SHUTDOWN, $filterInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -260,17 +320,25 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         * @param       $requestInstance        An instance of a Requestable class
         * @param       $responseInstance       An instance of a Responseable class
         * @return      void
-        * @throws      InvalidFilterChainException     If the filter chain is invalid
+        * @throws      InvalidArgumentException        If the filter chain is invalid
         */
        protected function executeFilters (string $filterChain, Requestable $requestInstance, Responseable $responseInstance) {
-               // Test if the filter is there
-               if (!isset($this->filterChains[$filterChain])) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: filterChain=%s,requestInstance=%s,responseInstance=%s - CALLED!', $filterChain, $requestInstance->__toString(), $responseInstance->__toString()));
+               if (empty($filterChain)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "filterChain" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!isset($this->filterChains[$filterChain])) {
                        // Throw an exception here
-                       throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
+                       throw new BadMethodCallException(sprintf('filterChain=%s is not a valid chain', $filterChain), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Run all filters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-CONTROLLER: Processing filterChain=%s...', $filterChain));
                $this->filterChains[$filterChain]->processFilters($requestInstance, $responseInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -282,7 +350,11 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         */
        protected function executePreFilters (Requestable $requestInstance, Responseable $responseInstance) {
                // Execute all pre filters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $this->executeFilters(self::FILTER_CHAIN_PRE_COMMAND, $requestInstance, $responseInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -294,7 +366,11 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         */
        protected function executePostFilters (Requestable $requestInstance, Responseable $responseInstance) {
                // Execute all post filters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $this->executeFilters(self::FILTER_CHAIN_POST_COMMAND, $requestInstance, $responseInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
        /**
@@ -305,7 +381,12 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
         * @return      void
         */
        public function executeShutdownFilters (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->executeFilters('shutdown', $requestInstance, $responseInstance);
+               // Execute all shutdown filter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               $this->executeFilters(self::FILTER_CHAIN_SHUTDOWN, $requestInstance, $responseInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CONTROLLER: EXIT!');
        }
 
 }
index 689e565c5b093f060582580f3bd8bcaeab13af7b..810412aa22b9fb7b9dad222c9e221849f559a866 100644 (file)
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This controller shall still provide some headlines for sidebars
@@ -71,7 +71,7 @@ class ConsoleDefaultController extends BaseController implements Controller {
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
index 2c7620362aaaac732540ffc99cdb911073481ad4..8f03d752479aef3a4dd8c9d244000068d8668e11 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 75baa32718bda77fde0cb4380ce52b5e10182185..d8dae62be945ab428a47b1f8cfe4c9d578229b05 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8733aa4b596d9b87785f7a516ec992f30ca2d139..d323185e6d71fccf7d9cf7d5f51a11a65a3edee8 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d5a55d2847ecfefa13c3112c3e2fdfaf4f2aec15..0d8874cbce4ce8f80e6ff98ed2e944e793c132b0 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This controller shall still provide some headlines for sidebars
@@ -72,7 +72,7 @@ class HtmlDefaultController extends BaseController implements Controller {
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
index 43ae0f6497401d29075292badb6fe40424e2bcef..4683246b1bfb6e5e2ec47c63ba9e6be6d4b29eb0 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d8ae4c4432b5318b8ff1a9c6da099f4c5c108b0d..b5238b9a2c71d6417129f6eecac40cec20dbf33b 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 364a4d93e400ce078da23a5b1abf6235c81e4767..4369d89ebe20bf8f76f4807667d75d743953ef5e 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -71,7 +71,7 @@ class HtmlLoginFailedController extends BaseController implements Controller {
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
index 8467dee075fa425ba1ac606e7208153d584232cd..abdd425a9116985c7f484871d19515400cc35ecb 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This controller shall still provide some headlines for sidebars
@@ -79,7 +79,7 @@ class HtmlLogoutController extends BaseController implements Controller {
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
index 7a44962101f112c97ea447d1c3b8ac63ddff2c3c..12a4ec998d62cc3cb2284ca107b480c31e245623 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a6bb0de9f884bbf1ae99d102aede27e7c13e04ac..fc51ecd293ca36ece249b0edde073cac9f83ace3 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 166025bd2100518b640ec8ad423ee8066ac6c7dc..c8d9a50aa3c728efe45d8050a0ca83bfd04ae651 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This controller shall still provide some headlines for sidebars
@@ -72,7 +72,7 @@ class HtmlStatusController extends BaseController implements Controller {
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
index 24a3c395c6fc2f2dbe12254f794f3b50bcf3d5ed..66f2e3d6b69239814272095a6ac4ac6983c70bf4 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 42e4a0d5b9a328f031b0837ca0b124219aabfe5a..ad7257d73c71c82bd0ad3b81f6b875cd6bb4db9d 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 06d3f2a3c089415306a2f989c28f8be7c50706fa..c75a8c7995c72489e9b73adab0de72c352aed4d1 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d8472d2a205ad882e28b5bd27c4f061e6a1aaefc..1a465b0ebea3ebf11337d35938f48398782d29ec 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -71,7 +71,7 @@ class ImageDefaultController extends BaseController implements Controller {
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
index f1221d673084d481dbbd6d5e64bd7c650109bf42..3582f38a025ddafdceb5d10d4a53306a0abef05c 100644 (file)
@@ -5,15 +5,21 @@ namespace Org\Mxchange\CoreFramework\Criteria;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Criteria\Search\SearchCriteria;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
+// Import SPL stuff
+use \BadMethodCallException;
+use \InvalidArgumentException;
+use \UnexpectedValueException;
+
 /**
  * A general crtieria class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -36,6 +42,11 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        private $frontendConfigEntry = '';
 
+       /**
+        * All supported criteria types
+        */
+       private static $CRITERIA_TYPES = [];
+
        /**
         * Protected constructor
         *
@@ -44,13 +55,22 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
 
+               // Initialize valid criteria types array
+               self::$CRITERIA_TYPES = [Criteria::CRITERIA_TYPE_DEFAULT, Criteria::CRITERIA_TYPE_CHOICE, Criteria::CRITERIA_TYPE_EXCLUDE];
+
                // Initialize all criteria arrays
-               foreach (array('default', 'choice', 'exclude') as $criteriaType) {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-CRITERIA: self::CRITERIA_TYPES()=%d', count(self::$CRITERIA_TYPES)));
+               foreach (self::$CRITERIA_TYPES as $criteriaType) {
                        // Init it
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->initGenericArrayKey(criteria,%s,entries) ...', $criteriaType));
                        $this->initGenericArrayKey('criteria', $criteriaType, 'entries');
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: EXIT!');
        }
 
        /**
@@ -59,9 +79,21 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         *
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      $count  Count of all criteria entries
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       protected final function count (string $criteriaType = 'default') {
-               // Return it
+       protected final function count (string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaType));
+               if (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaType=%s is not supported', $criteriaType));
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking this->countGenericArrayGroup(criteria, %s) ... - EXIT!', strtoupper($criteriaType), $criteriaType));
                return $this->countGenericArrayGroup('criteria', $criteriaType);
        }
 
@@ -70,39 +102,74 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         *
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @param       $criteriaKey    Criteria key
-        * @return      $isSet                  Whether key is set
+        * @return      $isset                  Whether key is set
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
         */
        public function isKeySet (string $criteriaType, string $criteriaKey) {
-               // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false));
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: criteriaType=%s,criteriaKey=%s - CALLED!', strtoupper($criteriaType), $criteriaType, $criteriaKey));
+               if (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               } elseif (empty($criteriaKey)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               }
 
                // Determine it
-               $isSet = $this->isGenericArrayElementSet('criteria', $criteriaType, 'entries', $criteriaKey);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: Invoking this->isGenericArrayElementSet(criteria,%s,entries,%s) ...', strtoupper($criteriaType), $criteriaType, $criteriaKey));
+               $isset = $this->isGenericArrayElementSet('criteria', $criteriaType, 'entries', $criteriaKey);
 
                // Return it
-               return $isSet;
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: isset=%d - EXIT!', strtoupper($criteriaType), intval($isset)));
+               return $isset;
        }
 
        /**
         * Checks whether given key is set for 'choice' type
         *
         * @param       $criteriaKey    Criteria key
-        * @return      $isSet                  Whether key is set
+        * @return      $isset                  Whether key is set
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function isChoiceKeySet (string $criteriaKey) {
-               // Call inner method
-               return $this->isKeySet('choice', $criteriaKey);
+               // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: criteriaKey=%s - CALLED!', $criteriaKey));
+               if (empty($criteriaKey)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->isKeySet(%s,%s) ...', Criteria::CRITERIA_TYPE_CHOICE, $criteriaKey));
+               return $this->isKeySet(Criteria::CRITERIA_TYPE_CHOICE, $criteriaKey);
        }
 
        /**
         * Checks whether given key is set for 'exclude' type
         *
         * @param       $criteriaKey    Criteria key
-        * @return      $isSet                  Whether key is set
+        * @return      $isset                  Whether key is set
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function isExcludeKeySet (string $criteriaKey) {
-               // Call inner method
-               return $this->isKeySet('exclude', $criteriaKey);
+               // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: criteriaKey=%s - CALLED!', $criteriaKey));
+               if (empty($criteriaKey)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->isKeySet(%s,%s) ... - EXIT!', Criteria::CRITERIA_TYPE_EXCLUDE, $criteriaKey));
+               return $this->isKeySet(Criteria::CRITERIA_TYPE_EXCLUDE, $criteriaKey);
        }
 
        /**
@@ -129,8 +196,22 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         *
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      $criteria
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
         */
-       public final function getCriteriaArray (string $criteriaType = 'default') {
+       public final function getCriteriaArray (string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaType));
+               if (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking this->getGenericArrayKey(criteria,%s,entries) ... - EXIT!', strtoupper($criteriaType), $criteriaType));
                return $this->getGenericArrayKey('criteria', $criteriaType, 'entries');
        }
 
@@ -140,7 +221,8 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @return      $criteria
         */
        public final function getCriteriaChoiceArray () {
-               return $this->getCriteriaArray('choice');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: CALLED!', strtoupper($criteriaType)));
+               return $this->getCriteriaArray(Criteria::CRITERIA_TYPE_CHOICE);
        }
 
        /**
@@ -149,7 +231,8 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @return      $criteria
         */
        public final function getCriteriaExcludeArray () {
-               return $this->getCriteriaArray('exclude');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: CALLED!');
+               return $this->getCriteriaArray(Criteria::CRITERIA_TYPE_EXCLUDE);
        }
 
        /**
@@ -159,17 +242,30 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @return      void
         */
        public final function unsetCriteria (string $criteriaKey) {
-               // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false));
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: criteriaKey=%s - CALLED!', $criteriaKey));
+               if (empty($criteriaKey)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               }
 
                // Convert dashes to underscore
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking StringUtils::convertDashesToUnderscores(%s) ...', strtoupper($criteriaType), $criteriaKey));
                $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
                // "Walk" through all criterias
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: criteriaKey=%s', strtoupper($criteriaType), $criteriaKey));
                foreach ($this->getGenericArray('criteria') as $criteriaType => $dummy) {
                        // Remove it
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Removing criteriaType=%s,criteriaKey=%s ...', strtoupper($criteriaType), $criteriaType, $criteriaKey));
                        $this->unsetGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey);
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: EXIT!');
        }
 
        /**
@@ -180,22 +276,39 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaValue  Criteria value
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
         */
-       public final function addCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default') {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!');
-
-               // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
+       public final function addCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[]=%s,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaType));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               } elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('value[]=%s is not supported', gettype($criteriaValue)));
+               } elseif (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
 
                // Convert dashes to underscore
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking StringUtils::convertDashesToUnderscores(%s) ...', strtoupper($criteriaType), $criteriaKey));
                $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA: criteriaKey=' . $criteriaKey);
+               // Set it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking this->setGenericArrayElement(criteria,%s,entries,%s,criteriaValue[]=%s) ...', strtoupper($criteriaType), $criteriaType, $criteriaKey, gettype($criteriaValue)));
+               $this->setGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
 
-               // Append it
-               $this->appendStringToGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: EXIT!', strtoupper($criteriaType)));
        }
 
        /**
@@ -206,22 +319,39 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaValue  Criteria value
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
         */
-       public final function setCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default') {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!');
-
-               // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
+       public final function setCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[]=%s$criteriaValue,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaType));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               } elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('value[]=%s is not supported', gettype($criteriaValue)));
+               } elseif (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
 
                // Convert dashes to underscore
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking StringUtils::convertDashesToUnderscores(%s) ...', strtoupper($criteriaType), $criteriaKey));
                $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA: criteriaKey=' . $criteriaKey);
-
                // Set it
-               $this->setStringGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking this->setGenericArrayElement(criteria,%s,entries,%s,criteriaValue[]=%s) ...', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue)));
+               $this->setGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: EXIT!');
        }
 
        /**
@@ -231,14 +361,33 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaKey    Criteria key
         * @param       $criteriaValue  Criteria value
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If $criteriaValue has an unexpected type
         */
        public final function addChoiceCriteria (string $criteriaKey, $criteriaValue) {
-               // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: criteriaKey=%s,criteriaValue[]=%s - CALLED!', $criteriaKey, gettype($criteriaValue)));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               } elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
+                       // Throw UAE
+                       throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not accepted', gettype($criteriaValue)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
+
+               // Convert dashes to underscore
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking StringUtils::convertDashesToUnderscores(%s) ...', $criteriaKey));
+               $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
                // Add it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
-               $this->pushValueToGenericArrayElement('criteria', 'choice', 'entries', StringUtils::convertDashesToUnderscores($criteriaKey), (string) $criteriaValue);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->pushValueToGenericArrayElement(criteria,%s,entries,%s,criteriaValue[]=%s) ...', Criteria::CRITERIA_TYPE_CHOICE, $criteriaKey, gettype($criteriaValue)));
+               $this->pushValueToGenericArrayElement('criteria', Criteria::CRITERIA_TYPE_CHOICE, 'entries', $criteriaKey, $criteriaValue);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: EXIT!');
        }
 
        /**
@@ -248,10 +397,29 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaKey    Criteria key
         * @param       $criteriaValue  Criteria value
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If $criteriaValue has an unexpected type
         */
        public final function addExcludeCriteria (string $criteriaKey, $criteriaValue) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: criteriaKey=%s,criteriaValue[%s]=%s - CALLED!', $criteriaKey, gettype($criteriaValue), $criteriaValue));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               } elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
+                       // Throw UAE
+                       throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not accepted', gettype($criteriaValue)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
+
                // Add it with generic method
-               $this->addCriteria($criteriaKey, $criteriaValue, 'exclude');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->addCriteria(%s,criteriaValue[]=%s,%s) ...', $criteriaKey, gettype($criteriaValue), Criteria::CRITERIA_TYPE_EXCLUDE));
+               $this->addCriteria($criteriaKey, $criteriaValue, Criteria::CRITERIA_TYPE_EXCLUDE);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: EXIT!');
        }
 
        /**
@@ -261,11 +429,38 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $configEntry    Configuration entry
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
         */
-       public final function addConfiguredCriteria (string $criteriaKey, string $configEntry, string $criteriaType = 'default') {
+       public final function addConfiguredCriteria (string $criteriaKey, string $configEntry, string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: criteriaKey=%s,configEntry=%s,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, $configEntry, $criteriaType));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               } elseif (empty($configEntry)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "configEntry" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
+
                // Add the configuration entry as a criteria
                $value = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking this->addCriteria(%s,value[%s]=%s,%s) ...', strtoupper($criteriaType), $criteriaKey, gettype($value), $value, $criteriaType));
                $this->addCriteria($criteriaKey, $value, $criteriaType);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: EXIT!', strtoupper($criteriaType)));
        }
 
        /**
@@ -274,27 +469,42 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaKey    The requested criteria key
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      $value                  Whether the value of the critera or false
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
         */
-       public function getCriteriaElemnent (string $criteriaKey, string $criteriaType = 'default') {
-               // Make sure no 'my-' or 'my_' passes this point
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!');
-               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false));
+       public function getCriteriaElemnent (string $criteriaKey, string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, $criteriaType));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               } elseif (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
 
                // Convert dashes to underscore
                $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
                // Default is not found
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType));
                $value = false;
 
                // Is the criteria there?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteria()=%d', strtoupper($criteriaType), $criteriaKey, $this->countGenericArrayGroup('criteria', $criteriaType)));
                if ($this->isKeySet($criteriaType, $criteriaKey)) {
                        // Then use it
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking this->getGenericArrayElement(criteria,%s,entries,%s) ...', strtoupper($criteriaType), $criteriaType, $criteriaKey));
                        $value = $this->getGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey);
                }
 
                // Return the value
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: value=' . $value . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: value[]=%s - EXIT!', strtoupper($criteriaType), gettype($value)));
                return $value;
        }
 
@@ -303,10 +513,22 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         *
         * @param       $criteriaKey    The requested criteria key
         * @return      $value                  Whether the value of the critera or false
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function getCriteriaChoiceElemnent (string $criteriaKey) {
-               // Call inner method
-               return $this->getCriteriaElemnent($criteriaKey, 'choice');
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: criteriaKey=%s - CALLED!', $criteriaKey));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->getCriteriaElemnent(%s,%s) ...', $criteriaKey, Criteria::CRITERIA_TYPE_CHOICE));
+               return $this->getCriteriaElemnent($criteriaKey, Criteria::CRITERIA_TYPE_CHOICE);
        }
 
        /**
@@ -314,10 +536,22 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         *
         * @param       $criteriaKey    The requested criteria key
         * @return      $value                  Whether the value of the critera or false
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function getCriteriaExcludeElemnent (string $criteriaKey) {
-               // Call inner method
-               return $this->getCriteriaElemnent($criteriaKey, 'exclude');
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: criteriaKey=%s - CALLED!', $criteriaKey));
+               if (empty($criteriaKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->getCriteriaElemnent(%s,%s) ...', $criteriaKey, Criteria::CRITERIA_TYPE_EXCLUDE));
+               return $this->getCriteriaElemnent($criteriaKey, Criteria::CRITERIA_TYPE_EXCLUDE);
        }
 
        /**
@@ -326,40 +560,71 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $entryArray             Array with the entries to find
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      $matches                Whether the entry matches or not
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
         */
-       public function ifEntryMatches (array $entryArray, string $criteriaType = 'default') {
+       public function ifEntryMatches (array $entryArray, string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: entryArray()=%d,criteriaType=%s - CALLED!', strtoupper($criteriaType), count($entryArray), $criteriaType));
+               if (count($entryArray) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('entryArray cannot be an empty array');
+               } elseif (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
+
                // First nothing matches and nothing is counted
                $matches = false;
                $counted = 0;
 
                // Walk through all entries
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: Walking over entryArray()=%d ...', strtoupper($criteriaType), count($entryArray)));
                foreach ($entryArray as $key => $entry) {
                        // Make sure no 'my-' or 'my_' passes this point
-                       assert((strpos($key, 'my-') === false) && (strpos($key, 'my_') === false));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: key=%s,entry[%s]=%s', strtoupper($criteriaType), $key, gettype($entry), $entry));
+                       if ((strpos($key, 'my-') !== false) || (strpos($key, 'my_') !== false)) {
+                               // Throw it again
+                               throw new InvalidArgumentException(sprintf('key=%s has illegal prefix "my"', $key));
+                       }
 
                        // Convert dashes to underscore
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking StringUtils::convertDashesToUnderscores(%s) ...', strtoupper($criteriaType), $key));
                        $key = StringUtils::convertDashesToUnderscores($key);
 
                        // Then walk through all search criteria
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: key=%s - AFTER!', strtoupper($criteriaType), $key));
                        foreach ($this->getGenericArrayKey('criteria', $criteriaType, 'entries') as $criteriaKey => $criteriaValue) {
                                // Make sure no 'my-' or 'my_' passes this point
-                               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[%s]=%s', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaValue));
+                               if ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                                       // Throw it again
+                                       throw new UnexpectedValueException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+                               }
 
                                // Convert dashes to underscore
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking StringUtils::convertDashesToUnderscores(%s) ...', strtoupper($criteriaType), $criteriaKey));
                                $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
                                // Is the element found and does it match?
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: key=%s,criteriaKey=%s', strtoupper($criteriaType), $key, $criteriaKey));
                                if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
                                        // Then count this one up
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: MATCHES!', strtoupper($criteriaType)));
                                        $counted++;
                                }
                        }
                }
 
                // Now check if expected criteria counts match
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: counted=%d', strtoupper($criteriaType), $counted));
                $matches = ($counted == $this->countGenericArrayGroup('criteria', $criteriaType));
 
                // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: matches=%d - EXIT!', strtoupper($criteriaType), intval($matches)));
                return $matches;
        }
 
@@ -368,10 +633,19 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         *
         * @param       $entryArray             Array with the entries to find
         * @return      $matches                Whether the entry matches or not
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function ifChoiceMatches (array $entryArray) {
-               // Call inner method
-               return $this->ifEntryMatches($entryArray, 'choice');
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: entryArray()=%d - CALLED!', count($entryArray)));
+               if (count($entryArray) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('entryArray cannot be an empty array');
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->ifEntryMatches(%d,%s) ...', count($entryArray), Criteria::CRITERIA_TYPE_CHOICE));
+               return $this->ifEntryMatches($entryArray, Criteria::CRITERIA_TYPE_CHOICE);
        }
 
        /**
@@ -379,10 +653,19 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         *
         * @param       $entryArray             Array with the entries to find
         * @return      $matches                Whether the entry matches or not
+        * @throws      InvalidArgumentException        If a parameter is not valid
         */
        public function ifExcludeMatches (array $entryArray) {
-               // Call inner method
-               return $this->ifEntryMatches($entryArray, 'exclude');
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: entryArray()=%d - CALLED!', count($entryArray)));
+               if (count($entryArray) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('entryArray cannot be an empty array');
+               }
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->ifEntryMatches(%d,%s) ...', count($entryArray), Criteria::CRITERIA_TYPE_EXCLUDE));
+               return $this->ifEntryMatches($entryArray, Criteria::CRITERIA_TYPE_EXCLUDE);
        }
 
        /**
@@ -391,13 +674,23 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $onlyKeys       Only use these keys for a cache key
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      $cacheKey       The key suitable for the cache system
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If a parameter contains an unexpected/unsupported value
+        * @throws      BadMethodCallException  If this method is invoked before $criteriaType has been initialized
         */
-       public function getCacheKey (array $onlyKeys = [], string $criteriaType = 'default') {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . ': criteriaType=' . $criteriaType . ',count()=' . $this->countGenericArray('criteria')));
-
-               // Make sure the criteria is there
-               assert($this->isValidGenericArrayGroup('criteria', $criteriaType));
+       public function getCacheKey (array $onlyKeys = [], string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
+               // Check parameters
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: onlyKeys()=%d,criteriaType=%s - CALLED!', strtoupper($criteriaType), count($onlyKeys), $criteriaType));
+               if (empty($criteriaType)) {
+                       // Throw it again
+                       throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
+                       // Throw it again
+                       throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               } elseif (!$this->isValidGenericArrayGroup('criteria', $criteriaType)) {
+                       // Not intialized yet
+                       throw new BadMethodCallException(sprintf('Method cannot be invoked before criteriaType=%s is initialized!', $criteriaType), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
+               }
 
                // Initialize the key
                $cacheKey = '';
@@ -405,17 +698,24 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                // Now walk through all criterias
                foreach ($this->getGenericArrayKey('criteria', $criteriaType, 'entries') as $criteriaKey => $criteriaValue) {
                        // Make sure no 'my-' or 'my_' passes this point
-                       assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
-
-                       // $criteriaValue cannot be an array
-                       assert(!is_array($criteriaValue));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[%s]=%s', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaValue));
+                       if ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
+                               // Throw UAE
+                               throw new UnexpectedValueException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+                       } elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
+                               // Throw it again
+                               throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not supported', gettype($criteriaValue)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+                       }
 
                        // Convert dashes to underscore
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: Invoking StringUtils::convertDashesToUnderscores(%s) ...', strtoupper($criteriaType), $criteriaKey));
                        $criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
                        // Is the value in array or is $onlyKeys empty?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: criteriaKey=%s', strtoupper($criteriaType), $criteriaKey));
                        if ((isset($onlyKeys[$criteriaKey])) || (count($onlyKeys) == 0)) {
                                // Add the value URL encoded to avoid any trouble with special characters
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: Adding criteriaKey=%s,criteriaValue[%s]=%s to cache key ...', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaValue));
                                $cacheKey .= sprintf('%s=%s;',
                                        $criteriaKey,
                                        urlencode($criteriaValue)
@@ -427,10 +727,12 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                $cacheKey = substr($cacheKey, 0, -1);
 
                // Is the instance SearchCriteria?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: cacheKey=%s,this=%s', strtoupper($criteriaType), $cacheKey, $this->__toString()));
                if ($this instanceof SearchCriteria) {
                        // Check if 'limit' and 'skip' are in
                        if (((isset($onlyKeys['limit'])) && (isset($onlyKeys['skip']))) || (count($onlyKeys) == 0)) {
                                // Add limit and skip values
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: Adding this->limit=%d,this->skip=%d to cache key ...', strtoupper($criteriaType), $this->getLimit(), $this->getSkip()));
                                $cacheKey .= sprintf(';%%limit%%=%s;%%skip%%=%s',
                                        $this->getLimit(),
                                        $this->getSkip()
@@ -439,6 +741,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                }
 
                // Return the cache key
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-CRITERIA: cacheKey=%s - EXIT!', strtoupper($criteriaType), $cacheKey));
                return $cacheKey;
        }
 
@@ -449,8 +752,12 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @return      $cacheKey       The key suitable for the cache system
         */
        public function getCacheKeyChoice (array $onlyKeys = []) {
-               // Call inner method
-               return $this->getCacheKey($onlyKeys, 'choice');
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: onlyKeys()=%d - CALLED!', count($onlyKeys)));
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->getCacheKey(onlyKeys()=%d,%s) ...', count($onlyKeys),Criteria::CRITERIA_TYPE_CHOICE));
+               return $this->getCacheKey($onlyKeys, Criteria::CRITERIA_TYPE_CHOICE);
        }
 
        /**
@@ -460,8 +767,12 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @return      $cacheKey       The key suitable for the cache system
         */
        public function getCacheKeyExclude (array $onlyKeys = []) {
-               // Call inner method
-               return $this->getCacheKey($onlyKeys, 'exclude');
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: onlyKeys()=%d - CALLED!', count($onlyKeys)));
+
+               // Invoke inner method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-CRITERIA: Invoking this->getCacheKey(onlyKeys()=%d,%s) ...', count($onlyKeys),Criteria::CRITERIA_TYPE_EXCLUDE));
+               return $this->getCacheKey($onlyKeys, Criteria::CRITERIA_TYPE_EXCLUDE);
        }
 
        /**
@@ -471,7 +782,9 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @return      $count  Count of all criteria entries
         */
        public final function countChoice () {
-               return $this->count('choice');
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: CALLED!');
+               return $this->count(Criteria::CRITERIA_TYPE_CHOICE);
        }
 
        /**
@@ -481,7 +794,9 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @return      $count  Count of all criteria entries
         */
        public final function countExclude () {
-               return $this->count('exclude');
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-CRITERIA: CALLED!');
+               return $this->count(Criteria::CRITERIA_TYPE_EXCLUDE);
        }
 
 }
index d05befee51ef65afb23b270168e17ea49dba2463..88e49dda27759a5b441dbe6592140d743bebd966 100644 (file)
@@ -6,9 +6,10 @@ namespace Org\Mxchange\CoreFramework\Criteria\DataSet;
 use Org\Mxchange\CoreFramework\Criteria\BaseCriteria;
 use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
-use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 
 // Import SPL stuff
+use \BadMethodCallException;
 use \InvalidArgumentException;
 
 /**
@@ -16,7 +17,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -78,9 +79,10 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         */
        public static final function createDataSetCriteria (string $tableName) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATA-SET-CRITERIA: tableName=%s - CALLED!', $tableName));
                if (empty($tableName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "tableName" is empty');
+                       throw new InvalidArgumentException('Parameter "tableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get a new instance
@@ -90,6 +92,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
                $criteriaInstance->setTableName($tableName);
 
                // Return the instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATA-SET-CRITERIA: criteriaInstance=%s - EXIT!', $criteriaInstance->__toString()));
                return $criteriaInstance;
        }
 
@@ -184,19 +187,19 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         * Getter for unique key value
         *
         * @return      $uniqueValue    Value of the unique key
+        * @throws      BadMethodCallException  If no primary and no unique key was found
         */
        public final function getUniqueValue () {
                // Get primary key(s) first
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATA-SET-CRITERIA: CALLED!');
                $primaryKey  = trim($this->getCriteriaElemnent($this->getPrimaryKey()));
                $primaryKeys = $this->getPrimaryKeys();
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-SET-CRITERIA: tableName=' . $this->getTableName() . ',primaryKey=' . $primaryKey . ',primaryKeys()=' . count($primaryKeys));
-
                /*
                 * If this is not set, this could mean a badly written frontend as
                 * tables should always have a primary key.
                 */
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('DATA-SET-CRITERIA: this->tableName=%s,primaryKey=%s,primaryKeys()=%d', $this->getTableName(), $primaryKey, count($primaryKeys)));
                if (count($primaryKeys) > 0) {
                        /*
                         * Init return value, this can be put all together without any
@@ -206,37 +209,38 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
                        $return = '';
 
                        // Combination set, so get all
-                       foreach ($primaryKeys as $primaryKey) {
+                       foreach ($primaryKeys as $primaryKeyPart) {
                                // Add it
-                               $return .= trim($this->getCriteriaElemnent($primaryKey));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('DATA-SET-CRITERIA: primaryKeyPart=%s', $primaryKeyPart));
+                               $return .= trim($this->getCriteriaElemnent($primaryKeyPart));
                        }
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-SET-CRITERIA: tableName=' . $this->getTableName() . ',return=' . $return . ' - EXIT!');
 
                        // Return it
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATA-SET-CRITERIA: return=%s - EXIT!', $return));
                        return $return;
                } elseif (!empty($primaryKey)) {
                        // Return primary key
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATA-SET-CRITERIA: primaryKey=%s - EXIT!', $primaryKey));
                        return $primaryKey;
                } else {
-                       // @TODO Issue a warning
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-SET-CRITERIA: Primary key not set for table ' . $this->getTableName() . ', please fix your table. Falling back to unique key ...');
+                       // Issue a warning
+                       self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('DATA-SET-CRITERIA: Primary key not set for table ' . $this->getTableName() . ', please fix your table. Falling back to unique key ...');
 
                        // Get unique key
                        $uniqueKey = trim($this->getCriteriaElemnent($this->getUniqueKey()));
 
-                       // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-SET-CRITERIA: tableName=' . $this->getTableName() . ',uniqueKey=' . $uniqueKey);
-
                        // Is it empty, too?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('DATA-SET-CRITERIA: uniqueKey=%s', $uniqueKey));
                        if (empty($uniqueKey)) {
                                // Bad news, nothing is "unique" by design for this table
-                               ApplicationEntryPoint::exitApplication('Table ' . $this->getTableName() . ' has both no primary and unique key, but ' . __METHOD__ . ' was called. Please fix your table.');
-                       } else {
-                               // Return unique key
-                               return $uniqueKey;
+                               throw new BadMethodCallException(sprintf('Table %s has both no primary and unique key, but %s was called. Please fix your table.', $this->getTableName(), __METHOD__), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                        }
+
+                       // Return unique key
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATA-SET-CRITERIA: uniqueKey=%s - EXIT!', $uniqueKey));
+                       return $uniqueKey;
                }
        }
 
@@ -247,14 +251,18 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         */
        public final function getPrimaryKey () {
                // Get primary key by default
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATA-SET-CRITERIA: CALLED!');
                $primaryKey = $this->primaryKey;
 
+               // Is it still empty?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('DATA-SET-CRITERIA: primaryKey=%s', $primaryKey));
                if (empty($primaryKey)) {
                        // Get uniqueKey
                        $primaryKey = $this->getUniqueKey();
                }
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATA-SET-CRITERIA: primaryKey=%s - EXIT!', $primaryKey));
                return $primaryKey;
        }
 
index eab26c60ffd71a3a95bcf5660b67ea4753f61638..7234fb23166c6e9bd86d669c98affac39eebd4e2 100644 (file)
@@ -6,9 +6,11 @@ namespace Org\Mxchange\CoreFramework\Criteria\Search;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Criteria\BaseCriteria;
 use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 
 // Import SPL stuff
 use \InvalidArgumentException;
+use \UnexpectedValueException;
 
 /**
  * Search criteria for e.g. searching in databases. Do not use this class if
@@ -17,7 +19,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -67,9 +69,11 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
         */
        public static final function createSearchCriteria () {
                // Get a new instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SEARCH-CRITERIA: CALLED!');
                $criteriaInstance = new SearchCriteria();
 
                // Return this instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: criteriaInstance=%s - EXIT!', $criteriaInstance->__toString()));
                return $criteriaInstance;
        }
 
@@ -87,13 +91,27 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
        /**
         * "Setter" for limit from a configuration entry
         *
-        * @param       $configEntry    The configuration entry which hold a number as limit
+        * @param       $configKey      The configuration entry which hold a number as limit
         * @return      void
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
-       public final function setConfiguredLimit (string $configEntry) {
-               // Get the limit from config entry and set it
-               $limit = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
+       public final function setConfiguredLimit (string $configKey) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: configKey=%s - CALLED!', $configKey));
+               if (empty($configKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "configKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Get the limit from config entry
+               $limit = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configKey);
+
+               // And set it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: limit=%d', $limit));
                $this->setLimit($limit);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SEARCH-CRITERIA: EXIT!');
        }
 
        /**
@@ -134,29 +152,33 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
         * @param       $separator              Separator for "exploding" $value (default: ',')
         * @return      $isMatching             Whether the key/value is matching or excluded
         * @throws      InvalidArgumentException        If a parameter is invalid
+        * @throws      UnexpectedValueException        If $searchChoice is not an array
         */
        public function isCriteriaMatching (string $key, $value, string $separator = ',') {
                // $key/$value cannot be array/NULL/bool, value can be NULL but then NULL must be loocked for
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SEARCH-CRITERIA: key=%s,value[]=%s,separator=%s - CALLED!', $key, gettype($value), $separator));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: key=%s,value[]=%s,separator=%s - CALLED!', $key, gettype($value), $separator));
                if (empty($key)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "key" is empty');
-               } elseif (is_array($value) || is_bool($value) || is_bool($value) || is_object($value) || is_resource($value)) {
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (is_array($value) || is_bool($value) || is_object($value) || is_resource($value)) {
                        // Throw it again
                        throw new InvalidArgumentException(sprintf('value[]=%s is not supported/valid', gettype($value)));
                } elseif (empty($separator)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "separator" is empty');
+                       throw new InvalidArgumentException('Parameter "separator" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // "Explode" value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: Invoking explode("%s",value[]=%s) ...', $separator, gettype($value)));
                $valueArray = explode($separator, $value);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: valueArray()=%d', count($valueArray)));
 
                // Get 'default' search value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: Invoking this->getCriteriaElemnent(%s) ...', $key));
                $searchDefault = $this->getCriteriaElemnent($key);
 
                // 'default' check
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: searchDefault[%s]=%s', gettype($searchDefault), $searchDefault));
                $isMatching = (
                        (
                                (
@@ -172,52 +194,58 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                );
 
                // Get 'choice' search value (can be NULL or $separator-separated string)
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault . ',isMatching=' . intval($isMatching));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: isMatching=%d', intval($isMatching)));
                $searchChoice = $this->getCriteriaChoiceElemnent($key);
 
-               // May be false or array
-               assert(($searchChoice === false) || (is_array($searchChoice)));
+               // Is an array returned?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: searchChoice[]=%s', gettype($searchChoice)));
+               if (!is_array($searchChoice) && !is_bool($searchChoice)) {
+                       // Should not happen
+                       throw new UnexpectedValueException(sprintf('searchChoice[]=%s is unexpected', gettype($searchChoice)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
 
                // 'choice' check
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[' . gettype($searchChoice) . ']=' . print_r($searchChoice, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: searchChoice[]=%s', gettype($searchChoice)));
                if ((is_array($searchChoice)) && (count($valueArray) == 1)) {
                        // $value is a single-search value, so use in_[]
                        $isMatching = ((($isMatching === true) || (($searchDefault === false) && (!is_null($value)))) && (in_array($value, $searchChoice)));
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - SINGLE-MATCH');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: isMatching=%d - SINGLE-MATCH', intval($isMatching)));
                } elseif ((is_array($searchChoice)) && (count($valueArray) > 1)) {
-                       // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[]=' . count($valueArray) . ',isMatching=' . intval($isMatching));
-
                        // $value is choice-search value, so check all entries
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: searchChoice()=%d,valueArray()=%d - MULTI-MATCH', count($searchChoice), count($valueArray)));
                        $isMatching = (($isMatching === true) || (($searchDefault === false) && (!is_null($value))));
-                       $idx = 0;
-                       foreach ($valueArray as $idx => $match) {
-                               // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: match=' . $match . ',count(searchChoice)=' . count($searchChoice));
 
+                       // Loop through all values
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: isMatching=%d - BEFORE!', intval($isMatching)));
+                       foreach ($valueArray as $idx => $match) {
                                // Is it found? (one is okay)
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: idx=%d,match=%s', $idx, $match));
                                $isMatching = (($isMatching === true) && (in_array($match, $searchChoice)));
 
-                               // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: match=' . $match . ',isMatching=' . intval($isMatching));
+                               // No longer matching?
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: isMatching=%d - LOOP!', intval($isMatching)));
+                               if (!$isMatching) {
+                                       // Skip further iterations
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SEARCH-CRITERIA: BREAK!');
+                                       break;
+                               }
                        }
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[]=' . count($valueArray) . ',idx=' . $idx . ',isMatching=' . intval($isMatching) . ' - CHOICE-MATCH');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: isMatching=%d - AFTER!', intval($isMatching)));
                } else {
                        // Choice-match is false
-                       // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - false-MATCH');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: key=%s[],searchChoice[]=%s,value[%s]=%s,isMatching=%d - FALSE-MATCH', $key, gettype($searchChoice), gettype($value), $value, intval($isMatching)));
                }
 
                // Get 'exclude' search value
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',isMatching=' . intval($isMatching));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: Invoking this->getCriteriaExcludeElemnent(%s) ...', $key));
                $searchExclude = $this->getCriteriaExcludeElemnent($key);
 
                // 'exclude' check
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaExcludeElement(' . $key . ')[' . gettype($searchExclude) . ']=' . $searchExclude);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SEARCH-CRITERIA: searchExclude[%s]=%s', gettype($searchExclude), $searchExclude));
                $isMatching = (
                        (
                                (
@@ -239,7 +267,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                );
 
                // Return result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: key=' . $key . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: isMatching=%d - EXIT!', intval($isMatching)));
                return $isMatching;
        }
 
index 9a094ad5c8be904d80ff27636b38218e99e1ea30..f177543c87567aea3f464659b31a9bebd22eded2 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Criteria\Local\LocalUpdateCriteria;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -54,9 +54,11 @@ class UpdateCriteria extends BaseCriteria implements LocalUpdateCriteria {
         */
        public static final function createUpdateCriteria () {
                // Get a new instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('UPDATE-CRITERIA: CALLED!');
                $criteriaInstance = new UpdateCriteria();
 
                // Return this instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SEARCH-CRITERIA: criteriaInstance=%s - EXIT!', $criteriaInstance->__toString()));
                return $criteriaInstance;
        }
 
index da82e36a3cebe0dfd57574431a7a53243bc1cba5..e913a91bc05d2f89ee79418d449043a52d6f6a70 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -73,15 +73,19 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         */
        public static final function createCryptoHelper () {
                // Get a new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPTO-HELPER: CALLED!');
                $cryptoInstance = new CryptoHelper();
 
                // Initialize the hasher
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPTO-HELPER: Invoking cryptoInstance->initHasher() ...');
                $cryptoInstance->initHasher();
 
                // Attach a crypto stream
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPTO-HELPER: Invoking cryptoInstance->attachCryptoStream() ...');
                $cryptoInstance->attachCryptoStream();
 
                // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPTO-HELPER: cryptoInstance=%s - EXIT!', $cryptoInstance->__toString()));
                return $cryptoInstance;
        }
 
@@ -92,12 +96,14 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         */
        public static final function getSelfInstance () {
                // Is no instance there?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPTO-HELPER: self::selfInstance[]=%s - CALLED!', gettype(self::$selfInstance)));
                if (is_null(self::$selfInstance)) {
                        // Then get a new one
                        self::$selfInstance = self::createCryptoHelper();
                }
 
                // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPTO-HELPER: self::selfInstance=%s - EXIT!', self::$selfInstance->__toString()));
                return self::$selfInstance;
        }
 
@@ -128,17 +134,20 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         */
        protected function attachCryptoStream () {
                // @TODO Maybe rewrite this with DirectoryIterator, similar to Compressor thing?
-               // Do we have openssl/mcrypt loaded?
-               if ($this->isPhpExtensionLoaded('mcrypt')) {
+               // Do we have openssl loaded?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPTO-HELPER: CALLED!');
+               if ($this->isPhpExtensionLoaded('openssl')) {
                        // Then use it
-                       $this->cryptoStreamInstance = ObjectFactory::createObjectByConfiguredName('crypto_mcrypt_stream_class', array($this->getRngInstance()));
-               } elseif ($this->isPhpExtensionLoaded('openssl')) {
-                       // Then use it
-                       $this->cryptoStreamInstance = ObjectFactory::createObjectByConfiguredName('crypto_openssl_stream_class', array($this->getRngInstance()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CRYPTO-HELPER: Attaching openssl crypto stream ...');
+                       $this->cryptoStreamInstance = ObjectFactory::createObjectByConfiguredName('crypto_openssl_stream_class', [$this->getRngInstance()]);
                } else {
                        // If nothing works ...
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CRYPTO-HELPER: Attaching NULL crypto stream ...');
                        $this->cryptoStreamInstance = ObjectFactory::createObjectByConfiguredName('crypto_null_stream_class');
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPTO-HELPER: EXIT!');
        }
 
        /**
index 82d1dfc5ce5938aaebd40809845d410c21eb3ef3..fd1f54244812e29a729b67d067d0ac98adaaa99a 100644 (file)
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  * @see                        DatabaseBackend - An interface for database backends
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 964c1b738821f549fbcb79f68676d41f5b25a24f..b82baad5ff36d5966d0c7005dba324fd4db72e10 100644 (file)
@@ -10,17 +10,19 @@ use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
 use Org\Mxchange\CoreFramework\Database\Backend\BaseDatabaseBackend;
 use Org\Mxchange\CoreFramework\Database\Backend\DatabaseBackend;
 use Org\Mxchange\CoreFramework\Database\Sql\SqlException;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Generic\FrameworkException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Result\Database\BaseDatabaseResult;
 use Org\Mxchange\CoreFramework\Traits\Compressor\Channel\CompressorChannelTrait;
 use Org\Mxchange\CoreFramework\Traits\Handler\Io\IoHandlerTrait;
 
 // Import SPL stuff
+use \BadMethodCallException;
 use \InvalidArgumentException;
 use \SplFileInfo;
-use \UnexpectedValueException;
 
 /**
  * Database backend class for storing objects in locally created files.
@@ -33,7 +35,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -110,6 +112,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        public static final function createCachedLocalFileDatabase () {
                // Get an instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: CALLED!');
                $databaseInstance = new CachedLocalFileDatabase();
 
                // Set the compressor channel
@@ -122,6 +125,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                $databaseInstance->connectToDatabase();
 
                // Return database instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: databaseInstance=%s - EXIT!', $databaseInstance->__toString()));
                return $databaseInstance;
        }
 
@@ -191,19 +195,25 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        private function getDataArrayFromFile (SplFileInfo $infoInstance) {
                // Init compressed data
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Reading elements from database file ' . $infoInstance . ' ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: infoInstance=%s - CALLED!', $infoInstance->__toString()));
                $compressedData = $this->getFileIoInstance()->loadFileContents($infoInstance);
-               $compressedData = $compressedData['data'];
+
+               // Is it valid?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LOCAL-FILE-DATABASE: compressedData[]=%s', gettype($compressedData)));
+               //* DEBUG-DIE: */ die(sprintf('[%s:%d]: compressedData=%s', __METHOD__, __LINE__, print_r($compressedData, TRUE)));
+               if (!isset($compressedData['data'])) {
+                       // Important element not found
+                       ApplicationEntryPoint::exitApplication(sprintf('compressedData()=%d has no element "data"', count($compressedData)), FrameworkInterface::EXCEPTION_OUT_OF_BOUNDS);
+               }
 
                // Decompress it
-               $serializedData = $this->getCompressorChannelInstance()->getCompressor()->decompressStream($compressedData);
+               $serializedData = $this->getCompressorChannelInstance()->getCompressor()->decompressStream($compressedData['data']);
 
                // Unserialize it
                $dataArray = json_decode($serializedData, true);
 
                // Finally return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Read ' . count($dataArray) . ' elements from database file ' . $infoInstance . '.');
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: dataArray=' . print_r($dataArray, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataArray()=%d - EXIT!', count($dataArray)));
                return $dataArray;
        }
 
@@ -216,16 +226,15 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        private function writeDataArrayToFqfn (SplFileInfo $infoInstance, array $dataArray) {
                // Serialize and compress it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Flushing ' . count($dataArray) . ' elements to database file ' . $infoInstance . ' ...');
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: dataArray=' . print_r($dataArray, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: Flushing ' . count($dataArray) . ' elements to database file ' . $infoInstance . ' ...');
                $compressedData = $this->getCompressorChannelInstance()->getCompressor()->compressStream(json_encode($dataArray));
 
                // Write this data BASE64 encoded to the file
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Writing ' . strlen($compressedData) . ' bytes ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LOCAL-FILE-DATABASE: Writing ' . strlen($compressedData) . ' bytes ...');
                $this->getFileIoInstance()->saveStreamToFile($infoInstance, $compressedData, $this);
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Flushing ' . count($dataArray) . ' elements to database file completed.');
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: Flushing ' . count($dataArray) . ' elements to database file completed.');
        }
 
        /**
@@ -236,12 +245,14 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        private function getContentsFromTableInfoFile (StoreableCriteria $dataSetInstance) {
                // Default content is no data
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                $infoArray = [];
 
                // Create FQFN for getting the table information file
                $infoInstance = $this->generateFileFromDataSet($dataSetInstance, 'info');
 
                // Get the file contents
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: infoInstance=%s', $infoInstance->__toString()));
                try {
                        $infoArray = $this->getDataArrayFromFile($infoInstance);
                } catch (FileNotFoundException $e) {
@@ -249,6 +260,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                }
 
                // ... and return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: infoArray()=%d - EXIT!', count($infoArray)));
                return $infoArray;
        }
 
@@ -261,9 +273,11 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        private function generateFileFromDataSet (Criteria $dataSetInstance, string $rowName) {
                // Instanciate new file object
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataSetInstance=%s,rowName=%s - CALLED!', $dataSetInstance->__toString(), $rowName));
                $infoInstance = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . DIRECTORY_SEPARATOR . $rowName . '.' . $this->getFileExtension());
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: infoInstance=%s - EXIT!', $infoInstance->__toString()));
                return $infoInstance;
        }
 
@@ -274,18 +288,27 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         * @return      void
         */
        private function createTableInfoFile (StoreableCriteria $dataSetInstance) {
-               // Create FQFN for creating the table information file
-               $infoInstance = $this->generateFileFromDataSet($dataSetInstance, 'info');
+               // Get table name
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
+               $tableName = $dataSetInstance->getTableName();
 
                // Get the data out from dataset in a local array
-               $this->tableInfo[$dataSetInstance->getTableName()] = array(
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: tableName=%', $tableName));
+               $this->tableInfo[$tableName] = [
                        'primary'      => $dataSetInstance->getPrimaryKey(),
                        'created'      => time(),
-                       'last_updated' => time()
-               );
+                       'last_updated' => time(),
+               ];
+
+               // Get info instance
+               $infoInstance = $this->generateFileFromDataSet($dataSetInstance, 'info');
 
                // Write the data to the file
-               $this->writeDataArrayToFqfn($infoInstance, $this->tableInfo[$dataSetInstance->getTableName()]);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: Invoking this->writeDataArrayToFqfn(%s,this->tableInfo[%s]()=%d) ...', $infoInstance->__toString(), $tableName, count($this->tableInfo[$tableName])));
+               $this->writeDataArrayToFqfn($infoInstance, $this->tableInfo[$tableName]);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: EXIT!');
        }
 
        /**
@@ -296,17 +319,24 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        private function updateTableInfoFile (StoreableCriteria $dataSetInstance) {
                // Get table name from criteria
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                $tableName = $dataSetInstance->getTableName();
 
                // Create FQFN for creating the table information file
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: tableName=%', $tableName));
                $infoInstance = $this->generateFileFromDataSet($dataSetInstance, 'info');
 
                // Get the data out from dataset in a local array
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: infoInstance=%s', $infoInstance->__toString()));
                $this->tableInfo[$tableName]['primary']      = $dataSetInstance->getPrimaryKey();
                $this->tableInfo[$tableName]['last_updated'] = time();
 
                // Write the data to the file
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: Invoking this->writeDataArrayToFqfn(%s,this->tableInfo[%s]()=%d) ...', $infoInstance->__toString(), $tableName, count($this->tableInfo[$tableName])));
                $this->writeDataArrayToFqfn($infoInstance, $this->tableInfo[$tableName]);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: EXIT!');
        }
 
        /**
@@ -317,31 +347,31 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        private function updatePrimaryKey (StoreableCriteria $dataSetInstance) {
                // Get table name from criteria
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                $tableName = $dataSetInstance->getTableName();
 
                // Get the information array from lower method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: tableName=%s', $tableName));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LOCAL-FILE-DATABASE: tableName=%s', $tableName));
                $infoArray = $this->getContentsFromTableInfoFile($dataSetInstance);
 
                // Is the primary key there?
-               //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: tableInfo=' . print_r($this->tableInfo, true));
+               //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LOCAL-FILE-DATABASE: tableInfo=' . print_r($this->tableInfo, true));
                if (!isset($this->tableInfo[$tableName]['primary'])) {
                        // Then create the info file
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Creating info table for tableName=%s ...', $tableName));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LOCAL-FILE-DATABASE: Creating info table for tableName=%s ...', $tableName));
                        $this->createTableInfoFile($dataSetInstance);
-               } elseif ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('db_update_primary_forced') == 'Y') && ($dataSetInstance->getPrimaryKey() != $this->tableInfo[$tableName]['primary'])) {
+               } elseif (FrameworkBootstrap::getConfigurationInstance()->isEnabled('db_update_primary_forced') && $dataSetInstance->getPrimaryKey() != $this->tableInfo[$tableName]['primary']) {
                        // Set the array element
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Setting primaryKey=%s for tableName=%s ...', $dataSetInstance->getPrimaryKey(), $tableName));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LOCAL-FILE-DATABASE: Setting primaryKey=%s for tableName=%s ...', $dataSetInstance->getPrimaryKey(), $tableName));
                        $this->tableInfo[$tableName]['primary'] = $dataSetInstance->getPrimaryKey();
 
                        // Update the entry
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Updating info table for tableName=%s ...', $tableName));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LOCAL-FILE-DATABASE: Updating info table for tableName=%s ...', $tableName));
                        $this->updateTableInfoFile($dataSetInstance);
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: EXIT!');
        }
 
        /**
@@ -351,6 +381,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         * @todo        Do some checks on the database directory and files here
         */
        public function connectToDatabase () {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: CALLED!');
        }
 
        /**
@@ -366,10 +397,10 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        public function querySelect (string $tableName, LocalSearchCriteria $searchInstance) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: tableName=%s,searchInstance=%s - CALLED!', $tableName, $searchInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: tableName=%s,searchInstance=%s - CALLED!', $tableName, $searchInstance->__toString()));
                if (empty($tableName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "tableName" is empty');
+                       throw new InvalidArgumentException('Parameter "tableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!isset($this->pathNames[$tableName])) {
                        // "Cache" is not present, so create and assign it
                        $this->pathNames[$tableName] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
@@ -384,13 +415,14 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                 */
                try {
                        // Get a directory pointer instance
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Getting directory_class for this->pathNames[%s]=%s ...', $tableName, $this->pathNames[$tableName]));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: Getting directory_class for this->pathNames[%s]=%s ...', $tableName, $this->pathNames[$tableName]));
                        $directoryInstance = ObjectFactory::createObjectByConfiguredName('directory_class', [$this->pathNames[$tableName]]);
 
                        // Initialize the result data, this need to be rewritten e.g. if a local file cannot be read
                        $resultData = [
-                               BaseDatabaseResult::RESULT_NAME_STATUS => self::RESULT_OKAY,
-                               BaseDatabaseResult::RESULT_NAME_ROWS   => []
+                               BaseDatabaseResult::RESULT_NAME_STATUS    => self::RESULT_OKAY,
+                               BaseDatabaseResult::RESULT_NAME_ROWS      => [],
+                               BaseDatabaseResult::RESULT_NAME_EXCEPTION => NULL,
                        ];
 
                        // Initialize limit/skip
@@ -401,10 +433,10 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                        // Read the directory with some exceptions
                        while (($fileInfoInstance = $directoryInstance->readDirectoryExcept(['.gitkeep', 'info.' . $this->getFileExtension()])) && (($limitFound < $searchInstance->getLimit()) || ($searchInstance->getLimit() == 0))) {
                                // Does the extension match?
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: fileInfoInstance->extension=%s,this->fileExtension=%s', $fileInfoInstance->getExtension(), $this->getFileExtension()));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->extension=%s,this->fileExtension=%s', $fileInfoInstance->getExtension(), $this->getFileExtension()));
                                if ($fileInfoInstance->getExtension() !== $this->getFileExtension()) {
                                        // Skip this file!
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Skipping fileInfoInstance->filename=%s ...', $fileInfoInstance->getFilename()));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: Skipping fileInfoInstance->filename=%s ...', $fileInfoInstance->getFilename()));
                                        $directoryInstance->getDirectoryIteratorInstance()->next();
                                        continue;
                                }
@@ -413,24 +445,24 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                $dataArray = $this->getDataArrayFromFile($fileInfoInstance);
 
                                // Is this an array?
-                               //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: fileInfoInstance.pathname=' . $fileInfoInstance->getPathname() . ',dataArray='.print_r($dataArray, true));
+                               //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->pathname=' . $fileInfoInstance->getPathname() . ',dataArray='.print_r($dataArray, true));
                                if (is_array($dataArray)) {
                                        // Default is nothing found
                                        $isFound = true;
 
                                        // Search in the criteria with FMFW (First Matches, First Wins)
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: data[]=%d', count($dataArray)));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: data[]=%d', count($dataArray)));
                                        foreach ($dataArray as $key => $value) {
                                                // Found one entry?
                                                $isFound = ($isFound && $searchInstance->isCriteriaMatching($key, $value));
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: key=%s,value[%s]=%s,isFound=%s', $key, gettype($value), $value, intval($isFound)));
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: key=%s,value[%s]=%s,isFound=%s', $key, gettype($value), $value, intval($isFound)));
                                        }
 
                                        // Is all found?
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: isFound=%d,limitFound=%d,limit=%d', intval($isFound), $limitFound, $searchInstance->getLimit()));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: isFound=%d,limitFound=%d,limit=%d', intval($isFound), $limitFound, $searchInstance->getLimit()));
                                        if ($isFound === true) {
                                                // Shall we skip this entry?
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: searchInstance->skip=%d,skipFound=%d', $searchInstance->getSkip(), $skipFound));
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: searchInstance->skip=%d,skipFound=%d', $searchInstance->getSkip(), $skipFound));
                                                if ($searchInstance->getSkip() > 0 && $skipFound < $searchInstance->getSkip()) {
                                                        // Skip this entry
                                                        $skipFound++;
@@ -438,14 +470,14 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                }
 
                                                // Set id number
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Setting dataArray[%s]=%d', $this->getIndexKey(), $idx));
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: Setting dataArray[%s]=%d', $this->getIndexKey(), $idx));
                                                $dataArray[$this->getIndexKey()] = $idx;
 
                                                // Entry found!
                                                array_push($resultData[BaseDatabaseResult::RESULT_NAME_ROWS], $dataArray);
 
                                                // Count found entries up
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: resultData[%s]()=%d', BaseDatabaseResult::RESULT_NAME_ROWS, count($resultData[BaseDatabaseResult::RESULT_NAME_ROWS])));
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: resultData[%s]()=%d', BaseDatabaseResult::RESULT_NAME_ROWS, count($resultData[BaseDatabaseResult::RESULT_NAME_ROWS])));
                                                $limitFound++;
                                        }
                                } else {
@@ -478,6 +510,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                }
 
                // Return the gathered result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: resultData()=%d - EXIT!', count($resultData)));
                return $resultData;
        }
 
@@ -490,7 +523,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        public function queryInsertDataSet (StoreableCriteria $dataSetInstance) {
                // Try to save the request away
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                try {
                        // Create full path name
                        $infoInstance = $this->generateFileFromDataSet($dataSetInstance, md5($dataSetInstance->getUniqueValue()));
@@ -522,7 +555,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: EXIT!');
        }
 
        /**
@@ -530,17 +563,19 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         *
         * @param       $dataSetInstance        An instance of a StorableCriteria class
         * @return      void
-        * @throws      UnexpectedValueException        If $tableName is empty
+        * @throws      InvalidArgumentException        If $tableName is empty
         * @throws      SqlException    If an SQL error occurs
         */
        public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
                // Get table name
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                $tableName = $dataSetInstance->getTableName();
 
                // Is "cache" there?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: tableName=%s', $tableName));
                if (empty($tableName)) {
                        // Should never be an empty string
-                       throw new UnexpectedValueException('Class field dataSetInstance->tableName is empty');
+                       throw new InvalidArgumentException('Class field dataSetInstance->tableName is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!isset($this->pathNames[$tableName])) {
                        // "Cache" is not present, so create and assign it
                        $this->pathNames[$tableName] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
@@ -559,24 +594,26 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                        $searchArray = $dataSetInstance->getCriteriaArray();
 
                        // Get search criteria
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: searchArray()=%d', count($searchArray)));
                        $searchInstance = $dataSetInstance->getSearchInstance();
 
                        // Read the directory with some exceptions
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: searchInstance=%s', $searchInstance->__toString()));
                        while (($fileInfoInstance = $directoryInstance->readDirectoryExcept(['.gitkeep', 'info.' . $this->getFileExtension()])) && (($limitFound < $searchInstance->getLimit()) || ($searchInstance->getLimit() == 0))) {
                                // Does the extension match?
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: fileInfoInstance->extension=' . $fileInfoInstance->getExtension() . ',this->getFileExtension()=' . $this->getFileExtension());
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->extension=%s,this->fileExtension=%s', $fileInfoInstance->getExtension(), $this->getFileExtension()));
                                if ($fileInfoInstance->getExtension() !== $this->getFileExtension()) {
                                        // Skip this file!
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: fileInfoInstance.extension=' . $fileInfoInstance->getExtension() . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!');
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->extension=%s,this->fileExtension=%s - SKIPPED!', $fileInfoInstance->getExtension(), $this->getFileExtension()));
                                        $directoryInstance->getDirectoryIteratorInstance()->next();
                                        continue;
                                }
 
                                // Open this file for reading
                                $dataArray = $this->getDataArrayFromFile($fileInfoInstance);
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: fileInfoInstance.pathname=' . $fileInfoInstance->getPathname() . ',dataArray='.print_r($dataArray, true));
 
                                // Is this an array?
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->pathname=' . $fileInfoInstance->getPathname() . ',dataArray='.print_r($dataArray, true));
                                if (is_array($dataArray)) {
                                        // Default is nothing found
                                        $isFound = true;
@@ -584,18 +621,19 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                        foreach ($dataArray as $key => $value) {
                                                // Found one entry?
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: isFound=%d,key=%s,value[]=%s', intval($isFound), $key, gettype($value)));
                                                $isFound = (($isFound === true) && ($searchInstance->isCriteriaMatching($key, $value)));
                                        }
 
                                        // Is all found?
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: isFound=' . intval($isFound));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: isFound=%s', intval($isFound)));
                                        if ($isFound === true) {
                                                // Shall we skip this entry?
                                                if ($searchInstance->getSkip() > 0) {
                                                        // We shall skip some entries
                                                        if ($skipFound < $searchInstance->getSkip()) {
                                                                // Skip this entry
-                                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Found entry, but skipping ...');
+                                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-LOCAL-FILE-DATABASE: Found entry, but skipping ...');
                                                                $skipFound++;
                                                                break;
                                                        }
@@ -604,16 +642,17 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                // Entry found, so update it
                                                foreach ($searchArray as $searchKey => $searchValue) {
                                                        // Make sure the value is not bool again
+                                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: searchKey=%s,searchValue[]=%s', $searchKey, gettype($searchValue)));
                                                        assert(!is_bool($searchValue));
-                                                       assert($searchKey != $this->indexKey);
+                                                       assert($searchKey != $this->getIndexKey());
 
                                                        // Debug message + add/update it
-                                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: criteriaKey=' . $searchKey . ',criteriaValue=' . $searchValue);
+                                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: criteriaKey=%s,criteriaValue[%s]=%s', $searchKey, gettype($searchValue), $searchValue));
                                                        $dataArray[$searchKey] = $searchValue;
                                                }
 
                                                // Write the data to a local file
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Writing data[]=' . count($dataArray) . ' to ' . $fileInfoInstance->getPathname() . ' ...');
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: Writing data()=%d to %s ...', count($dataArray), $fileInfoInstance->getPathname()));
                                                $this->writeDataArrayToFqfn($fileInfoInstance, $dataArray);
 
                                                // Count found entries up
@@ -622,10 +661,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                }
 
                                // Advance to next entry
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: Invoking directoryInstance->directoryIteratorInstance->next() ...');
                                $directoryInstance->getDirectoryIteratorInstance()->next();
                        }
 
                        // Close the file pointer
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: Invoking directoryInstance->closeDirectory() ...');
                        $directoryInstance->closeDirectory();
 
                        // Update the primary key
@@ -635,11 +676,15 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                        $this->resetLastException();
                } catch (FrameworkException $e) {
                        // Catch all exceptions and store them in last error
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: e=%s,e->code=%d,e->message=%s', $e->__toString(), $e->getCode(), $e->getMessage()));
                        $this->setLastException($e);
 
                        // Throw an SQL exception
                        throw new SqlException(array($this, sprintf('Cannot write data to table &#39;%s&#39;, is the table created? Exception: %s, message:%s', $dataSetInstance->getTableName(), $e->__toString(), $e->getMessage()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-LOCAL-FILE-DATABASE: EXIT!');
        }
 
        /**
@@ -653,9 +698,10 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        public function getPrimaryKeyOfTable (string $tableName) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: tableName=%s - CALLED!', $tableName));
                if (empty($tableName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "tableName" is empty');
+                       throw new InvalidArgumentException('Parameter "tableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Default key is null
@@ -668,6 +714,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                }
 
                // Return the column
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: primaryKey[%s]=%s - EXIT!', gettype($primaryKey), $primaryKey));
                return $primaryKey;
        }
 
@@ -676,14 +723,22 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         *
         * @param       $data   An array with possible non-public data that needs to be removed.
         * @return      $data   A cleaned up array with only public data.
+        * @throws      BadMethodCallException  If some non-public is already not found but method was called
         * @todo        Add more generic non-public data for removal
         */
        public function removeNonPublicDataFromArray (array $data) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: data()=%d - CALLED!', count($data)));
+               if (!isset($data[$this->getIndexKey()])) {
+                       // Throw BMCE
+                       throw new BadMethodCallException(sprintf('data()=%d does not contain this->indexKey=%s', count($data), $this->getIndexKey()));
+               }
+
                // Remove '__idx'
-               unset($data[$this->indexKey]);
+               unset($data[$this->getIndexKey()]);
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: data[' . gettype($data) . ']='.print_r($data, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: data()=%d - EXIT!', count($data)));
                return $data;
        }
 
@@ -696,17 +751,17 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        public function countTotalRows (string $tableName) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: tableName=' . $tableName . ' - CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: tableName=%s - CALLED!', $tableName));
                if (empty($tableName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "tableName" is empty');
+                       throw new InvalidArgumentException('Parameter "tableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!isset($this->pathNames[$tableName])) {
                        // "Cache" is not present, so create and assign it
                        $this->pathNames[$tableName] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
                }
 
                // Try all the requests
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: this->pathNames[%s]=%s', $tableName, $this->pathNames[$tableName]));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: this->pathNames[%s]=%s', $tableName, $this->pathNames[$tableName]));
                try {
                        // Get a file pointer instance
                        $directoryInstance = ObjectFactory::createObjectByConfiguredName('directory_class', [$this->pathNames[$tableName]]);
@@ -717,16 +772,16 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                        // Read the directory with some exceptions
                        while ($fileInfoInstance = $directoryInstance->readDirectoryExcept(['.gitkeep', 'info.' . $this->getFileExtension()])) {
                                // Does the extension match?
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: fileInfoInstance->extension=' . $fileInfoInstance->getExtension() . ',this->getFileExtension()=' . $this->getFileExtension());
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->extension=' . $fileInfoInstance->getExtension() . ',this->getFileExtension()=' . $this->getFileExtension());
                                if ($fileInfoInstance->getExtension() !== $this->getFileExtension()) {
                                        // Debug message
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: fileInfoInstance.extension=' . $fileInfoInstance->getExtension() . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!');
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->extension=' . $fileInfoInstance->getExtension() . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!');
                                        // Skip this file!
                                        continue;
                                }
 
                                // Count this row up
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: fileInfoInstance.pathname=' . $fileInfoInstance->getPathname() . ',getFileExtension()=' . $this->getFileExtension() . ' - COUNTED!');
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-LOCAL-FILE-DATABASE: fileInfoInstance->pathname=' . $fileInfoInstance->getPathname() . ',getFileExtension()=' . $this->getFileExtension() . ' - COUNTED!');
                                $count++;
                        }
                } catch (FrameworkException $e) {
@@ -738,7 +793,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                }
 
                // Return count
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: tableName=' . $tableName . ',count=' . $count . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-LOCAL-FILE-DATABASE: count=%d - EXIT!', $count));
                return $count;
        }
 
index 09ec526595e4b05253024d2b07d54fd2c9f5b139..e4b35064fe9a9cc16be2d145f68fc304eea6e8e8 100644 (file)
@@ -5,7 +5,7 @@
  * @see                        DatabaseBackendInterface - An interface for database backends
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0cb4dd54f4986add7711f3c237bfec3b38e209cb..69cf36b2fefe18f81eb43b3706af834b4ad88645 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  * @see                        DatabaseBackend - An interface for database backends
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2f4320ccf46da12e605b45d8b1c422f0d65a610e..78665d33715e5b278c642266ba10edaa117a4890 100644 (file)
@@ -12,12 +12,15 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Result\Database\BaseDatabaseResult;
 use Org\Mxchange\CoreFramework\Traits\Cache\CacheableTrait;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * A generic database frontend
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -47,6 +50,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         * "Cached" value 'database_cache_enabled' from configuration
         */
        private $databaseCacheEnabled = false;
+
        /**
         * Protected constructor
         *
@@ -55,10 +59,14 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
 
                // Initialize the cache instance
                $this->initCacheInstance();
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -68,13 +76,18 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        private final function initCacheInstance () {
                // Set "cache" attributes
-               $this->databaseCacheEnabled = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: CALLED!');
+               $this->databaseCacheEnabled = FrameworkBootstrap::getConfigurationInstance()->isEnabled('database_cache');
 
                // Is the cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === true) {
                        // Set the new instance
                        $this->setCacheInstance(ObjectFactory::createObjectByConfiguredName('cache_class'));
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -105,14 +118,14 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        protected function getCacheKeyByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) {
                // Generate it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: criteriaInstance=' . $criteriaInstance->__toString() . ',onlyKeys()=' . count($onlyKeys) . ' - CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
                $cacheKey = sprintf('%s@%s',
                        $this->__toString(),
                        $criteriaInstance->getCacheKey($onlyKeys)
                );
 
                // And return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: cacheKey=' . $cacheKey . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FRAMEWORK-SYSTEM: cacheKey=' . $cacheKey . ' - EXIT!');
                return $cacheKey;
        }
 
@@ -125,21 +138,22 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = []) {
                // Default cache key is NULL
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys)));
                $cacheKey = NULL;
 
                // Is cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRONTEND: Using cache key ' . $cacheKey . ' for purging ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: Using cache key %s for purging ...', $cacheKey));
                }
 
                // Does this key exists in cache?
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d,cacheKey[%s]=%s', intval($this->databaseCacheEnabled), gettype($cacheKey), $cacheKey));
                if (($this->databaseCacheEnabled === true) && ($this->getCacheInstance()->offsetExists($cacheKey))) {
                        // Purge the cache
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Calling this->cacheInstance->purgeOffset(%s) ...', $cacheKey));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: Invoking this->cacheInstance->purgeOffset(%s) ...', $cacheKey));
                        $this->getCacheInstance()->purgeOffset($cacheKey);
                }
 
@@ -147,7 +161,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
                FrameworkBootstrap::getDatabaseInstance()->queryInsertDataSet($dataSetInstance);
 
                // Trace message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRONTEND: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -159,16 +173,19 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        protected function queryUpdateDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = []) {
                // Init cache key
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys)));
                $cacheKey = NULL;
 
                // Is cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRONTEND: Using cache key ' . $cacheKey . ' for purging ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('BASE-DATABASE-FRONTEND: Using cache key ' . $cacheKey . ' for purging ...');
                }
 
                // Does this key exists in cache?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d,cacheKey=%s', intval($this->databaseCacheEnabled), $cacheKey));
                if (($this->databaseCacheEnabled === true) && ($this->getCacheInstance()->offsetExists($cacheKey))) {
                        // Purge the cache
                        $this->getCacheInstance()->purgeOffset($cacheKey);
@@ -176,6 +193,9 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
 
                // Handle it over to the middleware
                FrameworkBootstrap::getDatabaseInstance()->queryUpdateDataSet($dataSetInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -184,6 +204,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         * @return      $indexKey       Index key
         */
        public final function getIndexKey () {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: CALLED!');
                return FrameworkBootstrap::getDatabaseInstance()->getIndexKey();
        }
 
@@ -193,6 +214,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         * @return      $lastException  Last exception or NULL if none occured
         */
        public final function getLastException () {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: CALLED!');
                return FrameworkBootstrap::getDatabaseInstance()->getLastException();
        }
 
@@ -206,52 +228,54 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        public function doSelectByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) {
                // Default cache key if cache is not enabled
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
                $cacheKey = NULL;
                $result = [];
 
                // Is the cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys);
                }
 
                // Does this key exists in cache?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d,cacheKey[%s]=%s', intval($this->databaseCacheEnabled), gettype($cacheKey), $cacheKey));
                if (($this->databaseCacheEnabled === true) && ($this->getCacheInstance()->offsetExists($cacheKey, BaseDatabaseResult::RESULT_NAME_ROWS, 1))) {
                        // Then use this result
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Cache used for cacheKey=%s', $cacheKey));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: Cache used for cacheKey=%s', $cacheKey));
                        $result = $this->getCacheInstance()->offsetGet($cacheKey);
                } else {
                        // Now it's time to ask the database layer for this select statement
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Quering database, cacheKey=%s ...', $cacheKey));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: Quering database, cacheKey=%s ...', $cacheKey));
                        $result = FrameworkBootstrap::getDatabaseInstance()->doSelectByTableCriteria($this->getTableName(), $criteriaInstance);
 
                        // Cache the result if not null
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: result[]=%s', gettype($result)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: result[]=%s', gettype($result)));
                        if (!is_null($result)) {
                                // Is cache enabled?
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                                if ($this->databaseCacheEnabled === true) {
                                        // A valid result has returned from the database layer
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Setting cacheKey=%s with result()=%d entries', $cacheKey, count($result)));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: Setting cacheKey=%s with result()=%d entries', $cacheKey, count($result)));
                                        $this->getCacheInstance()->offsetSet($cacheKey, $result);
                                }
                        } else {
                                // This invalid result must be wrapped
-                               $result = array(
+                               $result = [
                                        BaseDatabaseResult::RESULT_NAME_STATUS    => 'invalid',
-                                       BaseDatabaseResult::RESULT_NAME_EXCEPTION => FrameworkBootstrap::getDatabaseInstance()->getLastException()
-                               );
+                                       BaseDatabaseResult::RESULT_NAME_EXCEPTION => FrameworkBootstrap::getDatabaseInstance()->getLastException(),
+                               ];
                        }
                }
 
                // Create an instance of a CachedDatabaseResult class with the given result
                // @TODO Minor: Update above comment to e.g. BaseDatabaseResult
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: result[%s]=%s,result[%s]?=%d,result[%s]?=%d', BaseDatabaseResult::RESULT_NAME_STATUS, $result[BaseDatabaseResult::RESULT_NAME_STATUS], BaseDatabaseResult::RESULT_NAME_ROWS, isset($result[BaseDatabaseResult::RESULT_NAME_ROWS]), BaseDatabaseResult::RESULT_NAME_EXCEPTION, isset($result[BaseDatabaseResult::RESULT_NAME_EXCEPTION])));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: result[%s]=%s,result[%s]?=%d,result[%s]?=%d', BaseDatabaseResult::RESULT_NAME_STATUS, $result[BaseDatabaseResult::RESULT_NAME_STATUS], BaseDatabaseResult::RESULT_NAME_ROWS, isset($result[BaseDatabaseResult::RESULT_NAME_ROWS]), BaseDatabaseResult::RESULT_NAME_EXCEPTION, isset($result[BaseDatabaseResult::RESULT_NAME_EXCEPTION])));
                $resultInstance = ObjectFactory::createObjectByConfiguredName('database_result_class', array($result));
 
                // And return the instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: resultInstance=%s - EXIT!', $resultInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: resultInstance=%s - EXIT!', $resultInstance->__toString()));
                return $resultInstance;
        }
 
@@ -264,34 +288,36 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        public function doSelectCountByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) {
                // Total numbers is -1 so we can distinglish between failed and valid queries
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
                $numRows = 0;
 
                // Get the result from above method
                $resultInstance = $this->doSelectByCriteria($criteriaInstance, $onlyKeys);
 
                // Was that query fine?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-DATABASE-FRONTEND: resultInstance->ifStatusIsOkay()=%d', $resultInstance->ifStatusIsOkay()));
                if ($resultInstance->ifStatusIsOkay()) {
                        // Then get the number of rows
                        $numRows = $resultInstance->getAffectedRows();
-
-                       // Debug message
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRONTEND: numRows=' . $numRows);
                }
 
                // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: numRows=%d - EXIT!', $numRows));
                return $numRows;
        }
 
        /**
-        * Getter for primary key used in wrapped table
+        * Generates a primary key for this database frontend
         *
         * @return      $primaryKey             Primary key used in wrapped table
         */
-       public final function getPrimaryKeyValue () {
+       public final function generatePrimaryKey () {
                // Get the table name and a database instance and ask for it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: CALLED!');
                $primaryKey = FrameworkBootstrap::getDatabaseInstance()->getPrimaryKeyOfTable($this->getTableName());
 
                // Return value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: primaryKey=%s - EXIT!', $primaryKey));
                return $primaryKey;
        }
 
@@ -302,9 +328,11 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        public final function countTotalRows () {
                // Get the table name and a database instance and ask for it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-DATABASE-FRONTEND: CALLED!');
                $count = FrameworkBootstrap::getDatabaseInstance()->countTotalRows($this->getTableName());
 
                // Return value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: count=%d - EXIT!', $count));
                return $count;
        }
 
@@ -313,12 +341,21 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         *
         * @param       $data   An array with possible non-public data that needs to be removed.
         * @return      $data   A cleaned up array with only public data.
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function removeNonPublicDataFromArray (array $data) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('WRAPPER[' . $this->__toString() . ']: Calling FrameworkBootstrap::getDatabaseInstance()->removeNonPublicDataFromArray(data) ...');
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: data()=%d - CALLED!', count($data)));
+               if (count($data) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "data" is an empty array', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Remove non-public data (aka. sensitive)
                $data = FrameworkBootstrap::getDatabaseInstance()->removeNonPublicDataFromArray($data);
 
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('WRAPPER[' . $this->__toString() . ']: data[]=' . gettype($data));
+               // Return cleaned array
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-DATABASE-FRONTEND: data()=%d - EXIT!', count($data)));
                return $data;
        }
 
index b43354d89939e97e84813c94b57e288207f86d4a..d2adc2906eca0f4924eef2bb3dd66109e34727a0 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Registry\Registerable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Add missing own interface for public methods
index 4f594045094b72f8d19e029d883472e22b196775..cad152f658d88f6cae5c5977c75a50333bd8ac33 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Registry\Registerable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Add missing own interface for public methods
index 978e79ccc4f8e578d083f33ee0114f9d364fbfe9..fc8348ad678e588714ae206756c5349708415949 100644 (file)
@@ -17,7 +17,7 @@ use Org\Mxchange\CoreFramework\Result\Update\UpdateableResult;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -113,7 +113,7 @@ class UserDatabaseFrontend extends BaseDatabaseFrontend implements ManageableAcc
                        // Is this null?
                        if (is_null($updateInstance)) {
                                // Throw an exception here
-                               throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                               throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                        }
 
                        // Get search instance from update instance
@@ -122,7 +122,7 @@ class UserDatabaseFrontend extends BaseDatabaseFrontend implements ManageableAcc
                        // Is it still null?
                        if (is_null($searchInstance)) {
                                // Throw an exception here
-                               throw new NullPointerException($updateInstance, self::EXCEPTION_IS_NULL_POINTER);
+                               throw new NullPointerException($updateInstance, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                        }
                }
 
index 0328bccd612e34d6e9aa05316a2052ddfa717fc2..b7d5935541204a20371972c3cb2b7e3eb9d377e5 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Result\Update\UpdateableResult;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2686dda07635b896fe40f5e731fc122903d1d758..5a3eb0f60563e87a1a065e5db445810fd67ef2f3 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 70f87cd2a58958ad90cfdfa2b3e40d81a51de988..2ef5f8be26bd40507d002118327ef19b07f343d8 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 337e967a46f94f2afa1071dff2758da022c646a0..e5edead2224d5941203dbca60ad184d367015857 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index b9f97354ce67b51a52cf744f84e5f68c93b34c44..ab42c577a41b78ccbe12b3c669a84b4b0b37e6ce 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Migration\Database\MigrateableDatabase;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 9d341e6a3a27ad261685c4d3a5136784cf620a48..476808907d369b171e7d63250052ca7311e36ad4 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Upgrade\Format\Database\UpgradeableDatabaseFormat
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0e6b9fe83b12674bc5437fbd72d7f4b5aebfee13..c79eabfdb90077856adf610c06f29e7c38febb67 100644 (file)
@@ -22,7 +22,7 @@ use \SeekableIterator;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -81,7 +81,11 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        private function __construct () {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CONSTRUCTED!');
                parent::__construct(__CLASS__);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
        }
 
        /**
@@ -93,25 +97,35 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public static final function createCachedDatabaseResult (array $resultArray) {
                // Misses an element?
+               //* DEBUG-DIE: */ die(sprintf('[%s:%d]: resultArray=%s', __METHOD__, __LINE__, print_r($resultArray, true)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: resultArray()=%d - CALLED!', count($resultArray)));
                if (count($resultArray) == 0) {
                        // Cannot be empty
-                       throw new InvalidArgumentException('Array "resultArray" is empty');
+                       throw new InvalidArgumentException('Array "resultArray" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!array_key_exists(BaseDatabaseResult::RESULT_NAME_ROWS, $resultArray)) {
                        // Yes, then abort here
                        throw new InvalidArgumentException(sprintf('resultArray(%d)=%s has no element "%s".', count($resultArray), print_r($resultArray, TRUE), BaseDatabaseResult::RESULT_NAME_ROWS));
+               } elseif (!array_key_exists(BaseDatabaseResult::RESULT_NAME_STATUS, $resultArray)) {
+                       // Yes, then abort here
+                       throw new InvalidArgumentException(sprintf('resultArray(%d)=%s has no element "%s".', count($resultArray), print_r($resultArray, TRUE), BaseDatabaseResult::RESULT_NAME_STATUS));
                }
 
                // Get a new instance
                $resultInstance = new CachedDatabaseResult();
 
-               // Set the result array and reset current position
+               // Set the result array
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: Setting resultArray()=%d ...', count($resultArray)));
                $resultInstance->setResultArray($resultArray);
+
+               // Reset current position
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking resultInstance->resetCurrentPosition() ...');
                $resultInstance->resetCurrentPosition();
 
                // Set affected rows
                $resultInstance->setAffectedRows(count($resultArray[BaseDatabaseResult::RESULT_NAME_ROWS]));
 
                // Return the instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: resultInstance=%s - EXIT!', $resultInstance->__toString()));
                return $resultInstance;
        }
 
@@ -133,16 +147,21 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        private function updateCurrentEntryByCriteria (LocalUpdateCriteria $updateInstance) {
                // Get the current entry key
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: updateInstance=%s - CALLED!', $updateInstance->__toString()));
                $entryKey = $this->key();
 
                // Now get the update criteria array and update all entries
                foreach ($updateInstance->getUpdateCriteria() as $criteriaKey => $criteriaValue) {
                        // Update data
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: criteriaKey=%s,criteriaValue[%s]=%s', $criteriaKey, gettype($criteriaValue), $criteriaValue));
                        $this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][$entryKey][$criteriaKey] = $criteriaValue;
 
                        // Mark it as out-dated
                        $this->outDated[$criteriaKey] = 1;
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
        }
 
        /**
@@ -153,6 +172,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function next () {
                // Default is not valid
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
                $nextValid = false;
 
                // Increase position
@@ -166,6 +186,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
                }
 
                // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: nextValid=%d - EXIT!', intval($nextValid)));
                return $nextValid;
        }
 
@@ -178,6 +199,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function seek (int $seekPosition) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: seekPosition=%d - CALLED!', $seekPosition));
                if ($seekPosition < 0) {
                        // Throw exception
                        throw new OutOfBoundsException(sprintf('seekPositon=%d is not seekable', $seekPosition));
@@ -187,10 +209,14 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
                $this->rewind();
 
                // Search for the entry
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d,seekPosition=%d', $this->currentPos, $seekPosition));
                while (($this->currentPos < $seekPosition) && ($this->valid())) {
                        // Continue on
                        $this->next();
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
        }
 
        /**
@@ -200,6 +226,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function current () {
                // Default is not found
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
                $current = NULL;
 
                // Does the current enty exist?
@@ -209,6 +236,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
                }
 
                // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: current[]=%s - EXIT!', gettype($current)));
                return $current;
        }
 
@@ -219,11 +247,11 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function valid () {
                // Check if all is fine ...
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
                $isValid = ($this->ifStatusIsOkay() && isset($this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][$this->currentPos]) && isset($this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][0]));
 
                // Return the result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-DATABASE-RESULT: isValid=%d - EXIT!', intval($isValid)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: isValid=%d - EXIT!', intval($isValid)));
                return $isValid;
        }
 
@@ -234,11 +262,11 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function count () {
                // Count rows
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-DATABASE-RESULT: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
                $count = count($this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS]);
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-DATABASE-RESULT: count=%d - EXIT!', $count));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: count=%d - EXIT!', $count));
                return $count;
        }
 
@@ -249,11 +277,11 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function ifStatusIsOkay () {
                // Check all conditions
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
                $ifStatusOkay = (isset($this->resultArray[BaseDatabaseResult::RESULT_NAME_STATUS]) && $this->resultArray[BaseDatabaseResult::RESULT_NAME_STATUS] === BaseDatabaseBackend::RESULT_OKAY);
 
                // Return status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-DATABASE-RESULT: ifStatusOkay=%s - EXIT!', intval($ifStatusOkay)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: ifStatusOkay=%s - EXIT!', intval($ifStatusOkay)));
                return $ifStatusOkay;
        }
 
@@ -264,7 +292,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function key () {
                // Return current array position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
                return $this->currentPos;
        }
 
@@ -275,12 +303,12 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function rewind () {
                // Reset both current array position and current row
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
                $this->resetCurrentPosition();
                $this->currentRow = [];
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-DATABASE-RESULT: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
        }
 
        /**
@@ -291,11 +319,11 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        private function resetCurrentPosition () {
                // Reset position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-DATABASE-RESULT: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
                $this->currentPos = ($this->count() > 0 ? 0 : -1);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-DATABASE-RESULT: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - EXIT!', $this->currentPos));
        }
 
        /**
@@ -320,39 +348,57 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function add2UpdateQueue (LocalUpdateCriteria $updateInstance) {
                // Rewind the pointer
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: updateInstance=%s - CALLED!', $updateInstance->__toString()));
                $this->rewind();
 
                // Get search criteria
                $searchInstance = $updateInstance->getSearchInstance();
 
-               // And start looking for the result
+               // Get affected rows
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: searchInstance=%s', $searchInstance->__toString()));
                $foundEntries = $this->getAffectedRows();
+
+               // And start looking for the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: foundEntries=%d,searchInstance->limit=%d', $foundEntries, $searchInstance->getLimit()));
                while (($this->valid()) && ($foundEntries < $searchInstance->getLimit())) {
                        // Get next entry
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->next() ...');
                        $this->next();
+
+                       // Get current entry
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->current() ...');
                        $currentEntry = $this->current();
 
                        // Is this entry found?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: currentEntry[]=%s - EXIT!', gettype($currentEntry)));
                        if ($searchInstance->ifEntryMatches($currentEntry)) {
                                // Update this entry
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->updateCurrentEntryByCriteria(%s) ...', $updateInstance->__toString()));
                                $this->updateCurrentEntryByCriteria($updateInstance);
 
                                // Count one up
                                $foundEntries++;
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: foundEntries=%d', $foundEntries));
                        }
                }
 
                // If no entry is found/updated throw an exception
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: foundEntries=%d', $foundEntries));
                if ($foundEntries == 0) {
                        // Throw an exception here
                        throw new ResultUpdateException($this, self::EXCEPTION_RESULT_UPDATE_FAILED);
                }
 
                // Set affected rows
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->setAffectedRows(%d) ...', $foundEntries));
                $this->setAffectedRows($foundEntries);
 
                // Set update instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->setUpdateInstance(%s) ...', $updateInstance->__toString()));
                $this->setUpdateInstance($updateInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
        }
 
        /**
@@ -389,7 +435,12 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         * @return      $needsUpdate    Whether we have out-dated entries
         */
        public function ifDataNeedsFlush () {
+               // Check if records are out-dated
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
                $needsUpdate = (count($this->outDated) > 0);
+
+               // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: needsUpdate=%d - EXIT!', intval($needsUpdate)));
                return $needsUpdate;
        }
 
@@ -401,13 +452,19 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
                // Walk only through out-dated columns
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: criteriaInstance=%s - CALLED!', $criteriaInstance->__toString()));
                foreach ($this->outDated as $key => $dummy) {
                        // Does this key exist?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: key=%s,dummy[]=%s', $key, gettype($dummy)));
                        if ($this->find($key)) {
                                // Then update it
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking criteriaInstance->addCriteria(%s,foundValue[]=%s) ...', $key, gettype($this->getFoundValue())));
                                $criteriaInstance->addCriteria($key, $this->getFoundValue());
                        }
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
        }
 
        /**
@@ -415,36 +472,51 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         *
         * @param       $key    The key we shall find
         * @return      $found  Whether the key was found or not
+        * @throws      InvalidArgumentException        If a parameter is invalid
         */
        public function find (string $key) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: key=%s - CALLED!', $key));
+               if (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // By default nothing is found
                $found = false;
 
                // Rewind the pointer
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->rewind() ...');
                $this->rewind();
 
                // Walk through all entries
                while ($this->valid()) {
                        // Advance to next entry
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->next() ...');
                        $this->next();
 
                        // Get the whole array
                        $currentEntry = $this->current();
 
                        // Is the element there?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: currentEntry[]=%s - EXIT!', gettype($currentEntry)));
                        if (isset($currentEntry[$key])) {
                                // Okay, found!
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: key=%s is found in currentEntry', $key));
                                $found = true;
 
                                // So "cache" it
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: Setting this->foundValue to currentEntry[%s][]=%s is found in currentEntry', $key, gettype($currentEntry[$key])));
                                $this->foundValue = $currentEntry[$key];
 
                                // And stop searching
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-DATABASE-RESULT: BREAK!');
                                break;
                        }
                }
 
                // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: found=%d - EXIT!', intval($found)));
                return $found;
        }
 
@@ -453,26 +525,47 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         *
         * @param       $databaseColumn         Database column where the index might be found
         * @param       $frontendInstance       The frontend instance to ask for array element
-        * @para        $callBack                       Call-back object for setting the index;
+        * @para        $callback                       Call-back object for setting the index;
         *                                                              0=object instance,1=method name
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is invalid
         * @todo        Find a caching way without modifying the result array
         */
-       public function solveResultIndex (string $databaseColumn, DatabaseFrontend $frontendInstance, array $callBack) {
+       public function solveResultIndex (string $databaseColumn, DatabaseFrontend $frontendInstance, array $callback) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: databaseColumn=%s,frontendInstance=%s,callback()=%d - CALLED!', $databaseColumn, $frontendInstance->__toString(), count($callback)));
+               if (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (count($callback) != 2) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('callback()=%d must be exactly 2', count($callback)), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!is_callable($callback)) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('%s:%s() is not callable', $callback[0], $callback[1]), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // By default nothing is found
                $indexValue = 0;
 
                // Is the element in result itself found?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->find(%s),frontendInstance->indexKey=%s ...', $databaseColumn, $frontendInstance->getIndexKey()));
                if ($this->find($databaseColumn)) {
                        // Use this value
                        $indexValue = $this->getFoundValue();
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: indexValue[]=%s from this->find(%s) - databaseColumn', gettype($indexValue), $databaseColumn));
                } elseif ($this->find($frontendInstance->getIndexKey())) {
                        // Use this value
                        $indexValue = $this->getFoundValue();
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: indexValue[]=%s from this->find(%s) - frontendInstance->indexKey', gettype($indexValue), $frontendInstance->getIndexKey()));
                }
 
                // Set the index
-               call_user_func_array($callBack, array($indexValue));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking %s:%s(indexValue[]=%s) ...', $callback[0], $callback[1], gettype($indexValue)));
+               call_user_func_array($callback, [$indexValue]);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
        }
 
 }
index 98fb0932b25ebecab2e8040ae368076f881a4d7d..c12c1923f9dfb0620fcd9c38af854414f9e3a62d 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c75000f059ec7ec23b9b0b689c813c210ef7d01f..9fc7d1a7fa68fd9576598de651feefb7fe9c67d1 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Parser\Parseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4a61f1459097ec713ca9802a696fa66715f1507f..80ef846e70f48dfca34adac812b1ae569fdf34a2 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 738f43552a70925d55ef979255373495520286e3..6209f5f83eb50da7c0984a3ecf7db48e9ce298c5 100644 (file)
@@ -4,13 +4,14 @@ namespace Org\Mxchange\CoreFramework\Disovery\;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * A ??? discovery class.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -59,7 +60,7 @@ class ???Discovery extends BaseDiscovery implements Discoverable {
         * @todo        0% done
         */
        public function discover (Requestable $requestInstance) {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
        /**
@@ -70,7 +71,7 @@ class ???Discovery extends BaseDiscovery implements Discoverable {
         * @todo        0% done
         */
        public function addResultsToHelper (HelpableTemplate $helperInstance) {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
 }
index b20a8fb8bed5117d38cf20c4c8f94ffc45391cd9..73b9dc9d0cbf59c08609424ddc58edf64bf482f5 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1bd86a9f34ffe624ac07d651c19379b290b3a6fc..a81e2bad3cf12e3782ddbf6df76c3b4ca1005618 100644 (file)
@@ -20,7 +20,7 @@ use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 9d2e17a840f10ab78d689a31fec620c862cec4de..8452cb2f8b2093762692b9ffda93b1243c1f12fa 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 73f534d2e28966e23c789a449ad38614cc29a2eb..280890b50cba34cbfb34966b5a6713e9dcb18685 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Factory;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
@@ -13,7 +14,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -63,7 +64,7 @@ abstract class BaseFactory extends BaseFrameworkSystem {
                // Is the parameter valid?
                if (empty($fullClassName)) {
                        // No empty class name
-                       throw new InvalidArgumentException('fullClassName is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+                       throw new InvalidArgumentException('fullClassName is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Count it up in total sum
@@ -109,7 +110,7 @@ abstract class BaseFactory extends BaseFrameworkSystem {
                // Is the parameter valid?
                if (empty($fullClassName)) {
                        // No empty class name
-                       throw new InvalidArgumentException('fullClassName is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+                       throw new InvalidArgumentException('fullClassName is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Return isset() result
index 2835facbbd16c4d060f786ae0179e066c2771724..3b182f8f7135c9cb99d853fc2014744f615dde34 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -55,9 +55,9 @@ class ClientFactory extends BaseFactory {
                $registryKey = strtolower($protocolInstance->getProtocolName()) . '_client';
 
                // Is the key already in registry?
-               if (GenericRegistry::getRegistry()->instanceExists($registryKey)) {
+               if (ObjectRegistry::getRegistry('factory')->instanceExists($registryKey)) {
                        // Then use that instance
-                       $clientInstance = GenericRegistry::getRegistry()->getInstance($registryKey);
+                       $clientInstance = ObjectRegistry::getRegistry('factory')->getInstance($registryKey);
 
                        // Set socket resource
                        $clientInstance->setSocketResource($socketResource);
@@ -66,7 +66,7 @@ class ClientFactory extends BaseFactory {
                        $clientInstance = ObjectFactory::createObjectByConfiguredName($registryKey, array($socketResource));
 
                        // Set it in registry for later re-use
-                       GenericRegistry::getRegistry()->addInstance($registryKey, $clientInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($registryKey, $clientInstance);
                }
 
                // Return the prepared instance
index ea267a2a1641886992348fe88152130ec21ed43d..986166a8f32348836447958e04a75261c99ee7c6 100644 (file)
@@ -5,14 +5,18 @@ namespace Org\Mxchange\CoreFramework\Factory\Database\Frontend;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
+
+// Import SPL stuff
+use \InvalidArgumentException;
 
 /**
  * A factory class for socket registries
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -30,6 +34,11 @@ use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class DatabaseFrontendFactory extends BaseFactory {
+       /**
+        * "Cache" for frontend factory
+        */
+       private static $registryInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -40,6 +49,23 @@ class DatabaseFrontendFactory extends BaseFactory {
                parent::__construct(__CLASS__);
        }
 
+       /**
+        * Some "static initializer
+        *
+        * @return      void
+        */
+       public final static function staticInitializer () {
+               // Is it initialized?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('frontend-FACTORY: self::registryInstance[]=%s - CALLED!', gettype(self::$registryInstance)));
+               if (is_null(self::$registryInstance)) {
+                       // No, then initialize it
+                       self::$registryInstance = ObjectRegistry::getRegistry('factory');
+               }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('frontend-FACTORY: self::registryInstance=%s - EXIT!', self::$registryInstance));
+       }
+
        /**
         * Returns a singleton socket registry instance. If an instance is found in
         * the registry it will be returned, else a new instance is created and
@@ -48,22 +74,30 @@ class DatabaseFrontendFactory extends BaseFactory {
         * @return      $frontendInstance       A database frontend instance
         */
        public static final function createFrontendByConfiguredName (string $frontendName) {
-               // Get registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-FRONTEND-FACTORY: frontendName=%s - CALLED!', $frontendName));
+               if (empty($frontendName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "frontendName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Invoke "static initializer"
+               self::staticInitializer();
 
                // Do we have an instance in the registry?
-               if ($registryInstance->instanceExists($frontendName)) {
+               if (self::$registryInstance->instanceExists($frontendName)) {
                        // Then use this instance
-                       $frontendInstance = $registryInstance->getInstance($frontendName);
+                       $frontendInstance = self::$registryInstance->getInstance($frontendName);
                } else {
                        // Get the registry instance
                        $frontendInstance = ObjectFactory::createObjectByConfiguredName($frontendName);
 
                        // Set the instance in registry for further use
-                       $registryInstance->addInstance($frontendName, $frontendInstance);
+                       self::$registryInstance->addInstance($frontendName, $frontendInstance);
                }
 
                // Return the instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-FRONTEND-FACTORY: frontendInstance=%s - EXIT!', $frontendInstance->__toString()));
                return $frontendInstance;
        }
 
index 4b26f8f476223fa8832271094225c47ce1e756f9..bcf3ed978bbf0621672db4847e91ae291fb67801 100644 (file)
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8e144c30a44c82ab29bd277cc88bfd1a8600ef3e..aa774a1d794ee46395c7af98998e0208d4e3d7e3 100644 (file)
@@ -5,7 +5,8 @@ namespace Org\Mxchange\CoreFramework\Factory\Stack\File;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 
 // Import SPL stuff
 use \InvalidArgumentException;
@@ -16,7 +17,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -55,16 +56,16 @@ class FileStackIndexFactory extends BaseFactory {
                // If there is no handler?
                if (empty($type)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "type" is empty');
-               } elseif (GenericRegistry::getRegistry()->instanceExists($type . '_index')) {
+                       throw new InvalidArgumentException('Parameter "type" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (ObjectRegistry::getRegistry('factory')->instanceExists($type . '_index')) {
                        // Get handler from registry
-                       $indexInstance = GenericRegistry::getRegistry()->getInstance($type . '_index');
+                       $indexInstance = ObjectRegistry::getRegistry('factory')->getInstance($type . '_index');
                } else {
                        // Get the handler instance
                        $indexInstance = ObjectFactory::createObjectByConfiguredName($type . '_file_stack_index_class', [$fileInfoInstance]);
 
                        // Add it to the registry
-                       GenericRegistry::getRegistry()->addInstance($type . '_index', $indexInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($type . '_index', $indexInstance);
                }
 
                // Return the instance
index fc3e62e885b332148d98458161bd1b56ee71d1c4..b8dc3e41decae2a02b313814b2ab65cbbbb69cdb 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f02d610d0ba4e9863a53d1faa07fcde2f9f1e7e1..f7a2bd370c8dbeca81c9de153816cbc70d1250c9 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Login;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 
 /**
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -49,7 +49,7 @@ class LoginFactory extends BaseFactory {
         */
        public static final function createLoginObjectByRequest (Requestable $requestInstance) {
                // Get registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry('factory');
 
                // Do we have an instance in the registry?
                if ($registryInstance->instanceExists('login_helper')) {
index 000f4b2650722209502aee0fd0bcb19c835aa6ef..e100dc69e8f662e34812be92b1c96705733a306c 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Object;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Loader\NoClassException;
 
 // Import SPL stuff
@@ -15,7 +16,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -59,13 +60,13 @@ class ObjectFactory extends BaseFactory {
                // Is the class name valid and is the class there?
                if (empty($fullClassName)) {
                        // Throw an exception here
-                       throw new InvalidArgumentException('Parameter "fullClassName" is empty');
+                       throw new InvalidArgumentException('Parameter "fullClassName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!self::isClassCounted($fullClassName) && !class_exists($fullClassName)) {
                        // First get an instance of this factory
                        $factoryInstance = new ObjectFactory();
 
                        // Then throw an exception
-                       throw new NoClassException(array($factoryInstance, $fullClassName), self::EXCEPTION_CLASS_NOT_FOUND);
+                       throw new NoClassException([$factoryInstance, $fullClassName], FrameworkInterface::EXCEPTION_CLASS_NOT_FOUND);
                }
 
                // Split class name on backslash to check naming-convention
index 84f8551ac07af5c662525eae54c0b5cbb4965bca..a3b985c4ea55f5fed6cc104a49ea230f9ddce16b 100644 (file)
@@ -5,14 +5,14 @@ namespace Org\Mxchange\CoreFramework\Factory\Registry\Socket;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 
 /**
  * A factory class for socket registries
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -49,21 +49,26 @@ class SocketRegistryFactory extends BaseFactory {
         */
        public static final function createSocketRegistryInstance () {
                // Get registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY-FACTORY: CALLED!');
+               $objectRegistryInstance = ObjectRegistry::getRegistry('factory');
 
                // Do we have an instance in the registry?
-               if ($registryInstance->instanceExists('socket_registry')) {
+               if ($objectRegistryInstance->instanceExists('socket_registry')) {
                        // Then use this instance
-                       $registryInstance = $registryInstance->getInstance('socket_registry');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY-FACTORY: Getting socket registry instance ...');
+                       $registryInstance = $objectRegistryInstance->getInstance('socket_registry');
                } else {
                        // Get the registry instance
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY-FACTORY: Creating new socket registry instance ...');
                        $registryInstance = ObjectFactory::createObjectByConfiguredName('socket_registry_class');
 
                        // Set the instance in registry for further use
-                       $registryInstance->addInstance('socket_registry', $registryInstance);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY-FACTORY: Adding socket registry instance ...');
+                       $objectRegistryInstance->addInstance('socket_registry', $registryInstance);
                }
 
                // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY-FACTORY: registryInstance=%s - EXIT!', $registryInstance->__toString()));
                return $registryInstance;
        }
 
index dcb22f623d8a7dc5693fb116fe4d3d65622cea1f..32d6326f159d3c9743628c1f10f2b41af82f5f2e 100644 (file)
@@ -6,7 +6,8 @@ namespace Org\Mxchange\CoreFramework\Factory\Stack;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 
 // Import SPL stuff
 use \InvalidArgumentException;
@@ -17,7 +18,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -57,10 +58,10 @@ class FileStackFactory extends BaseFactory {
                //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-FACTORY: prefix=%s,stackName=%s - CALLED!', $prefix, $stackName));
                if (empty($prefix)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "prefix" is empty');
+                       throw new InvalidArgumentException('Parameter "prefix" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($stackName)) {
                        // Throw it again
-                       throw new InvalidArgumentException('Paramter "stackName" is empty');
+                       throw new InvalidArgumentException('Paramter "stackName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Construct file stack name
@@ -72,15 +73,15 @@ class FileStackFactory extends BaseFactory {
                ));
 
                // If there is no handler?
-               if (GenericRegistry::getRegistry()->instanceExists($stackName . '_stack')) {
+               if (ObjectRegistry::getRegistry('factory')->instanceExists($stackName . '_stack')) {
                        // Get handler from registry
-                       $stackInstance = GenericRegistry::getRegistry()->getInstance($stackName . '_stack');
+                       $stackInstance = ObjectRegistry::getRegistry('factory')->getInstance($stackName . '_stack');
                } else {
                        // Get the handler instance
                        $stackInstance = ObjectFactory::createObjectByConfiguredName($prefix . '_' . $stackName . '_stack_class', array($fileInfoInstance, $prefix . '_' . $stackName));
 
                        // Add it to the registry
-                       GenericRegistry::getRegistry()->addInstance($stackName . '_stack', $stackInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($stackName . '_stack', $stackInstance);
                }
 
                // Return the instance
index 402753af4a351fb3f49582d30d04743881270019..9aeb0588c7737b938bf131c3ee21f50d3e899dae 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Factory\User;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 
 /**
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -49,7 +49,7 @@ class UserFactory extends BaseFactory {
         */
        public static final function createUserByRequest (Requestable $requestInstance) {
                // Get registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry('factory');
 
                // Do we have an instance in the registry?
                if ($registryInstance->instanceExists('user')) {
index b9eddb491ae1e0b1996db432c651668d21dfee3f..f29e271bd03993b01d34acccc5a4e19d380618a0 100644 (file)
@@ -5,7 +5,8 @@ namespace Org\Mxchange\CoreFramework\Factory\Template;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\BaseFactory;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 
 // Import SPL stuff
 use \InvalidArgumentException;
@@ -17,7 +18,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -58,13 +59,13 @@ class XmlTemplateEngineFactory extends BaseFactory {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-TEMPLATE-ENGINE-FACTORY: configKey=%s - CALLED!', $configKey));
                if (empty($configKey)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Paramter "configKey" is empty');
+                       throw new InvalidArgumentException('Paramter "configKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Do we have an instance in the registry?
-               if (GenericRegistry::getRegistry()->instanceExists($configKey)) {
+               if (ObjectRegistry::getRegistry('factory')->instanceExists($configKey)) {
                        // Then use this instance
-                       $templateInstance = GenericRegistry::getRegistry()->getInstance($configKey);
+                       $templateInstance = ObjectRegistry::getRegistry('factory')->getInstance($configKey);
                } else {
                        // Get the XML template instance
                        $templateInstance = ObjectFactory::createObjectByConfiguredName($configKey);
@@ -79,7 +80,7 @@ class XmlTemplateEngineFactory extends BaseFactory {
                        $templateInstance->enableXmlCompacting();
 
                        // Set the instance in registry for further use
-                       GenericRegistry::getRegistry()->addInstance($configKey, $templateInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($configKey, $templateInstance);
                }
 
                // Return the instance
index ffa90a102a65e02e9f5fb5e3d29a748811453162..4cad8ab6a5205248dad79889d83a9cc45a6e46aa 100644 (file)
@@ -5,13 +5,14 @@ namespace Org\Mxchange\CoreFramework\Feature\!!!;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Feature\BaseFeature;
 use Org\Mxchange\CoreFramework\Feature\Feature;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * A ??? feature class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -63,7 +64,7 @@ class ???Feature extends BaseFeature implements Feature {
                $isAvailable = false;
 
                // Unfinished:
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
 
                // Return status
                return $isAvailable;
index 5b040cc686aa5dd6492b0979a277a0ec1c9dcfa9..fc7c66a2257319fade2af13e9f0cda941e2b23a1 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 1bcec3f8822eb30bab2181bd2e3c7bd6ebe5924b..3d2fbeb7f227f5f43e4f4a93ef10106ee86693c9 100644 (file)
@@ -5,17 +5,22 @@ namespace Org\Mxchange\CoreFramework\Feature;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Loader\NoClassException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
+// Import SPL stuff
+use \BadMethodCallException;
+use \InvalidArgumentException;
+
 /**
  * The general feature management class. No instance is needed as this class
  * has only public methods that are static.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -73,8 +78,16 @@ class FrameworkFeature extends BaseFrameworkSystem {
         *
         * @param       $featureName    Name of the feature to be checked
         * @return      $isEnabled              Whether the given feature is enabled
+        * @throws      InvalidArgumentException        If a parameter is invalid
         */
        public static function isFeatureEnabled (string $featureName) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-FEATURE: featureName=%s - CALLED!', $featureName));
+               if (empty($featureName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "featureName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is the cache set?
                if (!isset(self::$enabledFeatures[$featureName]['is_enabled'])) {
                        // Generate config key
@@ -85,6 +98,7 @@ class FrameworkFeature extends BaseFrameworkSystem {
                }
 
                // Return "cached" status
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-FEATURE: is_enabled[%s]=%d - EXIT!', $featureName, intval(self::$enabledFeatures[$featureName]['is_enabled'])));
                return self::$enabledFeatures[$featureName]['is_enabled'];
        }
 
@@ -97,10 +111,17 @@ class FrameworkFeature extends BaseFrameworkSystem {
         *
         * @param       $featureName    Name of the feature to be checked on availability
         * @return      $isAvailable    Whether the given feature is available
+        * @throws      InvalidArgumentException        If a parameter is invalid
         */
        public static function isFeatureAvailable (string $featureName) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-FEATURE: featureName=%s - CALLED!', $featureName));
+               if (empty($featureName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "featureName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is the cache set?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FRAMEWORK-FEATURE: featureName=%s - CALLED!', $featureName));
                if (!isset(self::$enabledFeatures[$featureName]['is_available'])) {
                        // Default is not available
                        self::$enabledFeatures[$featureName]['is_available'] = false;
@@ -109,7 +130,7 @@ class FrameworkFeature extends BaseFrameworkSystem {
                        // Is the feature enabled?
                        if (!self::isFeatureEnabled($featureName)) {
                                // Then it can't be available
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FRAMEWORK-FEATURE: Feature "%s"is not enabled.', $featureName));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-FEATURE: Feature "%s"is not enabled. - EXIT!', $featureName));
                                return false;
                        }
 
@@ -117,7 +138,7 @@ class FrameworkFeature extends BaseFrameworkSystem {
                        $configKey = sprintf('feature_%s_class', $featureName);
 
                        // Now try to get the instance
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FRAMEWORK-FEATURE: configKey=%s', $configKey));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FRAMEWORK-FEATURE: configKey=%s', $configKey));
                        try {
                                // Try to get an instance
                                self::$enabledFeatures[$featureName]['instance'] = ObjectFactory::createObjectByConfiguredName($configKey);
@@ -126,12 +147,12 @@ class FrameworkFeature extends BaseFrameworkSystem {
                                self::$enabledFeatures[$featureName]['is_available'] = self::$enabledFeatures[$featureName]['instance']->isFeatureAvailable();
                        } catch (NoClassException $e) {
                                // Feature class not found
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FRAMEWORK-FEATURE: Feature "%s"is not available due to missing feature class. Disabling feature ...', $featureName));
+                               self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('FRAMEWORK-FEATURE: Feature "%s"is not available due to missing feature class. Disabling feature ...', $featureName));
                        }
                }
 
                // Return "cached" status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FRAMEWORK-FEATURE: featureName=%s,isAvailable=%d - EXIT!', $featureName, intval(self::$enabledFeatures[$featureName]['is_available'])));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-FEATURE: featureName=%s,isAvailable=%d - EXIT!', $featureName, intval(self::$enabledFeatures[$featureName]['is_available'])));
                return self::$enabledFeatures[$featureName]['is_available'];
        }
 
@@ -144,15 +165,23 @@ class FrameworkFeature extends BaseFrameworkSystem {
         * @param       $featureMethod  Method name of the feature's class
         * @param       $args                   Any arguments that should be handled over
         * @return      $return                 Anything the feature's method has returned
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      BadMethodCallException  If this method has been invoked but the feature isn't available
         * @throws      FeatureMethodNotCallableException       If the requested method cannot be called
         */
-       public static function callFeature ($featureName, $featureMethod, array $args = NULL) {
-               /*
-                * Please make sure that isFeatureAvailable() has been called and it has
-                * returned true before calling this method.
-                */
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FRAMEWORK-FEATURE: featureName=%s,featureMethod=%s,args[]=%s - CALLED!', $featureName, $featureMethod, gettype($args)));
-               assert(self::isFeatureAvailable($featureName));
+       public static function callFeature (string $featureName, string $featureMethod, array $args = NULL) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-FEATURE: featureName=%s,featureMethod=%s,args[]=%s - CALLED!', $featureName, $featureMethod, gettype($args)));
+               if (empty($featureName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "featureName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($featureMethod)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "featureMethod" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!self::isFeatureAvailable($featureName)) {
+                       // Throw BMCE
+                       throw new BadMethodCallException(sprintf('Feature "%s" is not available but method "%s" should be invoked.', $featureName, $featureMethod), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
+               }
 
                // Array for call-back
                $callable = array(
@@ -170,7 +199,7 @@ class FrameworkFeature extends BaseFrameworkSystem {
                $return = call_user_func_array($callable, $args);
 
                // Return any returned value
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FRAMEWORK-FEATURE: return[]=%s - EXIT!', gettype($return)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-FEATURE: return[]=%s - EXIT!', gettype($return)));
                return $return;
        }
 
index f13da47c9005fc8a6ec939fecdf953501ff720d5..fb039d416199d496b5dcf7a52ecad53386b7ab42 100644 (file)
@@ -5,13 +5,14 @@ namespace Org\Mxchange\CoreFramework\Feature\Fuse;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Feature\BaseFeature;
 use Org\Mxchange\CoreFramework\Feature\Feature;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * A FUSE feature class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -63,7 +64,7 @@ class FuseFeature extends BaseFeature implements Feature {
                $isAvailable = false;
 
                // Unfinished:
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
 
                // Return status
                return $isAvailable;
index a4cdd99b91bd3afe72d318ac6ffc36f142a05581..d7aa398bbfcd133f1a1af7d3bfc9810426407268 100644 (file)
@@ -8,6 +8,8 @@ use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseAbstractFile;
 use Org\Mxchange\CoreFramework\Filesystem\FilePointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Traits\Index\IndexableTrait;
 use Org\Mxchange\CoreFramework\Traits\Stack\StackableTrait;
 
@@ -24,7 +26,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -94,7 +96,11 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: className=%s - CALLED!', $className));
                parent::__construct($className);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FRAMEWORK-DIRECTORY-POINTER: EXIT!');
        }
 
        /**
@@ -104,7 +110,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      void
         */
        private function setBackBuffer (string $backBuffer) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Setting backBuffer(%d)=%s - CALLED!', strlen($backBuffer), $backBuffer));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Setting backBuffer(%d)=%s - CALLED!', strlen($backBuffer), $backBuffer));
                $this->backBuffer = $backBuffer;
        }
 
@@ -114,7 +120,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      $backBuffer             Characters "stored" in back-buffer
         */
        private function getBackBuffer () {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Getting this->backBuffer(%d)=%s - CALLED!', strlen($this->backBuffer), $this->backBuffer));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Getting this->backBuffer(%d)=%s - CALLED!', strlen($this->backBuffer), $this->backBuffer));
                return $this->backBuffer;
        }
 
@@ -125,7 +131,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      void
         */
        private function setCurrentBlock (string $currentBlock) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Setting currentBlock(%d)=%s - CALLED!', strlen($currentBlock), $currentBlock));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Setting currentBlock(%d)=%s - CALLED!', strlen($currentBlock), $currentBlock));
                $this->currentBlock = $currentBlock;
        }
 
@@ -135,7 +141,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      $current        Currently read data
         */
        public function getCurrentBlock () {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Getting this->currentBlock(%d)=%s - CALLED!', strlen($this->currentBlock), $this->currentBlock));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Getting this->currentBlock(%d)=%s - CALLED!', strlen($this->currentBlock), $this->currentBlock));
                return $this->currentBlock;
        }
 
@@ -145,7 +151,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      $totalEntries   Size of file header
         */
        public final function getHeaderSize () {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Getting this->headerSize=%d - CALLED!', $this->headerSize));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Getting this->headerSize=%d - CALLED!', $this->headerSize));
                return $this->headerSize;
        }
 
@@ -156,7 +162,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      void
         */
        public final function setHeaderSize (int $headerSize) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Setting headerSize=%d - CALLED!', $headerSize));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Setting headerSize=%d - CALLED!', $headerSize));
                $this->headerSize = $headerSize;
        }
 
@@ -187,7 +193,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      $seekPosition   Current seek position (stored here in object)
         */
        public final function getSeekPosition () {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Getting this->seekPosition=%d - CALLED!', $this->seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Getting this->seekPosition=%d - CALLED!', $this->seekPosition));
                return $this->seekPosition;
        }
 
@@ -198,7 +204,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      void
         */
        protected final function setSeekPosition (int $seekPosition) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Setting seekPosition=%d - CALLED!', $seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Setting seekPosition=%d - CALLED!', $seekPosition));
                $this->seekPosition = $seekPosition;
        }
 
@@ -211,24 +217,24 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function isFileGapsOnly () {
                // Count every gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $gapsSize = 0;
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->gaps()=%d', count($this->gaps)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->gaps()=%d', count($this->gaps)));
                foreach ($this->gaps as $gap) {
                        // Calculate size of found gap: end-start including both
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: gap[%s]=%d,ga[%s]=%d', BinaryFile::GAPS_INDEX_START, $gap[BinaryFile::GAPS_INDEX_START], BinaryFile::GAPS_INDEX_END, $gap[BinaryFile::GAPS_INDEX_END]));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: gap[%s]=%d,ga[%s]=%d', BinaryFile::GAPS_INDEX_START, $gap[BinaryFile::GAPS_INDEX_START], BinaryFile::GAPS_INDEX_END, $gap[BinaryFile::GAPS_INDEX_END]));
                        $gapsSize += ($gap[BinaryFile::GAPS_INDEX_END] - $gap[BinaryFile::GAPS_INDEX_START]);
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: gapsSize=%d', $gapsSize));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: gapsSize=%d', $gapsSize));
                }
 
                // Total gap size + header size + 1 must be same as file size
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: gapsSize=%d,this->headerSize=%d,this->fileSize=%d', $gapsSize, $this->getHeaderSize(), $this->getFileSize()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: gapsSize=%d,this->headerSize=%d,this->fileSize=%d', $gapsSize, $this->getHeaderSize(), $this->getFileSize()));
                $determinedFileSize = ($gapsSize + $this->getHeaderSize() + 1);
 
                // Should not be more!
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: determinedFileSize=%d,this->fileSize=%d', $determinedFileSize, $this->getFileSize()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: determinedFileSize=%d,this->fileSize=%d', $determinedFileSize, $this->getFileSize()));
                if ($determinedFileSize > $this->getFileSize()) {
                        // Should not happen
                        throw new OutOfBoundsException(sprintf('determinedFileSize=%d is larger than this->fileSize=%d', $determinedFileSize, $this->getFileSize()));
@@ -238,7 +244,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                $isGapsOnly = ($determinedFileSize == $this->getFileSize());
 
                // Return flag
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: isGapsOnly=%d - EXIT!', intval($isGapsOnly)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: isGapsOnly=%d - EXIT!', intval($isGapsOnly)));
                return $isGapsOnly;
        }
 
@@ -251,25 +257,26 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        private function markFileGapsOnly (string $type, int $minimumBlockLength) {
                // Is config cache there?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: type=%s,minimumBlockLength=%d - CALLED!', $type, $minimumBlockLength));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: type=%s,minimumBlockLength=%d - CALLED!', $type, $minimumBlockLength));
                if (!isset(self::$configCache[$type . '_pre_allocate_count'])) {
                        // Then set it
                        self::$configCache[$type . '_pre_allocate_count'] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($type . '_pre_allocate_count');
                }
 
                // Very simple to do ...
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: self:configCache[%s_pre_allocate_count]=%d', $type, self::$configCache[$type . '_pre_allocate_count']));
                for ($idx = 0; $idx < self::$configCache[$type . '_pre_allocate_count']; $idx++) {
                        // Calculate start/end positions
                        $startPosition = $idx * $minimumBlockLength;
                        $endPosition = $idx * $minimumBlockLength + $minimumBlockLength;
 
                        // Mark start and end position as gap
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->addGap(%d, %d) ...', $startPosition, $endPosition));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->addGap(%d, %d) ...', $startPosition, $endPosition));
                        $this->addGap($startPosition, $endPosition);
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -281,14 +288,14 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        private function addGap(int $startPosition, int $endPosition) {
                // Push to gaps array
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: startPosition=%d,endPosition=%d - CALLED!', $startPosition, $endPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: startPosition=%d,endPosition=%d - CALLED!', $startPosition, $endPosition));
                array_push($this->gaps, [
                        BinaryFile::GAPS_INDEX_START  => $startPosition,
                        BinaryFile::GAPS_INDEX_END    => $endPosition,
                ]);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -298,11 +305,11 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        private function initBackBuffer () {
                // Simply call the setter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $this->setBackBuffer('');
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -314,22 +321,22 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        protected function rewindUpdateSeekPosition (bool $flushHeader = false) {
                // Seek to beginning of file
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: flushHeader=%d - CALLED!', intval($flushHeader)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: flushHeader=%d - CALLED!', intval($flushHeader)));
                $this->rewind();
 
                // And update seek position ...
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->updateSeekPosition() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->updateSeekPosition() ...');
                $this->updateSeekPosition();
 
                // Flush headers?
                if ($flushHeader) {
                        // ... to write it back into the file
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->flushFileHeader() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->flushFileHeader() ...');
                        $this->flushFileHeader();
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -339,11 +346,11 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        protected function seekToOldPosition () {
                // Seek to currently ("old") saved position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $this->seek($this->determineSeekPosition());
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -354,15 +361,15 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        protected function initFile (SplFileInfo $fileInfoInstance) {
                // Get a file i/o pointer instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: fileInfoInstance[%s]=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: fileInfoInstance[%s]=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance));
                $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class', array($fileInfoInstance));
 
                // ... and set it here
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Setting pointerInstance=%s ...', $pointerInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: Setting pointerInstance=%s ...', $pointerInstance->__toString()));
                $this->setPointerInstance($pointerInstance);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -374,21 +381,21 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        protected function markCurrentBlockAsEmpty (int $length) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: length=%d - CALLED!', $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: length=%d - CALLED!', $length));
                if ($length < 1) {
                        // Length cannot below one
-                       throw new InvalidArgumentException(sprintf('length=%d is not valid', $length));
+                       throw new InvalidArgumentException(sprintf('length=%d is not valid', $length), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get current seek position
                $currentPosition = $this->determineSeekPosition();
 
                // Now add it as gap entry
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->addGap(%d, %d) ..', ($currentPosition - $length), $currentPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->addGap(%d, %d) ..', ($currentPosition - $length), $currentPosition));
                $this->addGap(($currentPosition - $length), $currentPosition);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -401,18 +408,18 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function initCountersGapsArray () {
                // Init counter and seek position to header size
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->determineSeekPosition() - CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->determineSeekPosition() - CALLED!');
                $seekPosition = $this->getSeekPosition();
 
                // Set counter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%d', $seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: seekPosition=%d', $seekPosition));
                $this->setCounter(0);
 
                // Get header size
                $headerSize = $this->getHeaderSize();
 
                // Set it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Setting this->seekPosition=%d ...', $headerSize));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: Setting this->seekPosition=%d ...', $headerSize));
                $this->setSeekPosition($headerSize);
 
                // Init arrays
@@ -420,11 +427,11 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                $this->damagedEntries = [];
 
                // Seek back to old position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->seek(%d) ...', $seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->seek(%d) ...', $seekPosition));
                $this->seek($seekPosition);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -434,15 +441,15 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function updateSeekPosition () {
                // Get key (= seek position)
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $seekPosition = $this->determineSeekPosition();
 
                // And set it here
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%d', $seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: seekPosition=%d', $seekPosition));
                $this->setSeekPosition($seekPosition);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -454,17 +461,17 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public static function isBlockSeparatorFound (string $str) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: str=%s - CALLED!', $str));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: str=%s - CALLED!', $str));
                if (empty($str)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "str" is empty');
+                       throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Determine it
                $isFound = (strpos($str, chr(BinaryFile::SEPARATOR_ENTRIES)) !== false);
 
                // Return result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: isFound=%d - EXIT!', intval($isFound)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: isFound=%d - EXIT!', intval($isFound)));
                return $isFound;
        }
 
@@ -480,41 +487,41 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function writeData (int $seekPosition, string $data, bool $flushHeader = true) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%s,data()=%d,flushHeader=%d - CALLED!', $seekPosition, strlen($data), intval($flushHeader)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: seekPosition=%s,data()=%d,flushHeader=%d - CALLED!', $seekPosition, strlen($data), intval($flushHeader)));
                if ($seekPosition < 0) {
                        // Invalid seek position
                        throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid', $seekPosition));
                } elseif (empty($data)) {
                        // Empty data is invalid, too
-                       throw new InvalidArgumentException('Parameter "data" is empty');
+                       throw new InvalidArgumentException('Parameter "data" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Write data at given position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->writeAtPosition(%d,%s) ...', $seekPosition, $data));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->writeAtPosition(%d,%s) ...', $seekPosition, $data));
                $this->writeAtPosition($seekPosition, $data);
 
                // Increment counter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->incrementCounter() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->incrementCounter() ...');
                $this->incrementCounter();
 
                // Update seek position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->updateSeekPosition() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->updateSeekPosition() ...');
                $this->updateSeekPosition();
 
                // Flush the header?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: flushHeader=%d', intval($flushHeader)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: flushHeader=%d', intval($flushHeader)));
                if ($flushHeader === true) {
                        // Flush header
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->flushFileHeader() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->flushFileHeader() ...');
                        $this->flushFileHeader();
 
                        // Seek to old position
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->seekToOldPosition() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->seekToOldPosition() ...');
                        $this->seekToOldPosition();
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -528,21 +535,21 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function writeAtPosition (int $seekPosition, string $dataStream) {
                // Validate parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%d,dataStream(%d)=%s - CALLED!', $seekPosition, strlen($dataStream), $dataStream));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: seekPosition=%d,dataStream(%d)=%s - CALLED!', $seekPosition, strlen($dataStream), $dataStream));
                if ($seekPosition < 0) {
                        // Invalid seek position
                        throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid.', $seekPosition));
                } elseif (empty($dataStream)) {
                        // Empty dataStream
-                       throw new InvalidArgumentException('Parameter "dataStream" is empty');
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call pointer's method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->pointerInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->pointerInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
                $status = $this->getPointerInstance()->writeAtPosition($seekPosition, $dataStream);
 
                // Return status
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: status[%s]=%d - EXIT!', gettype($status), $status));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: status[%s]=%d - EXIT!', gettype($status), $status));
                return $status;
        }
 
@@ -553,7 +560,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function isFileHeaderInitialized () {
                // Default is not initialized
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $isInitialized = false;
 
                // Is the file initialized?
@@ -562,19 +569,19 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                        $this->rewind();
 
                        // Read file header
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->readFileHeader() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->readFileHeader() ...');
                        $this->readFileHeader();
 
                        // Get header count
                        $headerCount = count($this->getHeader());
 
                        // The above method does already check the header
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: headerCount=%d', $headerCount));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: headerCount=%d', $headerCount));
                        $isInitialized = ($headerCount > 0);
                }
 
                // Return result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: isInitialized=%d - EXIT!', intval($isInitialized)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: isInitialized=%d - EXIT!', intval($isInitialized)));
                return $isInitialized;
        }
 
@@ -586,24 +593,24 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function isFileInitialized () {
                // Get it from iterator which holds the pointer instance. If false is returned
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $fileSize = $this->size();
 
                /*
                 * The returned file size should not be false or NULL as this means
                 * that the pointer class does not work correctly.
                 */
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: fileSize[%s]=%d', gettype($fileSize), $fileSize));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: fileSize[%s]=%d', gettype($fileSize), $fileSize));
                if (!is_int($fileSize)) {
                        // Bad file?
-                       throw new UnexpectedValueException(sprintf('fileSize[]=%s is unexpected', gettype($fileSize)));
+                       throw new UnexpectedValueException(sprintf('fileSize[]=%s is unexpected', gettype($fileSize)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Is more than 0 returned?
                $isInitialized = ($fileSize > 0);
 
                // Return result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: isInitialized=%d - EXIT!', intval($isInitialized)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: isInitialized=%d - EXIT!', intval($isInitialized)));
                return $isInitialized;
        }
 
@@ -615,23 +622,23 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function createFileHeader () {
                // The file's header should not be initialized here
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                if ($this->isFileHeaderInitialized()) {
                        // Bad method call
                        //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this=%s', __METHOD__, __LINE__, print_r($this, TRUE)));
-                       throw new BadMethodCallException('File header is already initialized but method called');
+                       throw new BadMethodCallException('File header is already initialized but method called', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Simple flush file header which will create it.
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->flushFileHeader() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->flushFileHeader() ...');
                $this->flushFileHeader();
 
                // Rewind seek position (to beginning of file) and update/flush file header
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->rewindUpdateSeekPosition() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->rewindUpdateSeekPosition() ...');
                $this->rewindUpdateSeekPosition();
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -641,11 +648,11 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function determineSeekPosition () {
                // Call pointer instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $seekPosition = $this->getPointerInstance()->determineSeekPosition();
 
                // Return position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%d - EXIT!', $seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: seekPosition=%d - EXIT!', $seekPosition));
                return $seekPosition;
        }
 
@@ -659,7 +666,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function seek (int $offset, int $whence = SEEK_SET) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: offset=%d,whence=%d - CALLED!', $offset, $whence));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: offset=%d,whence=%d - CALLED!', $offset, $whence));
                if ($offset < 0) {
                        // No offset is smaller than zero
                        throw new OutOfBoundsException(sprintf('offset=%d is not valid', $offset));
@@ -669,7 +676,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                $status = $this->getPointerInstance()->seek($offset, $whence);
 
                // Return status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: status[%s]=%d - EXIT!', gettype($status), $status));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: status[%s]=%d - EXIT!', gettype($status), $status));
                return $status;
        }
 
@@ -682,22 +689,22 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function read (int $bytes = 0) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: bytes=%d - CALLED!', $bytes));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: bytes=%d - CALLED!', $bytes));
                if ($bytes < 0) {
                        // Throw exception
                        throw new OutOfBoundsException(sprintf('bytes=%d is not valid', $bytes));
                }
 
                // Call pointer instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->pointerInstance->read(%d) ...', $bytes));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->pointerInstance->read(%d) ...', $bytes));
                $data = $this->getPointerInstance()->read($bytes);
 
                // Update seek position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->updateSeekPosition() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->updateSeekPosition() ...');
                $this->updateSeekPosition();
 
                // Return data
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: data[%s]=%s - EXIT!', gettype($data), $data));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: data[%s]=%s - EXIT!', gettype($data), $data));
                return $data;
        }
 
@@ -708,11 +715,11 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function rewind () {
                // Call pointer instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                $this->getPointerInstance()->rewind();
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -725,59 +732,59 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function analyzeFileStructure () {
                // Make sure the file is initialized
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: CALLED!');
                if (!$this->isFileInitialized()) {
                        // Bad method call
-                       throw new BadMethodCallException('Method called but file is not initialized.');
+                       throw new BadMethodCallException('Method called but file is not initialized.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Init counters and gaps array
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->initCounterGapsArrays() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->initCounterGapsArrays() ...');
                $this->initCountersGapsArray();
 
                // Output message (as this may take some time)
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Analyzing file structure ... (this may take some time)'));
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('Analyzing file structure ... (this may take some time)'));
 
                // First Seek to right after file header
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->seek(%d) ...', $this->getHeaderSize() + 1));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->seek(%d) ...', $this->getHeaderSize() + 1));
                $this->seek($this->getHeaderSize() + 1);
 
                // Then try to load all entries
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, looping through file ...', $this->getSeekPosition()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, looping through file ...', $this->getSeekPosition()));
                while ($this->isValid()) {
                        // Get current entry
                        $current = $this->getCurrentBlock();
 
                        // Go to next entry
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: current=%s, calling this->readNextBlock() ...', $current));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: current=%s, Invoking this->readNextBlock() ...', $current));
                        $this->readNextBlock();
 
                        /*
                         * If the block is empty, maybe the whole file is? This could mean
                         * that the file has been pre-allocated.
                         */
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: current(%d)[]=%s', strlen($current), gettype($current)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: current(%d)[]=%s', strlen($current), gettype($current)));
                        if (empty(trim($current, chr(0)))) {
                                // Then skip this part
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: current[]=%s is empty - CONTINUE!', gettype($current)));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: current[]=%s is empty - CONTINUE!', gettype($current)));
                                continue;
                        }
 
                        // Handle current record
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: current(%d)[%s]=%s', strlen($current), gettype($current), $current));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: current(%d)[%s]=%s', strlen($current), gettype($current), $current));
                }
 
                // If the last read block is empty, check gaps
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: current()=%d', strlen($current)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: current()=%d', strlen($current)));
                if (empty(trim($current, chr(0)))) {
                        // Output message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Found a total of %d gaps.', count($this->gaps)));
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: Found a total of %d gaps.', count($this->gaps)));
 
                        // Check gaps, if the whole file is empty.
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->isFileGapsOnly() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->isFileGapsOnly() ...');
                        if ($this->isFileGapsOnly()) {
                                // Only gaps, so don't continue here.
-                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: File is gaps-only - EXIT!');
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('BASE-BINARY-FILE: File is gaps-only - EXIT!');
                                return;
                        }
                }
@@ -788,15 +795,15 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                 * defragmentation is to far in the past, or if a "hard" limit has
                 * reached, run defragmentation.
                 */
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->isDefragmentationNeeded() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->isDefragmentationNeeded() ...');
                if ($this->isDefragmentationNeeded()) {
                        // Run "defragmentation"
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->doRunDefragmentation() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->doRunDefragmentation() ...');
                        $this->doRunDefragmentation();
                }
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -809,10 +816,10 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        protected function readNextBlockByLength (int $length) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d,length=%d - CALLED!', $this->getSeekPosition(), $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d,length=%d - CALLED!', $this->getSeekPosition(), $length));
                if ($length < 1) {
                        // Throw IAE
-                       throw new InvalidArgumentException(sprintf('length=%d is not valid', $length));
+                       throw new InvalidArgumentException(sprintf('length=%d is not valid', $length), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Read possibly back-buffered bytes from previous call of next().
@@ -823,21 +830,21 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                 * "block" may not fit, so this loop will continue until the EOB or EOF
                 * has been reached whatever comes first.
                 */
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d,data()=%d', $this->getSeekPosition(), strlen($data)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d,data()=%d', $this->getSeekPosition(), strlen($data)));
                while ((!$this->isEndOfFileReached()) && (empty($data) || !self::isBlockSeparatorFound($data))) {
                        // Then read the next possible block
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, calling this->read(%d) ...', $this->getSeekPosition(), $length));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, Invoking this->read(%d) ...', $this->getSeekPosition(), $length));
                        $block = $this->read($length);
 
                        // Is the block empty?
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: block()=%d,length=%d', strlen($block), $length));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: block()=%d,length=%d', strlen($block), $length));
                        if (strlen($block) == 0) {
                                // Read empty block, maybe EOF
-                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, block is empty, maybe EOF reached - BREAK!', $this->getSeekPosition()));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, block is empty, maybe EOF reached - BREAK!', $this->getSeekPosition()));
                                break;
                        } elseif (empty(trim($block, chr(0)))) {
                                // Mark it as empty
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, calling this->markCurrentBlockAsEmpty(%d) ...', $this->getSeekPosition(), $length));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, Invoking this->markCurrentBlockAsEmpty(%d) ...', $this->getSeekPosition(), $length));
                                $this->markCurrentBlockAsEmpty($length);
                        }
 
@@ -845,22 +852,22 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                        $data .= $block;
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d,data()=%d', $this->getSeekPosition(), strlen($data)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d,data()=%d', $this->getSeekPosition(), strlen($data)));
                }
 
                /*
                 * Init back-buffer which is the data that has been found beyond the
                 * separator.
                 */
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->initBackBuffer(), clearing this->currentBlock ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->initBackBuffer(), clearing this->currentBlock ...');
                $this->initBackBuffer();
                $this->setCurrentBlock('');
 
                // Is $data empty?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: data(%d)=%s', strlen($data), $data));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: data(%d)=%s', strlen($data), $data));
                if (empty(trim($data, chr(0)))) {
                        // Yes, maybe whole file was ...
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, maybe empty file found - EXIT!', $this->getSeekPosition()));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: this->seekPosition=%d, maybe empty file found - EXIT!', $this->getSeekPosition()));
                        return;
                }
 
@@ -868,19 +875,19 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                $dataArray = explode(chr(BinaryFile::SEPARATOR_ENTRIES), $data);
 
                // Left part is the actual block, right one the back-buffer data, if found
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: dataArray()=%d', count($dataArray)));
-               //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: dataArray=%s', print_r($dataArray, true)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: dataArray()=%d', count($dataArray)));
+               //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: dataArray=%s', print_r($dataArray, true)));
                $this->setCurrentBlock($dataArray[0]);
 
                // Is back buffere data found?
                if (isset($dataArray[1]) && !empty(trim($dataArray[1], chr(0)))) {
                        // Set back buffer
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Setting this->backBuffer=%s ...', $dataArray[1]));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: Setting this->backBuffer=%s ...', $dataArray[1]));
                        $this->setBackBuffer($dataArray[1]);
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -889,20 +896,19 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @param       $type   Type of the file
         * @return      void
         * @throws      InvalidArgumentException        If a parameter is empty
-        * @throws      BadMethodCallException  If this->stackInstance is not properly set
         */
        protected function preAllocateFileByTypeLength (string $type, int $minimumBlockLength) {
                // Is it enabled?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: type=%s,minimumBlockLength=%d - CALLED!', $type, $minimumBlockLength));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: type=%s,minimumBlockLength=%d - CALLED!', $type, $minimumBlockLength));
                if (empty($type)) {
                        // Empty type
-                       throw new InvalidArgumentException('Parameter "type" is empty');
+                       throw new InvalidArgumentException('Parameter "type" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($minimumBlockLength < 1) {
                        // Invalid block length
-                       throw new InvalidArgumentException(sprintf('Parameter minimumBlockLength=%d is not valid', $minimumBlockLength));
-               } elseif (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($type . '_pre_allocate_enabled') != 'Y') {
+                       throw new InvalidArgumentException(sprintf('Parameter minimumBlockLength=%d is not valid', $minimumBlockLength), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!FrameworkBootstrap::getConfigurationInstance()->isEnabled($type . '_pre_allocate')) {
                        // Don't continue here.
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Not pre-allocating file.'));
+                       self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Not pre-allocating file. - EXIT!');
                        return;
                }
 
@@ -910,31 +916,31 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                $fileSize = $this->getFileSize();
 
                // Calulcate seek position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: minimumBlockLength=%d,fileSize=%d', $minimumBlockLength, $fileSize));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: minimumBlockLength=%d,fileSize=%d', $minimumBlockLength, $fileSize));
                $seekPosition = $this->getHeaderSize() + $minimumBlockLength * FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($type . '_pre_allocate_count') + $fileSize ;
 
                // Now simply write a NUL there. This will pre-allocate the file.
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->writeAtPosition(%d,NUL) ...', $seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->writeAtPosition(%d,NUL) ...', $seekPosition));
                $this->writeAtPosition($seekPosition, chr(0));
 
                // Is the seek position zero?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: fileSize=%d', $fileSize));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: fileSize=%d', $fileSize));
                if ($fileSize == 0) {
                        // Mark file as gaps-only
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: Calling this->markGapsOnly(%s,%d) ...', $type, $minimumBlockLength));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->markGapsOnly(%s,%d) ...', $type, $minimumBlockLength));
                        $this->markFileGapsOnly($type, $minimumBlockLength);
                } else {
                        // Analyze file structure
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->analyzeFileStructure() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->analyzeFileStructure() ...');
                        $this->analyzeFileStructure();
                }
 
                // Rewind seek position
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: Calling this->rewind() ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: Invoking this->rewind() ...');
                $this->rewind();
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-BINARY-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-BINARY-FILE: EXIT!');
        }
 
        /**
@@ -946,29 +952,29 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        protected function isValidByLength (int $length) {
                // Validate parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: length=%d - CALLED!', $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: length=%d - CALLED!', $length));
                if ($length < 1) {
                        // Throw IAE
-                       throw new InvalidArgumentException(sprintf('Parameter length=%d is not valid', $length));
+                       throw new InvalidArgumentException(sprintf('Parameter length=%d is not valid', $length), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get current seek position
                $seekPosition = $this->determineSeekPosition();
 
                // Then try to read it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%d', $seekPosition));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: seekPosition=%d', $seekPosition));
                $data = $this->read($length);
 
                // If some bytes could be read, all is fine
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: data[%s]()=%d', gettype($data), strlen($data)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: data[%s]()=%d', gettype($data), strlen($data)));
                $isValid = ((is_string($data)) && (strlen($data) > 0));
 
                // Get header size
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: isValid=%d', intval($isValid)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: isValid=%d', intval($isValid)));
                $headerSize = $this->getHeaderSize();
 
                // Is the seek position at or beyond the header?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%d,headerSize=%d', $seekPosition, $headerSize));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: seekPosition=%d,headerSize=%d', $seekPosition, $headerSize));
                if ($seekPosition >= $headerSize) {
                        // Seek back to old position
                        $isValid = ($isValid && $this->seek($seekPosition) === 0);
@@ -978,7 +984,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                }
 
                // Return result
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: isValid=%d - EXIT!', intval($isValid)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: isValid=%d - EXIT!', intval($isValid)));
                return $isValid;
        }
 
@@ -1009,10 +1015,10 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         */
        public function searchNextGap (int $length) {
                // If the file is only gaps, no need to seek
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: length=%d - CALLED!', $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: length=%d - CALLED!', $length));
                if ($length <= 0) {
                        // Throw IAE
-                       throw new InvalidArgumentException(sprintf('length=%d is not valid', $length));
+                       throw new InvalidArgumentException(sprintf('length=%d is not valid', $length), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->isFileGapsOnly()) {
                        /*
                         * The first empty block is the 2nd one right after the header, so
@@ -1021,12 +1027,12 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
                        $seekPosition = ($this->getHeaderSize() + 2);
 
                        // Return position
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: seekPosition=%d - EXIT!', $seekPosition));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: seekPosition=%d - EXIT!', $seekPosition));
                        return $seekPosition;
                }
 
                // @TODO Unfinished
-               $this->partialStub('length=' . $length);
+               DebugMiddleware::getSelfInstance()->partialStub('length=' . $length);
        }
 
 }
index c24eca80b3d540c0a7f74c88838a824b16bec228..28ca8b1b4883f4385604f0f57da213e238f36d5b 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem\Index;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
 use Org\Mxchange\CoreFramework\Filesystem\Index\IndexableFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Index\Indexable;
 use Org\Mxchange\CoreFramework\Utils\Crypto\CryptoUtils;
@@ -20,7 +21,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -57,7 +58,7 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         */
        public final static function createIndexFile (SplFileInfo $fileInfoInstance, Indexable $indexInstance) {
                // Get a new instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: fileInfoInstance[%s]=%s,indexInstance=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance, $indexInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: fileInfoInstance[%s]=%s,indexInstance=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance, $indexInstance->__toString()));
                $indexFileInstance = new IndexFile();
 
                // Set file instance here for callbacks
@@ -73,7 +74,7 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                $indexFileInstance->initCountersGapsArray();
 
                // Return the prepared instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: indexFileInstance=%s - EXIT!', $indexFileInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: indexFileInstance=%s - EXIT!', $indexFileInstance->__toString()));
                return $indexFileInstance;
        }
 
@@ -85,18 +86,18 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         */
        public function flushFileHeader () {
                // Validate call
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: CALLED!');
                if (!($this->getIndexInstance() instanceof Indexable)) {
                        // Index instance not set
                        throw new BadMethodCallException('this->indexInstance[] is not properly set.');
                }
 
                // Call block instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Calling this->indexInstance->flushFileHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('INDEX-FILE: Invoking this->indexInstance->flushFileHeader() ...');
                $this->getIndexInstance()->flushFileHeader();
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: EXIT!');
        }
 
        /**
@@ -109,26 +110,27 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         */
        public function preAllocateFile (string $type) {
                // Is it enabled?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: type=%s - CALLED!', $type));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: type=%s - CALLED!', $type));
                if (empty($type)) {
                        // Empty type
-                       throw new InvalidArgumentException('Parameter "type" is empty');
+                       throw new InvalidArgumentException('Parameter "type" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!($this->getIndexInstance() instanceof Indexable)) {
                        // Index instance not set
                        throw new BadMethodCallException('this->indexInstance[] is not properly set.');
                }
 
                // Message to user
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Pre-allocating file ...');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('INDEX-FILE: Pre-allocating file ...');
 
                // Calculate minimum block length
                $minimumBlockLength = $this->getIndexInstance()->calculateMinimumBlockLength();
 
                // Call protected method
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: Invoking this->preAllocateFileByTypeLength(%s,%d) ...', $type, $minimumBlockLength));
                $this->preAllocateFileByTypeLength($type, $minimumBlockLength);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: EXIT!');
        }
 
        /**
@@ -136,27 +138,26 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
-        * @throws      UnexpectedValueException        If some value is not expected
         * @throws      BadMethodCallException  If this->indexInstance is not properly set
         */
        public function isValid () {
                // Validate call
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: CALLED!');
                if (!($this->getIndexInstance() instanceof Indexable)) {
                        // Index instance not set
                        throw new BadMethodCallException('this->indexInstance[] is not properly set.');
                }
 
                // Get length from index
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Calling this->indexInstance->calculateMinimumBlockLength() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: Invoking this->indexInstance->calculateMinimumBlockLength() ...');
                $length = $this->getIndexInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Calling this->isValidByLength(%d) ...', $length));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: Invoking this->isValidByLength(%d) ...', $length));
                $isValid = $this->isValidByLength($length);
 
                // Return result
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: isValid=%d - EXIT!', intval($isValid)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: isValid=%d - EXIT!', intval($isValid)));
                return $isValid;
        }
 
@@ -169,15 +170,15 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         */
        protected function readNextBlock () {
                // First calculate minimum block length
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: this->seekPosition=%d - CALLED!', $this->getSeekPosition()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: this->seekPosition=%d - CALLED!', $this->getSeekPosition()));
                $length = $this->getIndexInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Calling parent::readNextBlockByLength(%d) ...', $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: Invoking parent::readNextBlockByLength(%d) ...', $length));
                parent::readNextBlockByLength($length);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: EXIT!');
        }
 
        /**
@@ -187,11 +188,11 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         */
        public function readFileHeader () {
                // Call index class' method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Calling this->indexInstance->readIndexHeader() - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: Invoking this->indexInstance->readIndexHeader() - CALLED!');
                $this->getIndexInstance()->readIndexHeader();
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: EXIT!');
        }
 
        /**
@@ -205,10 +206,10 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         */
        public function writeValueToFile (string $stackName, $value) {
                // Validate parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: stackName=%s,value[]=%s - CALLED!', $stackName, gettype($value)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('INDEX-FILE: stackName=%s,value[]=%s - CALLED!', $stackName, gettype($value)));
                if (empty($stackName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "stackName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (is_object($value) || is_resource($value)) {
                        // Not wanted here
                        throw new InvalidArgumentException(sprintf('value[]=%s is not stackable in files', gettype($value)));
@@ -218,18 +219,19 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                }
 
                // Encode/convert the value into a "binary format"
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: Invoking StringUtils::encodeData(value[]=%s) ...', gettype($value)));
                $encoded = StringUtils::encodeData($value);
 
                // Get a strong hash for the "encoded" data
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: encoded=%s', $encoded));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('INDEX-FILE: encoded(%d)=%s', strlen($encoded), $encoded));
                $hash = CryptoUtils::hash($encoded);
 
                // Then write it to the next free gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: hash=%s', $hash));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('INDEX-FILE: hash=%s', $hash));
                $data = $this->getIndexInstance()->writeDataToFreeGap($stackName, $hash, $encoded);
 
                // Return info
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: data[]=%s - EXIT!', gettype($data)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('INDEX-FILE: data[]=%s - EXIT!', gettype($data)));
                return $data;
        }
 
@@ -243,8 +245,8 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeDataToFreeGap (string $stackName, string $hash, string $encoded) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: stackName=' . $stackName . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('INDEX-FILE: stackName=' . $stackName . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index a18b87a7e2bb49e6576b29b729a12bc7cf0dfb42..4f3c5b5ebd2cc85f097dcf7f059a15c09310518b 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Stack\File;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filesystem\Stack\FileStacker;
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Stack\File\StackableFile;
 use Org\Mxchange\CoreFramework\Utils\Crypto\CryptoUtils;
@@ -21,7 +22,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -58,7 +59,7 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         */
        public final static function createStackFile (SplFileInfo $infoInstance, StackableFile $stackInstance) {
                // Get a new instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: infoInstance[%s]=%s,stackInstance=%s - CALLED!', get_class($infoInstance), $infoInstance, $stackInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: infoInstance[%s]=%s,stackInstance=%s - CALLED!', get_class($infoInstance), $infoInstance, $stackInstance->__toString()));
                $stackFileInstance = new StackFile();
 
                // Set stack instance here for callbacks
@@ -71,7 +72,7 @@ class StackFile extends BaseBinaryFile implements FileStacker {
                $stackFileInstance->initCountersGapsArray();
 
                // Return the prepared instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: stackFileInstance=%s - EXIT!', $stackFileInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: stackFileInstance=%s - EXIT!', $stackFileInstance->__toString()));
                return $stackFileInstance;
        }
 
@@ -83,18 +84,18 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         */
        public function flushFileHeader () {
                // Validate call
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: CALLED!');
                if (!($this->getStackInstance() instanceof StackableFIle)) {
                        // Index instance not set
                        throw new BadMethodCallException('this->stackInstance[] is not properly set.');
                }
 
                // Call block instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Calling this->indexInstance->flushFileHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: Invoking this->indexInstance->flushFileHeader() ...');
                $this->getStackInstance()->flushFileHeader();
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: EXIT!');
        }
 
        /**
@@ -107,17 +108,17 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         */
        public function preAllocateFile (string $type) {
                // Is it enabled?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: type=%s - CALLED!', $type));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: type=%s - CALLED!', $type));
                if (empty($type)) {
                        // Empty type
-                       throw new InvalidArgumentException('Parameter "type" is empty');
+                       throw new InvalidArgumentException('Parameter "type" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!($this->getStackInstance() instanceof StackableFile) && !($this->getStackInstance() instanceof StackableFile)) {
                        // Index instance not set
                        throw new BadMethodCallException('this->stackInstance[] and this->pointerInstance are not properly set.');
                }
 
                // Message to user
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Pre-allocating file ...');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('STACK-FILE: Pre-allocating file ...');
 
                // Calculate minimum block length and get file size
                $minimumBlockLength = $this->getStackInstance()->calculateMinimumBlockLength();
@@ -126,7 +127,7 @@ class StackFile extends BaseBinaryFile implements FileStacker {
                $this->preAllocateFileByTypeLength($type, $minimumBlockLength);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: EXIT!');
        }
 
        /**
@@ -134,27 +135,26 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
-        * @throws      UnexpectedValueException        If some value is not expected
         * @throws      BadMethodCallException  If this->stackInstance is not properly set
         */
        public function isValid () {
                // Validate call
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: CALLED!');
                if (!($this->getStackInstance() instanceof StackableFile)) {
                        // Index instance not set
                        throw new BadMethodCallException('this->stackInstance[] is not properly set.');
                }
 
                // Get length from index
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Calling this->stackInstance->calculateMinimumBlockLength() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: Invoking this->stackInstance->calculateMinimumBlockLength() ...');
                $length = $this->getStackInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling this->isValidByLength(%d) ...', $length));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STACK-FILE: Invoking this->isValidByLength(%d) ...', $length));
                $isValid = $this->isValidByLength($length);
 
                // Return result
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: isValid=%d - EXIT!', intval($isValid)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: isValid=%d - EXIT!', intval($isValid)));
                return $isValid;
        }
 
@@ -166,11 +166,11 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         */
        public function readFileHeader () {
                // Call stacke instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Calling this->stackInstance->readStackHeader() - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: Invoking this->stackInstance->readStackHeader() - CALLED!');
                $this->getStackInstance()->readStackHeader();
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: EXIT!');
        }
 
        /**
@@ -182,15 +182,15 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         */
        protected function readNextBlock () {
                // First calculate minimum block length
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: this->seekPosition=%d - CALLED!', $this->getSeekPosition()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: this->seekPosition=%d - CALLED!', $this->getSeekPosition()));
                $length = $this->getStackInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling parent::readNextBlockByLength(%d) ...', $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: Invoking parent::readNextBlockByLength(%d) ...', $length));
                parent::readNextBlockByLength($length);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: EXIT!');
        }
 
        /**
@@ -203,29 +203,29 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         */
        public function writeValueToFile (string $stackName, $value) {
                // Validate parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: stackName=%s,value[]=%s - CALLED!', $stackName, gettype($value)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: stackName=%s,value[]=%s - CALLED!', $stackName, gettype($value)));
                if (empty($stackName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "stackName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (is_object($value) || is_resource($value)) {
                        // Not wanted here
                        throw new InvalidArgumentException(sprintf('value[]=%s is not stackable in files', gettype($value)));
                }
 
                // Encode/convert the value into a "binary format"
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling StringUtils::encodeData(value[]=%s) ...', gettype($value)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: Invoking StringUtils::encodeData(value[]=%s) ...', gettype($value)));
                $encoded = StringUtils::encodeData($value);
 
                // Get a strong hash for the "encoded" data
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling CryptoUtils::hash(%s) ...', $encoded));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: Invoking CryptoUtils::hash(%s) ...', $encoded));
                $hash = CryptoUtils::hash($encoded);
 
                // Then write it to the next free gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling this->stackInstance->writeDataToFreeGap(%s,%s,%s) ...', $stackName, $hash, $encoded));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: Invoking this->stackInstance->writeDataToFreeGap(%s,%s,%s) ...', $stackName, $hash, $encoded));
                $data = $this->getStackInstance()->writeDataToFreeGap($stackName, $hash, $encoded);
 
                // Return info
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: data[]=%s - EXIT!', gettype($data)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STACK-FILE: data[]=%s - EXIT!', gettype($data)));
                return $data;
        }
 
@@ -239,8 +239,8 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeDataToFreeGap (string $stackName, string $hash, string $encoded) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: stackName=' . $stackName . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STACK-FILE: stackName=' . $stackName . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 88974fa5a4ec3565ecce6208743c4d092c3c4645..2e0aefe49594de36f6adc9b54e80881d87d368b2 100644 (file)
@@ -5,15 +5,19 @@ namespace Org\Mxchange\CoreFramework\Filesystem\File;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\CloseableFile;
 use Org\Mxchange\CoreFramework\Filesystem\FilePointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * An abstract file class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -49,7 +53,11 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-ABSTRACT-FILE: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: EXIT!');
        }
 
        /**
@@ -84,7 +92,11 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        protected final function unsetPointerInstance () {
                // Simply invoke setter with no parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                $this->setPointerInstance();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: EXIT!');
        }
 
        /**
@@ -94,10 +106,14 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public final function __destruct() {
                // Try to close a file
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: DESTRUCTED!');
                $this->closeFile();
 
                // Call the parent destructor
                parent::__destruct();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: EXIT!');
        }
 
        /**
@@ -107,6 +123,7 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public function getFileSize () {
                // Call pointer instanze
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                return $this->getPointerInstance()->getFileSize();
        }
 
@@ -117,7 +134,7 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public final function getCounter () {
                // Get it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-ABSTRACT-FILE: Getting this->totalEntries=%d ... - CALLED!', $this->totalEntries));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-ABSTRACT-FILE: Getting this->totalEntries=%d ... - CALLED!', $this->totalEntries));
                return $this->totalEntries;
        }
 
@@ -129,7 +146,7 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        protected final function setCounter (int $counter) {
                // Set it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-ABSTRACT-FILE: Setting this->totalEntries=%d ... - CALLED!', $counter));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-ABSTRACT-FILE: Setting this->totalEntries=%d ... - CALLED!', $counter));
                $this->totalEntries = $counter;
        }
 
@@ -139,12 +156,12 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         * @return      void
         */
        protected final function incrementCounter () {
-               // Get it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: CALLED!');
+               // Count up
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                $this->totalEntries++;
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: EXIT!');
        }
 
        /**
@@ -153,6 +170,8 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         * @return      $fileObject             An instance of a SplFileObject
         */
        public final function getFileObject () {
+               // Call pointer instanze
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                return $this->getPointerInstance()->getFileObject();
        }
 
@@ -161,6 +180,7 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public final function getFilename () {
                // Invole file object's method
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                return $this->getFileObject()->getFilename();
        }
 
@@ -172,11 +192,11 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public function closeFile () {
                // Close down pointer instance as well by unsetting it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                $this->unsetPointerInstance();
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-ABSTRACT-FILE: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: EXIT!');
        }
 
        /**
@@ -187,6 +207,7 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public function size () {
                // Call pointer instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                return $this->getPointerInstance()->size();
        }
 
@@ -200,6 +221,7 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public function readFromFile () {
                // Call pointer instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                return $this->getPointerInstance()->readFromFile();
        }
 
@@ -214,6 +236,13 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         *                                                                                      an invalid file resource
         */
        public function writeToFile (string $dataStream) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-ABSTRACT-FILE: dataStream()=%d - CALLED!', strlen($dataStream)));
+               if (empty($dataStream)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Call pointer instance
                return $this->getPointerInstance()->writeToFile($dataStream);
        }
@@ -225,6 +254,7 @@ abstract class BaseAbstractFile extends BaseFrameworkSystem implements FilePoint
         */
        public final function isEndOfFileReached () {
                // Call pointer instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-ABSTRACT-FILE: CALLED!');
                return $this->getPointerInstance()->isEndOfFileReached();
        }
 
index 05098d0b0d25aeae391a49e8d3cbc3c2fe21e489..d093dda0f2913b8fee0f0534136f10b0a0bacf50 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\CloseableFile;
 use Org\Mxchange\CoreFramework\Filesystem\FilePointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
@@ -17,7 +18,7 @@ use \SplFileObject;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -48,7 +49,11 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-IO: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FILE-IO: EXIT!');
        }
 
        /**
@@ -58,10 +63,10 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
         */
        public final function __destruct() {
                // Is there a resource pointer? Then we have to close the file here!
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: this->fileObject[]=%s - DESTRUCTOR!', gettype($this->getFileObject())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-IO: this->fileObject[]=%s - DESTRUCTOR!', gettype($this->getFileObject())));
                if (is_object($this->getFileObject())) {
                        // Try to close a file
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-IO: Calling this->closeFile() ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FILE-IO: Invoking this->closeFile() ...');
                        $this->closeFile();
                }
 
@@ -69,7 +74,7 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
                parent::__destruct();
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-IO: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FILE-IO: EXIT!');
        }
 
        /**
@@ -82,21 +87,21 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
         */
        public function closeFile () {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: fileName=%s - CALLED!', $this->getFileObject()->getPathname()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-IO: fileName=%s - CALLED!', $this->getFileObject()->getPathname()));
                if (is_null($this->getFileObject())) {
                        // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Close the file pointer by NULL-ing it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: Closing file %s ...', $this->getFileObject()->getPathname()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-IO: Closing file %s ...', $this->getFileObject()->getPathname()));
                $this->resetFileObject();
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-IO: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FILE-IO: EXIT!');
        }
 
        /**
@@ -106,7 +111,11 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
         */
        protected final function resetFileObject () {
                // Set it to NULL
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FILE-IO: Setting this->fileObject=NULL - CALLED!');
                $this->fileObject = NULL;
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FILE-IO: EXIT!');
        }
 
        /**
@@ -155,7 +164,7 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
         */
        public function seek (int $offset, int $whence = SEEK_SET) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: offset=%d,whence=%d - CALLED!', $offset, $whence));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-IO: offset=%d,whence=%d - CALLED!', $offset, $whence));
                if ($offset < 0) {
                        // Throw exception
                        throw new OutOfBoundsException(sprintf('offset=%d is not valid', $offset));
@@ -165,7 +174,7 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
                $status = $this->getFileObject()->fseek($offset, $whence);
 
                // Return status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: status=%d - EXIT!', $status));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-IO: status=%d - EXIT!', $status));
                return $status;
        }
 
@@ -177,22 +186,22 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
         */
        public function size () {
                // Get current seek position
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-IO: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-FILE-IO: CALLED!');
                $seekPosition = $this->determineSeekPosition();
 
                // Seek to end
                $seekStatus = $this->seek(0, SEEK_END);
 
                // Get position again (which is the end of the file)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: seekStatus[%s]=%d', gettype($seekStatus), $seekStatus));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-IO: seekStatus[%s]=%d', gettype($seekStatus), $seekStatus));
                $size = $this->determineSeekPosition();
 
                // Reset seek position to old
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: size[%s]=%d', gettype($size), $size));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-IO: size[%s]=%d', gettype($size), $size));
                $this->seek($seekPosition);
 
                // Return size
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: size=%d - EXIT!', $size));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-IO: size=%d - EXIT!', $size));
                return $size;
        }
 
index b4f79334e1dfaf58f33b2f6a5bdb861b8e077a70..f080e3281e1107430d23f36ea77135f7df59bc9c 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Filesytem\Pointer;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\FrameworkDirectory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
@@ -19,7 +20,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -60,6 +61,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
         */
        public function __destruct() {
                // Is there a resource pointer? Then we have to close the directory here!
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FRAMEWORK-DIRECTORY-POINTER: DESTRUCTED!');
                if ($this->getDirectoryIteratorInstance() instanceof DirectoryIterator) {
                        // Try to close a directory
                        $this->closeDirectory();
@@ -67,6 +69,9 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
 
                // Call the parent destructor
                parent::__destruct();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FRAMEWORK-DIRECTORY-POINTER: EXIT!');
        }
 
        /**
@@ -82,9 +87,10 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
         */
        public static final function createFrameworkDirectoryPointer (string $pathName) {
                // Some pre-sanity checks...
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FRAMEWORK-DIRECTORY-POINTER: pathName=%s - CALLED!', $pathName));
                if (empty($pathName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "pathName" is empty');
+                       throw new InvalidArgumentException('Parameter "pathName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!is_dir($pathName)) {
                        // Not a directory
                        throw new PathIsNoDirectoryException($pathName, self::EXCEPTION_INVALID_PATH_NAME);
@@ -107,7 +113,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
                $pointerInstance->setPathName($pathName);
 
                // Return the instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY-POINTER: Opened pathName=' . $pathName . ' - EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DIRECTORY-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
                return $pointerInstance;
        }
 
@@ -118,14 +124,14 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
         */
        public function readRawDirectory () {
                // Can the next entry be read?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY-POINTER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DIRECTORY-POINTER: CALLED!');
                assert($this->getDirectoryIteratorInstance()->valid());
 
                // Read data from the directory pointer and return it
                $currentEntry = $this->getDirectoryIteratorInstance()->current();
 
                // Return found entry
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DIRECTORY-POINTER: currentEntry[%s]=%s - EXIT!', gettype($currentEntry), $currentEntry));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DIRECTORY-POINTER: currentEntry[%s]=%s - EXIT!', gettype($currentEntry), $currentEntry));
                return $currentEntry;
        }
 
@@ -134,17 +140,17 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
         *
         * @param       $except         Some parts of a directory we want to ignore. Valid: directory and file names, other values will be silently ignored
         * @return      SplFileInfo             An instance of a SplFileInfo class
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function readDirectoryExcept (array $except = []) {
                // No exceptions given?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DIRECTORY-POINTER: except()=%d - CALLED!', count($except)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DIRECTORY-POINTER: except()=%d - CALLED!', count($except)));
                if (count($except) == 0) {
                        // No exception given, so read all files and directories, but not recursive
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY-POINTER: No exceptions given, please use readRawDirectory() instead!');
-                       return $this->readRawDirectory();
+                       throw new InvalidArgumentException('Parameter "except" is an empty array', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->getDirectoryIteratorInstance()->valid()) {
                        // No more left to read
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY-POINTER: EOD reached - EXIT!');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DIRECTORY-POINTER: EOD reached - EXIT!');
                        return NULL;
                }
 
@@ -155,26 +161,26 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
                $currentEntry = $this->readRawDirectory();
 
                // Shall we exclude directories?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DIRECTORY-POINTER: currentEntry[]=%s', gettype($currentEntry)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DIRECTORY-POINTER: currentEntry[]=%s', gettype($currentEntry)));
                if (is_object($currentEntry)) {
                        // Get file name
                        $fileInfoInstance = $currentEntry;
 
                        // Is it a dot-directory or excluded?
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DIRECTORY-POINTER: fileInfoInstance->filename=%s,isDot=%d', $fileInfoInstance->getFilename(), intval($this->getDirectoryIteratorInstance()->isDot())));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('DIRECTORY-POINTER: fileInfoInstance->filename=%s,isDot=%d', $fileInfoInstance->getFilename(), intval($this->getDirectoryIteratorInstance()->isDot())));
                        while ($this->getDirectoryIteratorInstance()->valid() && ($this->getDirectoryIteratorInstance()->isDot() || in_array($fileInfoInstance->getFilename(), $except))) {
                                // Update current instance
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DIRECTORY-POINTER: fileInfoInstance->filename=%s,isDot=%d', $fileInfoInstance->getFilename(), intval($this->getDirectoryIteratorInstance()->isDot())));
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('DIRECTORY-POINTER: fileInfoInstance->filename=%s,isDot=%d', $fileInfoInstance->getFilename(), intval($this->getDirectoryIteratorInstance()->isDot())));
                                $fileInfoInstance = $this->readRawDirectory();
 
                                // To next entry
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY-POINTER: Invoking directoryIteratorInstance->next() ...');
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('DIRECTORY-POINTER: Invoking directoryIteratorInstance->next() ...');
                                $this->getDirectoryIteratorInstance()->next();
                        }
                }
 
                // Return read line
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DIRECTORY-POINTER: fileInfoInstance[%s]=%s - EXIT!', gettype($fileInfoInstance), $fileInfoInstance));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DIRECTORY-POINTER: fileInfoInstance[%s]=%s - EXIT!', gettype($fileInfoInstance), $fileInfoInstance));
                return $fileInfoInstance;
        }
 
@@ -186,9 +192,12 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
         */
        public function closeDirectory () {
                // Close the directory by unsetting it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY-POINTER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DIRECTORY-POINTER: CALLED!');
                $this->unsetDirectoryIteratorInstance();
                $this->setPathName('');
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DIRECTORY-POINTER: CALLED!');
        }
 
        /**
index 6461ae621fef1efeabc91d9f6b35b561bb2a3af0..4ba33c572334dc819c300b2e21754c3228c64240 100644 (file)
@@ -9,20 +9,23 @@ use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Filesystem\FileReadProtectedException;
 use Org\Mxchange\CoreFramework\Filesystem\Pointer\InputPointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
+use \InvalidArgumentException;
 use \SplFileInfo;
 use \SplFileObject;
+use \UnexpectedValueException;
 
 /**
  * A class for reading files
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -62,7 +65,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         */
        public static final function createFrameworkRawFileInputPointer (SplFileInfo $fileInstance) {
                // Some pre-sanity checks...
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-INPUT-POINTER: fileInstance[%s]=%s - CALLED!', get_class($fileInstance), $fileInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: fileInstance[%s]=%s - CALLED!', get_class($fileInstance), $fileInstance->__toString()));
                if (!FrameworkBootstrap::isReachableFilePath($fileInstance)) {
                        // File cannot be accessed (due to open_basedir restriction)
                        throw new FileIoException($fileInstance, self::EXCEPTION_FILE_NOT_REACHABLE);
@@ -78,20 +81,21 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
                $fileObject = $fileInstance->openFile('rb');
 
                // Is it valid?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-INPUT-POINTER: fileObject[]=%s', gettype($fileObject)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('RAW-FILE-INPUT-POINTER: fileObject[]=%s', gettype($fileObject)));
                if (!($fileObject instanceof SplFileObject)) {
                        // Something bad happend
                        throw new FileIoException($fileInstance, self::EXCEPTION_FILE_POINTER_INVALID);
                }
 
                // Create new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('RAW-FILE-INPUT-POINTER: fileObject.pathname=%s', $fileObject->getPathname()));
                $pointerInstance = new FrameworkRawFileInputPointer();
 
                // Set file pointer and file name
                $pointerInstance->setFileObject($fileObject);
 
                // Return the instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-INPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
                return $pointerInstance;
        }
 
@@ -103,15 +107,18 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      LogicException  If there is no object being set
         */
        public function readFromFile () {
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('RAW-FILE-INPUT-POINTER: CALLED!');
                if (is_null($this->getFileObject())) {
                        // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Read data from the file pointer and return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('RAW-FILE-INPUT-POINTER: Invoking this->read(1024) - EXIT!');
                return $this->read(1024);
        }
 
@@ -123,7 +130,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         */
        public function readLine () {
                // Not supported in binary files ...
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -131,12 +138,28 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         *
         * @param       $bytes  Amount of bytes to read
         * @return      $data   Data read from file
+        * @throws      InvalidArgumentException        If a parameter is not valid
+        * @throws      UnexpectedValueException        If fread() returns a non-string value
         */
        public function read (int $bytes = 0) {
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: bytes=%d - CALLED!', $bytes));
+               if ($bytes < 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('bytes=%d is an invalid value, only zero or postive numbers are accepted', $bytes));
+               }
+
                // Try to read given characters
                $data = $this->getFileObject()->fread($bytes);
 
+               // Is it valid?
+               if (!is_string($data)) {
+                       // Is not a string
+                       throw new UnexpectedValueException(sprintf('Returned data[]=%s is not expected.', gettype($data)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+               }
+
                // Then return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: data()=%d - EXIT!', strlen($data)));
                return $data;
        }
 
@@ -149,7 +172,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function analyzeFileStructure () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -159,7 +182,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function next () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -170,7 +193,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function valid () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -180,7 +203,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function key () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index c5b3e8113b850d2c62d068c181ef5a7419515ad4..1805d7c8c5338601537fc79b985451aa1b115710 100644 (file)
@@ -9,6 +9,7 @@ use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Filesystem\FileReadProtectedException;
 use Org\Mxchange\CoreFramework\Filesystem\Pointer\InputPointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
@@ -22,7 +23,7 @@ use \SplFileObject;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -61,7 +62,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         */
        public static final function createFrameworkTextFileInputPointer (SplFileInfo $fileInstance) {
                // Check parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-INPUT-POINTER: fileInstance[%s]=%s - CALLED!', get_class($fileInstance), $fileInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: fileInstance[%s]=%s - CALLED!', get_class($fileInstance), $fileInstance->__toString()));
                if (!FrameworkBootstrap::isReachableFilePath($fileInstance)) {
                        // File cannot be reached
                        throw new FileIoException($fileInstance, self::EXCEPTION_FILE_NOT_REACHABLE);
@@ -77,7 +78,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
                $fileObject = $fileInstance->openFile('r');
 
                // Is it valid?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEXT-FILE-INPUT-POINTER: fileObject[]=%s', gettype($fileObject)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TEXT-FILE-INPUT-POINTER: fileObject[]=%s', gettype($fileObject)));
                if (!($fileObject instanceof SplFileObject)) {
                        // Something bad happend
                        throw new FileIoException($fileInstance, self::EXCEPTION_FILE_POINTER_INVALID);
@@ -90,7 +91,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
                $pointerInstance->setFileObject($fileObject);
 
                // Return the instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEXT-FILE-INPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TEXT-FILE-INPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
                return $pointerInstance;
        }
 
@@ -101,6 +102,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         */
        public function readFromFile () {
                // Read 1024 Byte data from the file pointer and return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('RAW-FILE-INPUT-POINTER: CALLED!');
                return $this->read(1024);
        }
 
@@ -111,6 +113,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         */
        public function readLine () {
                // Read whole line from the file pointer and return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('RAW-FILE-INPUT-POINTER: CALLED!');
                return $this->read();
        }
 
@@ -125,27 +128,31 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         */
        public function read (int $bytes = 0) {
                // Some sanity checks
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: bytes=%d - CALLED!', $bytes));
                if ($bytes < 0) {
                        // Cannot be below zero
                        throw new OutOfBoundsException(sprintf('bytes=%d is not valid', $bytes));
                } elseif (is_null($this->getFileObject())) {
                        // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Is $bytes set?
                if ($bytes > 0) {
                        // Try to read given characters
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: Invoking this->fileObject->fread(%d) ...', $bytes));
                        $data = $this->getFileObject()->fread($bytes);
                } else {
                        // Try to read whole line
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('RAW-FILE-INPUT-POINTER: Invoking this->fileObject->fgets() ...');
                        $data = $this->getFileObject()->fgets();
                }
 
                // Then return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: data()=%d - EXIT!', strlen($data)));
                return $data;
        }
 
@@ -158,7 +165,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function analyzeFileStructure () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -168,7 +175,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function next () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -179,7 +186,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function valid () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -189,7 +196,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function key () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 523bcfcf55a5621f3072d98272a35c7d62b824db..2a03a01110fb7f2ccf87351440f913d11f966416 100644 (file)
@@ -9,6 +9,7 @@ use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\FileReadProtectedException;
 use Org\Mxchange\CoreFramework\Filesystem\FileWriteProtectedException;
 use Org\Mxchange\CoreFramework\Filesystem\PathWriteProtectedException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
@@ -25,7 +26,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -66,7 +67,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public static final function createFrameworkFileInputOutputPointer (SplFileInfo $fileInstance) {
                // Some pre-sanity checks...
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: fileInstance[%s]=%s - CALLED!', get_class($fileInstance), $fileInstance));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: fileInstance[%s]=%s - CALLED!', get_class($fileInstance), $fileInstance));
                if (!FrameworkBootstrap::isReachableFilePath($fileInstance)) {
                        // File exists but cannot be read
                        throw new FileIoException($fileInstance, self::EXCEPTION_FILE_NOT_REACHABLE);
@@ -85,7 +86,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                $fileObject = $fileInstance->openFile('c+b');
 
                // Is it valid?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: fileObject[]=%s', gettype($fileObject)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: fileObject[]=%s', gettype($fileObject)));
                if (!($fileObject instanceof SplFileObject)) {
                        // Something bad happend
                        throw new FileIoException($fileInstance->getPathname(), self::EXCEPTION_FILE_POINTER_INVALID);
@@ -98,7 +99,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                $pointerInstance->setFileObject($fileObject);
 
                // Return the instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
                return $pointerInstance;
        }
 
@@ -109,11 +110,11 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function readFromFile () {
                // Read data from the file pointer and return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILE-INPUT-OUTPUT-POINTER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-INPUT-OUTPUT-POINTER: CALLED!');
                $data = $this->read(1024);
 
                // Return data
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: data[%s]=%d - EXIT!', gettype($data), $data));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: data[%s]=%d - EXIT!', gettype($data), $data));
                return $data;
        }
 
@@ -125,21 +126,21 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function writeToFile (string $dataStream) {
                // Validate parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: dataStream(%d)=%s - CALLED!', strlen($dataStream), $dataStream));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: dataStream(%d)=%s - CALLED!', strlen($dataStream), $dataStream));
                if (empty($dataStream)) {
                        // Empty dataStream
-                       throw new InvalidArgumentException('Parameter "dataStream" is empty');
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get length
                $length = strlen($dataStream);
 
                // Write data to the file pointer and return written bytes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: Calling this->fileObject->fwrite(%s,%d) ...', $dataStream, $length));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: Invoking this->fileObject->fwrite(%s,%d) ...', $dataStream, $length));
                $status = $this->getFileObject()->fwrite($dataStream, $length);
 
                // Return status
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: status[%s]=%d - EXIT!', gettype($status), $status));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: status[%s]=%d - EXIT!', gettype($status), $status));
                return $status;
        }
 
@@ -154,24 +155,24 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function writeAtPosition (int $seekPosition, string $dataStream) {
                // Validate parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: seekPosition=%d,dataStream(%d)=%s - CALLED!', $seekPosition, strlen($dataStream), $dataStream));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: seekPosition=%d,dataStream(%d)=%s - CALLED!', $seekPosition, strlen($dataStream), $dataStream));
                if ($seekPosition < 0) {
                        // Invalid seek position
                        throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid.', $seekPosition));
                } elseif (empty($dataStream)) {
                        // Empty dataStream
-                       throw new InvalidArgumentException('Parameter "dataStream" is empty');
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (($this->getFileSize() > 0 || $seekPosition > 0) && $this->seek($seekPosition) === -1) {
                        // Could not seek
                        throw new InvalidArgumentException(sprintf('Could not seek to seekPosition=%d', $seekPosition));
                }
 
                // Then write the data at that position
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: Calling this->writeToFile(%s) ...', $dataStream));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: Invoking this->writeToFile(%s) ...', $dataStream));
                $status = $this->writeToFile($dataStream);
 
                // Return status
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: status[%s]=%d - EXIT!', gettype($status), $status));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: status[%s]=%d - EXIT!', gettype($status), $status));
                return $status;
        }
 
@@ -182,11 +183,11 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function rewind () {
                /// Rewind the pointer
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILE-INPUT-OUTPUT-POINTER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-INPUT-OUTPUT-POINTER: CALLED!');
                $this->getFileObject()->rewind();
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILE-INPUT-OUTPUT-POINTER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-INPUT-OUTPUT-POINTER: EXIT!');
        }
 
        /**
@@ -199,17 +200,20 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function seek (int $seekPosition, int $whence = SEEK_SET) {
                // Validate parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence));
                if ($seekPosition < 0) {
                        // Invalid seek position
                        throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid.', $seekPosition));
+               } elseif ($whence < 0) {
+                       // Invalid seek position
+                       throw new OutOfBoundsException(sprintf('whence=%d is not valid.', $whence));
                }
 
                // Move the file pointer
                $status = $this->getFileObject()->fseek($seekPosition, $whence);
 
                // Return status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: status[%s]=%d - EXIT!', gettype($status), $status));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: status[%s]=%d - EXIT!', gettype($status), $status));
                return $status;
        }
 
@@ -220,11 +224,11 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function readLine () {
                // Read whole line
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILE-INPUT-OUTPUT-POINTER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-INPUT-OUTPUT-POINTER: CALLED!');
                $data = $this->read();
 
                // Return data
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: data[%s]=%s - EXIT!', gettype($data), $data));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: data[%s]=%s - EXIT!', gettype($data), $data));
                return $data;
        }
 
@@ -237,7 +241,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function read (int $bytes = 0) {
                // Validatre parameter
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: bytes=%d - CALLED!', $bytes));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: bytes=%d - CALLED!', $bytes));
                if ($bytes < 0) {
                        // Bytes cannot be lesser than zero
                        throw new OutOfBoundsException(sprintf('bytes=%d is not valid', $bytes));
@@ -253,7 +257,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                }
 
                // Then return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: data[%s]=%s - EXIT!', gettype($data), $data));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: data[%s]=%s - EXIT!', gettype($data), $data));
                return $data;
        }
 
@@ -266,7 +270,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function analyzeFileStructure () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -276,7 +280,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function next () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -287,7 +291,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function valid () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -297,7 +301,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function key () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -308,17 +312,17 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         */
        public function getFileSize () {
                // Get file's data
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILE-INPUT-OUTPUT-POINTER: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-INPUT-OUTPUT-POINTER: CALLED!');
                $fileData = $this->getFileObject()->fstat();
 
                // Make sure the required array key is there
                if (!isset($fileData['size'])) {
                        // Not valid array
-                       throw new UnexpectedValueException(sprintf('fileData=%s has no element "size"', print_r($fileData, TRUE)));
+                       throw new UnexpectedValueException(sprintf('fileData=%s has no element "size"', print_r($fileData, TRUE)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Return size
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: fileData[size]=%d - EXIT!', $fileData['size']));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: fileData[size]=%d - EXIT!', $fileData['size']));
                return $fileData['size'];
        }
 
index 4255f3e68b37b5b8a4d182b113d5aaea9488b706..9a82005ca9669aa738187231a6b1e0066054162e 100644 (file)
@@ -6,12 +6,16 @@ namespace Org\Mxchange\CoreFramework\Stream\Filesystem;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Stream\Filesystem\FileInputStreamer;
 use Org\Mxchange\CoreFramework\Stream\Filesystem\FileOutputStreamer;
 
 // Import SPL stuff
+use \InvalidArgumentException;
+use \OutOfBoundsException;
 use \SplFileInfo;
 
 /**
@@ -19,7 +23,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -73,9 +77,11 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         */
        public static final function createFileIoStream () {
                // Create new instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-STREAM: CALLED!');
                $ioInstance = new FileIoStream();
 
                // Return the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: ioInstance=%s - EXIT!', $ioInstance->__toString()));
                return $ioInstance;
        }
 
@@ -86,24 +92,33 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @param       $dataArray      The data we shall store to the file
         * @return      void
         * @see         FileOutputStreamer
-        * @todo        This method needs heavy rewrite
+        * @throws      InvalidArgumentException        If an invalid parameter was given
+        * @throws      OutOfBoundsException    If an expected array element wasn't found
         */
        public final function saveFile (SplFileInfo $fileInfoInstance, array $dataArray) {
-               // Try it five times
-               $dirName = '';
-               $fileInstance = NULL;
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: fileInfoInstance=%s,dataArray()=%d - CALLED!', $fileInfoInstance, count($dataArray)));
+               if (count($dataArray) < 2) {
+                       // Not valid array, at least 2 elements must be there!
+                       throw new InvalidArgumentException(sprintf('Parameter "dataArray" should have at least 2 elements, has %d', count($dataArray)));
+               } else if (!isset($dataArray[0])) {
+                       // Array element 0 not found
+                       throw new OutOfBoundsException(sprintf('Array element dataArray[0] not found, dataArray=%s', json_encode($dataArray)));
+               } else if (!isset($dataArray[1])) {
+                       // Array element 1 not found
+                       throw new OutOfBoundsException(sprintf('Array element dataArray[1] not found, dataArray=%s', json_encode($dataArray)));
+               }
 
-               for ($idx = 0; $idx < 5; $idx++) {
+               try {
                        // Get a file output pointer
-                       try {
-                               $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_output_class', array($fileInfoInstance, 'wb'));
-                       } catch (FileNotFoundException $e) {
-                               // Bail out
-                               ApplicationEntryPoint::exitApplication('The application has made a fatal error. Exception: ' . $e->__toString() . ' with message: ' . $e->getMessage());
-                       }
+                       $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_output_class', [$fileInfoInstance, 'wb']);
+               } catch (FileNotFoundException $e) {
+                       // Bail out
+                       ApplicationEntryPoint::exitApplication('The application has made a fatal error. Exception: ' . $e->__toString() . ' with message: ' . $e->getMessage());
                }
 
                // Write a header information for validation purposes
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Writing header to fileInstance=%s ...', $fileInstance->__toString()));
                $fileInstance->writeToFile(sprintf('%s%s%s%s%s%s%s%s%s' . PHP_EOL,
                        self::FILE_IO_FILE_HEADER_ID,
                        self::FILE_IO_SEPARATOR,
@@ -117,15 +132,17 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                ));
 
                // Encode the (maybe) binary stream with Base64
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Encoding %d bytes to BASE64 string ...', strlen($dataArray[1])));
                $b64Stream = base64_encode($dataArray[1]);
 
-               // write the data line by line
+               // write the data line-by-line
                $line = str_repeat(' ', 50); $idx = 0;
                while (strlen($line) == 50) {
                        // Get 50 chars or less
                        $line = substr($b64Stream, $idx, 50);
 
                        // Save it to the stream
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Writing %d bytes to file ...', strlen($line)));
                        $fileInstance->writeToFile(sprintf('%s%s%s%s%s' . PHP_EOL,
                                self::FILE_IO_DATA_BLOCK_ID,
                                self::FILE_IO_SEPARATOR,
@@ -139,7 +156,11 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                }
 
                // Close the file
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILE-IO-STREAM: Closing file ...');
                unset($fileInstance);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-STREAM: EXIT!');
        }
 
        /**
@@ -151,6 +172,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         */
        public final function loadFileContents (SplFileInfo $infoInstance) {
                // Initialize some variables and arrays
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: infoInstance=%s - CALLED!', $infoInstance));
                $inputBuffer = '';
                $lastBuffer = '';
                $header = [];
@@ -161,12 +183,16 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_class', array($infoInstance));
 
                // Read all it's contents (we very and transparently decompress it below)
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: fileInstance=%s', $fileInstance->__toString()));
                while ($readRawLine = $fileInstance->readFromFile()) {
                        // Add the read line to the buffer
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Adding %d read bytes to input buffer.', strlen($readRawLine)));
                        $inputBuffer .= $readRawLine;
 
                        // Break infinite loop maybe caused by the input handler
                        if ($lastBuffer == $inputBuffer) {
+                               // Break out of loop, EOF reached?
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILE-IO-STREAM: EOF reached!');
                                break;
                        }
 
@@ -175,89 +201,113 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
                }
 
                // Close directory handle
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILE-IO-STREAM: Closing file ...');
                unset($fileInstance);
 
                // Convert it into an array
-               $inputBuffer = explode(chr(10), $inputBuffer);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Read inputBuffer=%d bytes from infoInstance=%s', strlen($inputBuffer), $infoInstance));
+               $inputArray = explode(chr(10), $inputBuffer);
 
                // Now process the read lines and verify it's content
-               foreach ($inputBuffer as $rawLine) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: inputArray()=%d', count($inputArray)));
+               foreach ($inputArray as $rawLine) {
                        // Trim it a little but not the leading spaces/tab-stops
                        $rawLine = rtrim($rawLine);
 
                        // Analyze this line
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: rawLine()=%d', strlen($rawLine)));
                        if (substr($rawLine, 0, 5) == self::FILE_IO_FILE_HEADER_ID) {
                                // Header found, so let's extract it
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Found header, rawLine=%s', $rawLine));
                                $header = explode(self::FILE_IO_SEPARATOR, $rawLine);
-                               $header = trim($header[1]);
+                               $headerLine = trim($header[1]);
 
                                // Now we must convert it again into an array
-                               $header = explode(self::FILE_IO_CHUNKER, $header);
+                               $header = explode(self::FILE_IO_CHUNKER, $headerLine);
 
                                // Is the header (maybe) valid?
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: header()=%d', count($header)));
                                if (count($header) != 4) {
                                        // Throw an exception
-                                       throw new InvalidArrayCountException(array($this, 'header', count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
+                                       throw new InvalidArrayCountException([$this, 'header', count($header), 4], self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
                                }
                        } elseif (substr($rawLine, 0, 5) == self::FILE_IO_DATA_BLOCK_ID) {
                                // Is a data line!
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Data line found rawLine=%s', $rawLine));
                                $data = explode(self::FILE_IO_SEPARATOR, $rawLine);
-                               $data = $data[1];
+                               $dataLine = $data[1];
 
                                // First element is the data, second the MD5 checksum
-                               $data = explode(self::FILE_IO_CHUNKER, $data);
+                               $data = explode(self::FILE_IO_CHUNKER, $dataLine);
 
                                // Validate the read line
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: data()=%d', count($data)));
                                if (count($data) == 2) {
-                                       if (md5($data[0]) != $data[1]) {
+                                       // Generate checksum (MD5 is okay here)
+                                       $checksum = md5($data[0]);
+
+                                       // Check if it matches provided one
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: checksum=%s,data[1]=%s', $checksum, $data[1]));
+                                       if ($checksum != $data[1]) {
                                                // MD5 hash did not match!
-                                               throw new InvalidMD5ChecksumException(array($this, md5($data[0]), $data[1]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
+                                               throw new InvalidMD5ChecksumException([$this, $checksum, $data[1]], self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
                                        }
                                } else {
                                        // Invalid count!
-                                       throw new InvalidArrayCountException(array($this, 'data', count($data), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
+                                       throw new InvalidArrayCountException([$this, 'data', count($data), 2], self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
                                }
 
                                // Add this to the readData string
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Adding %d raw data to input stream', strlen($data[0])));
                                $readData .= $data[0];
                        } else {
                                // Other raw lines than header/data tagged lines and re-add the new-line char
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: Adding rawLine=%s(%d) + PHP_EOL to input stream', $rawLine, strlen($rawLine)));
                                $readData .= $rawLine . PHP_EOL;
                        }
                }
 
                // Was raw lines read and no header/data?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: readData()=%d,header()=%d,data()=%d', strlen($readData), count($header), count($data)));
                if ((!empty($readData)) && (count($header) == 0) && (count($data) == 0)) {
                        // Return raw lines back
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: readData()=%d - EXIT!', strlen($readData)));
                        return $readData;
                }
 
                // Was a header found?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: header()=%d', count($header)));
                if (count($header) != 4) {
                        // Throw an exception
-                       throw new InvalidArrayCountException(array($this, 'header', count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
+                       throw new InvalidArrayCountException([$this, 'header', count($header), 4], self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
                }
 
                // Decode all from Base64
-               $readData = @base64_decode($readData);
+               $decodedData = @base64_decode($readData);
 
                // Does the size match?
-               if (strlen($readData) != $header[2]) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: decodedData()=%d,header[2]=%d', strlen($decodedData), $header[2]));
+               if (strlen($decodedData) != $header[2]) {
                        // Size did not match
-                       throw new InvalidDataLengthException(array($this, strlen($readData), $header[2]), self::EXCEPTION_UNEXPECTED_STRING_SIZE);
+                       throw new InvalidDataLengthException([$this, strlen($decodedData), $header[2]], self::EXCEPTION_UNEXPECTED_STRING_SIZE);
                }
 
+               // Generate checksum from whole read data
+               $checksum = md5($decodedData);
+
                // Validate the decoded data with the final MD5 hash
-               if (md5($readData) != $header[3]) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-STREAM: checksum=%s,header[3]=%s', $checksum, $header[3]));
+               if ($checksum != $header[3]) {
                        // MD5 hash did not match!
-                       throw new InvalidMD5ChecksumException(array($this, md5($readData), $header[3]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
+                       throw new InvalidMD5ChecksumException([$this, $checksum, $header[3]], self::EXCEPTION_MD5_CHECKSUMS_MISMATCH);
                }
 
                // Return all in an array
-               return array(
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: header()=%d,decodedData()=%d - EXIT!', count($header), strlen($decodedData)));
+               return [
                        'header' => $header,
-                       'data'   => $readData
-               );
+                       'data'   => $decodedData,
+               ];
        }
 
        /**
@@ -268,8 +318,9 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData (string $data) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               // Not supported
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: data=()=%d - CALLED!', strlen($data)));
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -279,7 +330,9 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @todo        0% done
         */
        public function determineSeekPosition () {
-               $this->partialStub();
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-STREAM: CALLED!');
+               DebugMiddleware::getSelfInstance()->partialStub();
        }
 
        /**
@@ -290,7 +343,17 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @return      $status         Status of file seek: 0 = success, -1 = failed
         */
        public function seek (int $offset, int $whence = SEEK_SET) {
-               $this->partialStub('offset=' . $offset . ',whence=' . $whence);
+               // Check parameters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: offset=%d,whence=%d - CALLED!', $offset, $whence));
+               if ($offset < 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('offset=%d is below zero', $offset), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ($whence < 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('whence=%d is below zero', $whence), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               DebugMiddleware::getSelfInstance()->partialStub('offset=' . $offset . ',whence=' . $whence);
        }
 
        /**
@@ -299,7 +362,9 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @return      $size   Size (in bytes) of file
         */
        public function size () {
-               $this->partialStub();
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-STREAM: CALLED!');
+               DebugMiddleware::getSelfInstance()->partialStub();
        }
 
 }
index abdc30bcb0a294df5e0c5bc81d7052a9b8337e2a..6d2c3a26b4189fd59c0300bad7cf93b91dbd152a 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem\Pointer\Output;
 use Org\Mxchange\CoreFramework\Filesystem\BaseFileIo;
 use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\Pointer\OutputPointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 
 // Import SPL stuff
@@ -18,7 +19,7 @@ use \SplFileObject;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -58,13 +59,14 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         */
        public static final function createFrameworkRawFileOutputPointer (SplFileInfo $fileInstance, string $mode) {
                // Is the parameter valid?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-OUTPUT-POINTER: fileInstance=%s,mode=%s - CALLED!', $fileInstance->__toString(), $mode));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: fileInstance=%s,mode=%s - CALLED!', $fileInstance->__toString(), $mode));
                if (empty($mode)) {
                        // No fileInstance given
-                       throw new InvalidArgumentException('Parameter "mode" is empty');
+                       throw new InvalidArgumentException('Parameter "mode" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Try to open a handler
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: Invoking fileInstance->openFile(%s) ...', $mode));
                $fileObject = $fileInstance->openFile($mode);
 
                // Is it valid?
@@ -83,7 +85,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
                $pointerInstance->setFileObject($fileObject);
 
                // Return the instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-OUTPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
                return $pointerInstance;
        }
 
@@ -98,19 +100,20 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         */
        public function writeToFile (string $dataStream) {
                // Validate parameter and class own attributes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-OUTPUT-POINTER: dataStream(%d)=%s (trimmed) - CALLED!', strlen($dataStream), trim($dataStream)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: dataStream(%d)=%s (trimmed) - CALLED!', strlen($dataStream), trim($dataStream)));
                if (empty($dataStream)) {
                        // Empty data stream
-                       throw new InvalidArgumentException('Parameter "dataStream" is empty');
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (is_null($this->getFileObject())) {
                        // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Write data to the file pointer and return written bytes
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: Invoking this->fileObject->fwrite(dataStream()=%d - EXIT!', strlen($dataStream)));
                return $this->getFileObject()->fwrite($dataStream);
        }
 
@@ -123,7 +126,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function analyzeFileStructure () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -135,7 +138,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeAtPosition (int $seedPosition, string $data) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -145,7 +148,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function next () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -156,7 +159,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function valid () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -166,7 +169,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function key () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 3fb986879545437a97dd1bd2947bc9113bd1c3ad..f65872571089aabbbbabf317a30dd522c75671f4 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem\Pointer\Text;
 use Org\Mxchange\CoreFramework\Filesystem\BaseFileIo;
 use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\Pointer\OutputPointer;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 
@@ -19,7 +20,7 @@ use \SplFileObject;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -62,7 +63,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEXT-FILE-OUTPUT-POINTER: fileInstance[%s]=%s,mode=%s - CALLED!', get_class($fileInstance), $fileInstance->__toString(), $mode));
                if (empty($mode)) {
                        // No filename given
-                       throw new InvalidArgumentException('Parameter "mode" is empty');
+                       throw new InvalidArgumentException('Parameter "mode" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Try to open a handler
@@ -99,13 +100,13 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEXT-FILE-OUTPUT-POINTER: dataStream=%s - CALLED!', $dataStream));
                if (empty($dataStream)) {
                        // Invalid parameter
-                       throw new InvalidArgumentException('Parameter "dataStream" is empty');
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (is_null($this->getFileObject())) {
                        // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid object!
-                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())));
+                       throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Write data to the file pointer and return written bytes
@@ -121,7 +122,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function analyzeFileStructure () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -133,7 +134,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeAtPosition (int $seedPosition, string $data) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -143,7 +144,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function next () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -154,7 +155,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function valid () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -164,7 +165,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function key () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 4c55428d81803a6a27f50ce0ede07cb6742015be..341f453d9fa204b72b1a86be96942672deef4131 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem\File;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseAbstractFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 
 // Import SPL stuff
@@ -14,7 +15,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -50,7 +51,7 @@ abstract class BaseTextFile extends BaseAbstractFile {
         */
        public function determineSeekPosition () {
                // Not possible in text files
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -63,7 +64,7 @@ abstract class BaseTextFile extends BaseAbstractFile {
        public function seek (int $offset, int $whence = SEEK_SET) {
                // Not possible in text files
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEXT-FILE: offset=' . $offset . ',whence=' . $whence);
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -80,7 +81,7 @@ abstract class BaseTextFile extends BaseAbstractFile {
                 * There is no need to read/write the whole file.
                 */
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEXT-FILE: infoInstance=' . $infoInstance);
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 9300a442d658c491515d194c2a89cbcce35e7e62..b628887ddd5150fdfe10899aabf08aaef4585fc5 100644 (file)
@@ -14,7 +14,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 222443146380bd3a88c08071d34b75f63992c12f..c34a6d18fba5398425ca3e7d96f78659c341d8e7 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem\Input\Csv;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\Text\BaseInputTextFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Stream\Filesystem\CsvInputStreamer;
 
 // Import SPL stuff
@@ -16,7 +17,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -77,7 +78,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] columnSeparator=%s,expectedMatches=%d - CALLED!', __METHOD__, __LINE__, $columnSeparator, $expectedMatches));
                if (strlen($columnSeparator) === 0) {
                        // No empty column separator
-                       throw new InvalidArgumentException('Parameter "columnSeparator" is empty');
+                       throw new InvalidArgumentException('Parameter "columnSeparator" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($expectedMatches < 0) {
                        // Below zero is not valid
                        throw new InvalidArgumentException(sprintf('expectedMatches=%d is below zero', $expectedMatches));
@@ -101,7 +102,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] expectedMatches=%d,lineArray()=%d', __METHOD__, __LINE__, $expectedMatches, count($lineArray)));
                if (($expectedMatches > 0) && (count($lineArray) !== $expectedMatches)) {
                        // Invalid line found as strict count matching is requested
-                       throw new UnexpectedValueException(sprintf('lineArray()=%d has not expected count %d', count($lineArray), $expectedMatches));
+                       throw new UnexpectedValueException(sprintf('lineArray()=%d has not expected count %d', count($lineArray), $expectedMatches), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Return it
index 12da9713077187341db01b52897bc6064c81fc8b..ba85de96e26f9f9b96332c6400922d7b398870bd 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Filesystem\Text;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseAbstractFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Output\BaseOutput;
 
 /**
@@ -12,7 +13,7 @@ use Org\Mxchange\CoreFramework\Output\BaseOutput;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -46,13 +47,25 @@ abstract class BaseOutputTextFile extends BaseAbstractFile {
         *
         * @param       $fileName       File's name
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
-       protected function initFile ($fileName) {
+       protected function initFile (string $fileName) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-OUTPUT-TEXT-FILE: fileName=%s - CALLED!', $fileName));
+               if (empty($fileName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "fileName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get a file i/o pointer instance
-               $pointerInstance = ObjectFactory::createObjectByConfiguredName('text_file_output_class', array($fileName));
+               $pointerInstance = ObjectFactory::createObjectByConfiguredName('text_file_output_class', [$fileName]);
 
                // ... and set it here
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-OUTPUT-TEXT-FILE: Setting pointerInstance=%s ...', $pointerInstance->__toString()));
                $this->setPointerInstance($pointerInstance);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-OUTPUT-TEXT-FILE: EXIT!');
        }
 
 }
index b1f3f0107e76ddbe4978b7458a1cbf0865559d8f..7c51898fecec7bc48aa9f19c6e63018351eda8d7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index dcc108bb3aa71ba1f32d1b7ca4f5dd69004f8881..fcbc9704d5a4a83d6c036705c766bbdc7c04756c 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8f908ad3ce264523adb29f6c0ab7d59c23846988..41d9b135a71d89ecaaebc1d1e1fe528c38653bf1 100644 (file)
@@ -7,8 +7,9 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Loader\NoClassException;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\User\BaseUser;
@@ -18,7 +19,7 @@ use Org\Mxchange\CoreFramework\User\BaseUser;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -103,7 +104,7 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                        $authInstance->destroyAuthData();
 
                        // Mark the request as invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('auth_data_incomplete');
@@ -126,11 +127,11 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                // Does the guest class exist?
                if (!class_exists($className)) {
                        // Then abort here
-                       throw new NoClassException (array($this, $className), self::EXCEPTION_CLASS_NOT_FOUND);
+                       throw new NoClassException ([$this, $className], FrameworkInterface::EXCEPTION_CLASS_NOT_FOUND);
                }
 
                // Now try the dynamic login
-               $userInstance = call_user_func_array(array($className, $methodName), array($authLogin));
+               $userInstance = call_user_func_array([$className, $methodName], [$authLogin]);
 
                // Is the password correct?
                if ($userInstance->getPasswordHash() !== $authHash) {
@@ -139,8 +140,8 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                }
 
                // Remember auth and user instances in registry
-               GenericRegistry::getRegistry()->addInstance('auth', $authInstance);
-               GenericRegistry::getRegistry()->addInstance('user', $userInstance);
+               ObjectRegistry::getRegistry('generic')->addInstance('auth', $authInstance);
+               ObjectRegistry::getRegistry('generic')->addInstance('user', $userInstance);
        }
 
 }
index 944a9f7cfe9d6b388b12ada411b3cc31a5850bfe..dcde36f10c10db11d1e418b3f19d9a122f426ded 100644 (file)
@@ -6,7 +6,8 @@ namespace Org\Mxchange\CoreFramework\Filter\Change\Email;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -15,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -73,7 +74,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Is only first email set?
                if ((!empty($email1)) && (empty($email2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Email 2 is empty
                        $responseInstance->addFatalMessage('email2_empty');
@@ -85,7 +86,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Is only second email set?
                if ((empty($email1)) && (!empty($email2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Email 1 is empty
                        $responseInstance->addFatalMessage('email1_empty');
@@ -97,7 +98,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Do both match?
                if ($email1 != $email2) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Emails are mismatching
                        $responseInstance->addFatalMessage('emails_mismatch');
@@ -113,7 +114,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                }
 
                // Now, get a user instance for comparison
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Get the email field
                $userEmail = $userInstance->getField('email');
@@ -125,7 +126,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                }
 
                // Update the "new_email" field
-               $this->partialStub('Unfinished part.');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished part.');
        }
 
 }
index c11536323d865094c56ebe3fdf70c9b1e906d8b0..4d878637b32a1ffe7c6e6f65fca37fef34a90239 100644 (file)
@@ -6,7 +6,8 @@ namespace Org\Mxchange\CoreFramework\Filter\Change\Password;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -15,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -74,7 +75,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                // Is only first email set?
                if ((!empty($pass1)) && (empty($pass2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Email 2 is empty
                        $responseInstance->addFatalMessage('pass2_empty');
@@ -86,7 +87,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                // Is only second pass set?
                if ((empty($pass1)) && (!empty($pass2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Email 1 is empty
                        $responseInstance->addFatalMessage('pass1_empty');
@@ -104,7 +105,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                // Do both match?
                if ($pass1 != $pass2) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Emails are mismatching
                        $responseInstance->addFatalMessage('pass_mismatch');
@@ -114,10 +115,10 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                }
 
                // Now, get a user instance for comparison
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Update the "password" field
-               $this->partialStub('Unfinished part.');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished part.');
        }
 
 }
index 9fc1d3db4c928d80780f83b0ec03e1cc5bb60913..43e06a1261f7d0ac90ed15db587c50d62dc0340e 100644 (file)
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -72,7 +72,7 @@ class RulesAcceptedFilter extends BaseFilter implements Filterable {
                // Was the "rules" value found in form? And is it set?
                if (is_null($rules)) {
                        // Not found in form so stop processing here
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('rules_unchecked');
index 9e01f2feba8bcee0615ce1eb410b690876bb7da4..13011f2c74f488b45927049524be3cab25c096ad 100644 (file)
@@ -5,6 +5,7 @@ namespace \Filter\;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -65,7 +66,7 @@ class ???Filter extends BaseFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Implement this!
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
 }
index 2f2c55a82e9fb50fcabdca6d1016e913be52e988..85defaa88cf4085ade5d4a04afa92f1a89defa83 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 01a7e7eced3053613b3877da16832c6bac1a8d1d..b75e5932b029b7ade7555aed2a36ee02acbed62e 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 01f43388caf638d6900723653976bf99160af944..c783d1892fca2a1977a09ea030ff37bd945a02ca 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a85c7817426b6a443ccafba501dc1477aca95ff1..aaab8dff42b178f79a0df145b876a14a575c89db 100644 (file)
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -72,7 +72,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
                // Is it there?
                if (is_null($encryptRequest)) {
                        // Not found, so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Throw exception
                        throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
@@ -82,12 +82,12 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
                $encryptDecoded = base64_decode(str_replace(' ', '+', urldecode($encryptRequest)));
 
                // Get a crypto helper and decrypt the string
-               $decryptedString = ObjectFactory::createObjectByConfiguredName('crypto_class')->decryptString($encryptDecoded);
+               $decryptedString = CryptoHelper::getSelfInstance()->decryptString($encryptDecoded);
 
                // Is it the expected length?
                if (strlen($decryptedString) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length')) {
                        // Not found, so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Throw exception
                        throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
index 9a08a2fbfe13a1d75755aec49aba754f262d1419..d05523f152125225dadd08f981e356eb43014c8f 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 9c0c5b41f6932ec28e7fa5726cb7df2d10e3e07b..0737f283285220c13e6c6652d24ac7452e66e0c4 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filter\News;
 use Org\Mxchange\CoreFramework\Factory\News\HtmlNewsFactory;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -17,7 +17,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -48,7 +48,7 @@ class NewsDownloadFilter extends BaseFilter implements Filterable {
        /**
         * Creates an instance of this filter class
         *
-        * @return      $filterInstance                 An instance of this filter class
+        * @return      $filterInstance         An instance of this filter class
         */
        public static final function createNewsDownloadFilter () {
                // Get a new instance
@@ -70,7 +70,7 @@ class NewsDownloadFilter extends BaseFilter implements Filterable {
                $newsInstance = HtmlNewsFactory::createFactoryByRequest($requestInstance);
 
                // Store the news instance in registry
-               GenericRegistry::getRegistry()->addInstance('news', $newsInstance);
+               ObjectRegistry::getRegistry('generic')->addInstance('news', $newsInstance);
        }
 
 }
index b459548f3d7a271e59f4579f2071e845368ca1c6..f9f9b8346cd91ffe629af0ce610f129bd56f76db 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b0e121783c6981388ce99ed79096df5a49a4e1eb..e5093c88032554c10d0b1bc1f43ecdadd7226a4f 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0ff7d81ed0581ec1a518f92da55b935ff51ea7a5..1536aec810f5c2b0bf8b265e934e4eaf4706fb42 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Loader\NoClassException;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -22,7 +22,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -72,7 +72,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
                // Is the resolver set?
                if (is_null($resolverInstance)) {
                        // Throw an exception here
-                       throw new NullPointerException($filterInstance, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($filterInstance, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Get the action name from resolver
@@ -123,10 +123,10 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
                        $discoveryInstance->discover($requestInstance);
 
                        // Remember this instance if all wents fine
-                       GenericRegistry::getRegistry()->addInstance('payments', $discoveryInstance);
+                       ObjectRegistry::getRegistry('generic')->addInstance('payments', $discoveryInstance);
                } catch (NoConfigEntryException $e) {
                        // Something bad happend
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('payment_config_entry_error');
@@ -136,7 +136,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } catch (NoClassException $e) {
                        // Something bad happend
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('payment_class_error');
index 35528a6bd6c26797e2480a88fcd5c9793641bd37..e94a6ba0c50dce703ffd5b02cfae41511b00c6af 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -66,7 +66,7 @@ class UserStatusConfimedUpdateFilter extends BaseFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get user instance from registry
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Get "confirmed" status from config
                $confirmed = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_confirmed');
index eeaf04a6b3f9171cd6f6bc235bee66fefc2150f8..ac688fd83da1368d06fe0f3c212332b9531429ce 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Filter\User;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -66,13 +66,13 @@ class UserUpdateFilter extends BaseFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get user instance from registry
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Now update last activity
                $userInstance->updateLastActivity($requestInstance);
 
                // Update auth data as well
-               $authInstance = GenericRegistry::getRegistry()->getInstance('auth');
+               $authInstance = ObjectRegistry::getRegistry('generic')->getInstance('auth');
                $authInstance->updateAuthData();
 
                // Write all updates to the database
index da354037262ef8411c8a261d9fe87bd842439a0e..01b631d61eba5bdbd962f6437d6eb263b4d6d5dd 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -19,7 +19,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -73,7 +73,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                $email = $requestInstance->getRequestElement('email');
 
                // Is the Email set?
-               if ((is_null($email)) || (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_email_unique') == 'Y')) {
+               if ((is_null($email)) || (FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_email_unique'))) {
                        // Try it again
                        $email1 = $requestInstance->getRequestElement('email1');
                        $email2 = $requestInstance->getRequestElement('email2');
@@ -81,7 +81,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                        // Is the email still not set?
                        if ((is_null($email1)) || (is_null($email2))) {
                                // Not found in form so stop the filtering process
-                               $requestInstance->requestIsValid(false);
+                               $requestInstance->setIsRequestValid(FALSE);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('email_unset');
@@ -90,7 +90,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                        } elseif ((empty($email1)) || (empty($email2))) {
                                // Email is empty
-                               $requestInstance->requestIsValid(false);
+                               $requestInstance->setIsRequestValid(FALSE);
 
                                // Is the email empty?
                                if (empty($email1)) {
@@ -108,7 +108,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                        } elseif ($this->ifEmailIsTaken($email1)) {
                                // Email is already taken
-                               $requestInstance->requestIsValid(false);
+                               $requestInstance->setIsRequestValid(FALSE);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('email_taken');
@@ -117,7 +117,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                        } elseif ($email1 != $email2) {
                                // Emails didn't match
-                               $requestInstance->requestIsValid(false);
+                               $requestInstance->setIsRequestValid(FALSE);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('emails_mismatch');
@@ -127,7 +127,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                        }
                } elseif (empty($email)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('email_empty');
@@ -143,7 +143,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
         * @param       $email                  Email to check for existence
         * @return      $alreadyTaken   Whether the email has been taken
         */
-       private function ifEmailIsTaken ($email) {
+       private function ifEmailIsTaken (string $email) {
                // Default is already taken
                $alreadyTaken = true;
 
@@ -151,7 +151,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry('generic');
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index 90d72cb8c2ed559c69be5efffb096d20bddbf22f..a6ad85a784be08a357ca040687c500a439079394 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -72,7 +72,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
                // Is the password still not set?
                if ((is_null($password1)) || (is_null($password2))) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_unset');
@@ -81,7 +81,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ((empty($password1)) || (empty($password2))) {
                        // Password is empty
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Is the password empty?
                        if (empty($password1)) {
@@ -99,7 +99,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($password1 != $password2) {
                        // Passwords didn't match
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('pass_mismatch');
index 5a581e8aac3ac7217d25220be41c9b713c7d1555..27be04c17144232aa07a3ed5bf7614b474ed6caf 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\User\UsernameMissingException;
@@ -19,7 +19,7 @@ use Org\Mxchange\CoreFramework\User\UsernameMissingException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -75,7 +75,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                // Is the username set?
                if (is_null($userName)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_unset');
@@ -84,7 +84,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_empty');
@@ -93,7 +93,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($this->ifUserNameIsTaken($userName)) {
                        // Username is already taken
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_taken');
@@ -109,7 +109,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
         * @param       $userName               Username to check for existence
         * @return      $alreadyTaken   Whether the username has been taken
         */
-       private function ifUserNameIsTaken ($userName) {
+       private function ifUserNameIsTaken (string $userName) {
                // Default is already taken
                $alreadyTaken = true;
 
@@ -117,7 +117,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry('generic');
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index 2623c7bd4553f542c68bae26bc4616e5a593a4cd..0d8dfbd518f2481a3e72a1d0b25e1bf33397443d 100644 (file)
@@ -7,7 +7,8 @@ use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\User\BaseUser;
@@ -18,7 +19,7 @@ use Org\Mxchange\CoreFramework\User\BaseUser;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -81,7 +82,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
                        // Is the password still not set?
                        if (is_null($password)) {
                                // Not found in form so stop the filtering process
-                               $requestInstance->requestIsValid(false);
+                               $requestInstance->setIsRequestValid(FALSE);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('password_unset');
@@ -93,7 +94,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
 
                if (empty($password)) {
                        // Password is empty
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_empty');
@@ -103,13 +104,13 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Get a user instance
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Get current hash
                $currentHash = $userInstance->getField('pass_hash');
 
                // Get an encryption helper and encrypt the password
-               $passHash = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($password, $currentHash);
+               $passHash = CryptoHelper::getSelfInstance()->hashString($password, $currentHash);
 
                // Does it match?
                if ($currentHash != $passHash) {
index 9e2a9f11aa645c178952f4415ea0e0a3509efb98..db8ebc21285b197fda17a26faefbf44b1f995b0c 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -66,7 +66,7 @@ class BirthdayVerifierFilter extends BaseFilter implements Filterable {
                // Day of birth set?
                if (!$requestInstance->isRequestElementSet('birth_day')) {
                        // Day of birth isn't set
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('day_of_birth_unset');
@@ -75,7 +75,7 @@ class BirthdayVerifierFilter extends BaseFilter implements Filterable {
                // Month of birth set?
                if (!$requestInstance->isRequestElementSet('birth_month')) {
                        // Month of birth isn't set
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('month_of_birth_unset');
@@ -84,7 +84,7 @@ class BirthdayVerifierFilter extends BaseFilter implements Filterable {
                // Year of birth set?
                if (!$requestInstance->isRequestElementSet('birth_year')) {
                        // Year of birth isn't set
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('year_of_birth_unset');
@@ -109,7 +109,7 @@ class BirthdayVerifierFilter extends BaseFilter implements Filterable {
                // Is there a number or such? (we don't care about the value itself here)
                if (empty($birthCheck)) {
                        // Validation has failed
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('birthday_invalid');
index e5e8cde84d51cccde5af97f0411c9aeb46fb6dcc..2c4316a73ebbf8697b1375a012072251847695b2 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -72,7 +72,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                // Is this code set?
                if (is_null($confirmCode)) {
                        // Is not in request
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('confirm_code_unset');
@@ -81,7 +81,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($confirmCode)) {
                        // Email is empty
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('confirm_code_empty');
@@ -91,7 +91,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Get a user instance from registry
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Get the confirm code from user for comparison
                $userCode = $userInstance->getField(UserDatabaseFrontend::DB_COLUMN_CONFIRM_HASH);
@@ -99,7 +99,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                // Do we have the same code or different?
                if ($userCode != $confirmCode) {
                        // Email is empty
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Redirect to error page
                        $responseInstance->redirectToConfiguredUrl('confirm_code_invalid');
index c089a4b62ca1ec7dd6b319db73f66a6a31bfdfe3..08bb8beed8267da70fb199fce1c9dec92a2ec2b7 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filter\Verifier\Email;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -14,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -66,7 +67,7 @@ class EmailVerifierFilter extends BaseFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Implement this!
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
 }
index 89f0a2d5a14cd94ce3de22c1526c38d6b6c752d8..3093692741d5f3e9d575c96ae98fedfca9e13b82 100644 (file)
@@ -8,6 +8,7 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -16,7 +17,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -69,7 +70,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is the form set?
                if (($requestInstance->getRequestElement('command') !== 'do_form') || (!$requestInstance->isRequestElementSet('form'))) {
                        // Required field not set
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('command_form_invalid');
@@ -79,12 +80,10 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                }
 
                // Create config entry
-               $configKey = sprintf('%s_captcha_secured',
-                       $requestInstance->getRequestElement('form')
-               );
+               $configKey = sprintf('%s_captcha_secured', $requestInstance->getRequestElement('form'));
 
                // Is the CAPTCHA enabled?
-               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configKey) != 'Y') {
+               if (FrameworkBootstrap::getConfigurationInstance()->isEnabled($configKey)) {
                        // Not enabled, so don't check
                        return;
                }
@@ -95,7 +94,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is this set?
                if (is_null($captchaCode)) {
                        // Not set so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_code_unset');
@@ -104,7 +103,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($captchaCode)) {
                        // Empty value so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_code_empty');
@@ -119,7 +118,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is this set?
                if (is_null($captchaHash)) {
                        // Not set so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_hash_unset');
@@ -128,7 +127,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($captchaHash)) {
                        // Empty value so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_hash_empty');
@@ -138,7 +137,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                }
 
                // Now, both are set hash the given one. First get a crypto instance
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
 
                // Then hash the code
                $hashedCode = $cryptoInstance->hashString($captchaCode, $captchaHash);
@@ -146,7 +145,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is this CAPTCHA valid?
                if ($hashedCode != $captchaHash) {
                        // Not the same so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_hash_mismatch');
index 998ee5cef1d0e5f7573abbc862cb9050754f8fcc..a4a7870ef3607a47ecac811b6c2fe37b1b37da28 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -71,7 +71,7 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable {
                // Is the password still not set?
                if (is_null($password)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_unset');
@@ -80,7 +80,7 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($password)) {
                        // Password is empty
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_empty');
index f74b455edc07f834ac116a3c44031a8a0c41b3f9..2ab77ca1696725cef5ced3d7899464a8de6cb56c 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -70,7 +70,7 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable {
                // Is the password still not set?
                if (is_null($password)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_unset');
@@ -79,7 +79,7 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($password)) {
                        // Password is empty
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_empty');
index 6dc1b386fc7eabec71694fff8836c0140f65b321..e1f087d59a95675bd03169a771d7a3d2d24dcf14 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -18,7 +18,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -74,7 +74,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                // Is the username set?
                if (is_null($userName)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_guest_unset');
@@ -83,7 +83,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_guest_empty');
@@ -92,7 +92,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($this->ifUserGuestIsTaken($userName) === false) {
                        // Username is already taken
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_guest_not_found');
@@ -111,7 +111,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
         * @param       $userName               Username to check for existence
         * @return      $alreadyTaken   Whether the username has been taken
         */
-       private function ifUserGuestIsTaken ($userName) {
+       private function ifUserGuestIsTaken (string $userName) {
                // Default is already taken
                $alreadyTaken = true;
 
@@ -119,7 +119,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry('generic');
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index 97e097156bb208e44e980791dacd829c1ba6f9d5..cdd08a1a8ba1712f2d7aaf7a369db5133f00eaa8 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\User\UsernameMissingException;
@@ -19,7 +19,7 @@ use Org\Mxchange\CoreFramework\User\UsernameMissingException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -75,7 +75,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                // Is the username set?
                if (is_null($userName)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_unset');
@@ -84,7 +84,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_empty');
@@ -93,7 +93,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($this->ifUserNameIsTaken($userName) === false) {
                        // Username is already taken
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_not_found');
@@ -109,7 +109,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
         * @param       $userName               Username to check for existence
         * @return      $alreadyTaken   Whether the username has been taken
         */
-       private function ifUserNameIsTaken ($userName) {
+       private function ifUserNameIsTaken (string $userName) {
                // Default is already taken
                $alreadyTaken = true;
 
@@ -117,7 +117,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry('generic');
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index 0d67e497b1f113ac7caf9d39ba2e508c435ca993..b025f5d04de99be2a2fa9efdcf4e8f1c49a9e59c 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filter\Verifier\User;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -65,12 +65,12 @@ class UserStatusVerifierFilter extends BaseFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a user instance for comparison
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
 
                // Is the user account confirmed?
                if ((!$userInstance->isConfirmed()) && (!$userInstance->isGuest()) && ($requestInstance->getRequestElement('action') != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('action_status_problem'))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Redirect to configured URL
                        $responseInstance->redirectToConfiguredUrl('login_user_status');
index 19b68b2af659e460083e5431bd93e86b8df34f67..46ea0c1ff005dae44bda428bb122799e5a8c876f 100644 (file)
@@ -8,7 +8,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Factory\User\UserFactory;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
@@ -17,7 +17,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -72,7 +72,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
                // Is the email address valid?
                if ($userInstance->ifEmailAddressExists() === false) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Redirect to configured URL
                        $responseInstance->redirectToConfiguredUrl('user_unconfirmed_email_missing');
@@ -84,7 +84,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
                // Is the user account confirmed?
                if ($userInstance->getField(UserDatabaseFrontend::DB_COLUMN_USER_STATUS) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_unconfirmed')) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Redirect to configured URL
                        $responseInstance->redirectToConfiguredUrl('user_not_unconfirmed');
@@ -94,7 +94,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Add this instance to registry
-               GenericRegistry::getRegistry()->addInstance('user', $userInstance);
+               ObjectRegistry::getRegistry('generic')->addInstance('user', $userInstance);
        }
 
 }
index 54c11ad4bc2a5e7d8032ea136fd31e18934c7b02..11443ba851f294a1b145070f2149d85206cfb777 100644 (file)
@@ -17,7 +17,7 @@ use \FuseWrapper;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2fb87a3d39ef9eee27ee86eb84adb21973b61e4c..ebc9c8fd6d4e025abc22fee98f5659901dff5a59 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Handler\BaseHandler;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 26afc0cb59ad9a1e83508d162a269a0b5c7e0b4e..ef63de38226bf07a293610a68cf33dd010a4af5e 100644 (file)
@@ -4,15 +4,19 @@ namespace Org\Mxchange\CoreFramework\Handler;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Handler\DataSet\HandleableDataSet;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * A general Handler
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -43,7 +47,11 @@ abstract class BaseHandler extends BaseFrameworkSystem implements HandleableData
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HANDLER: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HANDLER: EXIT!');
        }
 
        /**
@@ -74,6 +82,15 @@ abstract class BaseHandler extends BaseFrameworkSystem implements HandleableData
         * @todo        Rewrite this to use DHT
         */
        public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HANDLER: dataSetInstance=%s,messageData()=%d - CALLED!', $dataSetInstance->__toString(), count($messageData)));
+               if (count($messageData) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "messageData" is an empty array', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HANDLER: EXIT!');
        }
 
 }
index c8801b7de0c2eb8dbfb7f90048115b3ccca21412..3b23ff2bc8c7f16b510fae7a2c898a53e2e195fc 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Handler\Task;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Handler\BaseHandler;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -22,7 +23,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -55,10 +56,15 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        private function __construct () {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: CONSTRUCTWD!');
                parent::__construct(__CLASS__);
 
                // Set handler name
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('TASK-HANDLER: Setting handlerName=task ...');
                $this->setHandlerName('task');
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: EXIT!');
        }
 
        /**
@@ -68,10 +74,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        public static final function createTaskHandler () {
                // Get new instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: CALLED!');
                $handlerInstance = new TaskHandler();
 
                // Output debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Initializing task handler.');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('TASK-HANDLER: Initializing task handler.');
 
                // Init the task list
                $handlerInstance->setListInstance(ObjectFactory::createObjectByConfiguredName('task_list_class'));
@@ -87,9 +94,10 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                $handlerInstance->registerTask('idle_loop', $taskInstance);
 
                // Output debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task handler initialized.');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('TASK-HANDLER: Task handler initialized.');
 
                // Return the prepared instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER:handlerInstance=%s - EXIT!', $handlerInstance->__toString()));
                return $handlerInstance;
        }
 
@@ -103,6 +111,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        private function executeCurrentTask () {
                // Update no task by default
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: CALLED!');
                $updateTask = false;
 
                // Is the current task valid?
@@ -115,14 +124,17 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                $currentTask = $this->getListInstance()->getIterator()->current();
 
                // Is the task not yet started?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: currentTask()=%d', count($currentTask)));
                if ($currentTask['task_started'] === false) {
                        // Determine difference between current time and registration
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: currentTask[id]=%s has not started yet, checking ...', $currentTask['id']));
                        $diff = ($this->getMilliTime() - $currentTask['task_registered']) * 1000;
 
                        // Should we start now?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: diff=%d,currentTask[task_startup_delay]=%d', $diff, $currentTask['task_startup_delay']));
                        if ($diff < $currentTask['task_startup_delay']) {
                                // Skip this silently
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' not started: diff=' . $diff . ',task_startup_delay=' . $currentTask['task_startup_delay']);
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Task %s not started: diff=%d,task_startup_delay=%d', $currentTask['id'], $diff, $currentTask['task_startup_delay']));
                                return;
                        }
 
@@ -131,22 +143,25 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        $updateTask = true;
 
                        // Debug message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms');
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: Task %s started with startup_delay=%dms', $currentTask['id'], $currentTask['task_startup_delay']));
                }
 
                // Get time difference from interval delay
                $diff = ($this->getMilliTime() - $currentTask['task_last_activity']) * 1000;
 
                // Is the interval delay reached?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' diff=' . $diff . ',task_interval_delay=' . $currentTask['task_interval_delay'] . ',task_max_runs=' . $currentTask['task_max_runs'] . ',task_total_runs=' . $currentTask['task_total_runs']);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('TASK-HANDLER: Task ' . $currentTask['id'] . ' diff=' . $diff . ',task_interval_delay=' . $currentTask['task_interval_delay'] . ',task_max_runs=' . $currentTask['task_max_runs'] . ',task_total_runs=' . $currentTask['task_total_runs']);
                if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_max_runs'] > 0) && ($currentTask['task_total_runs'] == $currentTask['task_max_runs']))) {
                        // Should we update the task from startup?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: currentTask[id]=%s has reached interval ... updateTask=%d', $currentTask['id'], intval($updateTask)));
                        if ($updateTask === true) {
                                // Update the task before leaving
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: Updating task %s ...', $currentTask['id']));
                                $this->updateTask($currentTask);
                        }
 
                        // Skip this silently
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Task %s has been updated - EXIT!', $currentTask['id']));
                        return;
                }
 
@@ -157,11 +172,16 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                $currentTask['task_total_runs']++;
 
                // Update the task
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: Updating task %s ...', $currentTask['id']));
                $this->updateTask($currentTask);
 
                // And visit/run it
                // @TODO Messurement can be added around this call
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Invoking currentTask[task_instance]->accept(%s), task_instance=%s ...', $this->getVisitorInstance()->__toString(), $currentTask['task_instance']->__toString()));
                $currentTask['task_instance']->accept($this->getVisitorInstance());
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: EXIT!');
        }
 
        /**
@@ -172,13 +192,19 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        private function updateTask (array $taskEntry) {
                // Get the key from current iteration
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: taskEntry()=%d - CALLED!', count($taskEntry)));
                $key = $this->getListInstance()->getIterator()->key();
 
                // Get the hash from key
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: key=%s', $key));
                $hash = $this->getListInstance()->getHashByIndex($key);
 
                // Update the entry
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Invoking this->listInstance->updateCurrentEntryByHash(%s,taskEntry()=%d) ...', $hash, count($taskEntry)));
                $this->getListInstance()->updateCurrentEntryByHash($hash, $taskEntry);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: EXIT!');
        }
 
        /**
@@ -188,14 +214,12 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         * @return      void
         */
        private function unregisterTask (array $taskData) {
-               // Debug output
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Removing task ' . $taskData['id'] . ' from queue - CALLED!');
-
                // Remove the entry
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Removing task %s from queue - CALLED!', $taskData['id']));
                $this->getListInstance()->removeEntry('tasks', $taskData);
 
-               // Debug output
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Removing task ' . $taskData['id'] . ' from queue - EXIT!');
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Removing task %s from queue - EXIT!', $taskData['id']));
         }
 
        /**
@@ -206,24 +230,29 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        public function searchTask (Taskable $taskInstance) {
                // Default is an empty (not found) task name
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: taskInstance=%s - CALLED!', $taskInstance->__toString()));
                $taskName = '';
 
                // Get whole list
                $taskList = $this->getListInstance()->getArrayFromList('tasks');
 
                // Search all instances
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: taskList()=%d', count($taskList)));
                foreach ($taskList as $currentTask) {
                        // Does it match given task instance?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: currentTask[id=%s', $currentTask['id']));
                        if ($currentTask['task_instance']->equals($taskInstance)) {
                                // Found it
                                $taskName = $currentTask['id'];
 
                                // Abort here
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: taskName=%s - BREAK!', $taskName));
                                break;
                        }
                }
 
                // Return found name
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: taskName=%s - EXIT!', $taskName));
                return $taskName;
        }
 
@@ -238,9 +267,10 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        public function registerTask (string $taskName, Taskable $taskInstance) {
                // Is the parameter valid
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: taskName=%s,taskInstance - CALLED!', $taskName, $taskInstance->__toString()));
                if (empty($taskName)) {
                        // Task name cannot be empty
-                       throw new InvalidArgumentException('Parameter "taskName" is empty');
+                       throw new InvalidArgumentException('Parameter "taskName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get interval delay, startup delay and max runs
@@ -249,21 +279,22 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                $maxRuns = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_max_runs');
 
                // If the task is 'idle_loop', a deplay of zero seconds is fine
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: intervalDelay=%d,startupDelay=%d,maxRuns=%d', $intervalDelay, $startupDelay, $maxRuns));
                if ($intervalDelay < 0) {
                        // Invalid configuration value
-                       throw new UnexpectedValueException(sprintf('taskName=%s has intervalDelay=%d below zero', $taskName, $intervalDelay));
+                       throw new UnexpectedValueException(sprintf('taskName=%s has intervalDelay=%d below zero', $taskName, $intervalDelay), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif ($startupDelay < 0) {
                        // Invalid configuration value
-                       throw new UnexpectedValueException(sprintf('taskName=%s has startupDelay=%d below zero', $taskName, $startupDelay));
+                       throw new UnexpectedValueException(sprintf('taskName=%s has startupDelay=%d below zero', $taskName, $startupDelay), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif ($maxRuns < 0) {
                        // Invalid configuration value
-                       throw new UnexpectedValueException(sprintf('taskName=%s has maxRuns=%d below zero', $taskName, $maxRuns));
+                       throw new UnexpectedValueException(sprintf('taskName=%s has maxRuns=%d below zero', $taskName, $maxRuns), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif ($taskName != 'idle_loop' && $intervalDelay == 0) {
                        // Only idle_loop can have a zero interval delay
-                       throw new UnexpectedValueException(sprintf('taskName=%s has zero interval delay which is only valid for "idle_loop" task', $taskName));
+                       throw new UnexpectedValueException(sprintf('taskName=%s has zero interval delay which is only valid for "idle_loop" task', $taskName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif ($taskName != 'idle_loop' && $startupDelay == 0) {
                        // Only idle_loop can have a zero interval delay
-                       throw new UnexpectedValueException(sprintf('taskName=%s has zero startup delay which is only valid for "idle_loop" task', $taskName));
+                       throw new UnexpectedValueException(sprintf('taskName=%s has zero startup delay which is only valid for "idle_loop" task', $taskName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Create the entry
@@ -293,15 +324,20 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                ];
 
                // Add the entry
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Invoking this->listInstance->addEntry(tasks,taskEntry()=%d) ...', count($taskEntry)));
                $this->getListInstance()->addEntry('tasks', $taskEntry);
 
                // Debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task registered: taskName=' . $taskName .
-                       ' (taskInstance=' . $taskInstance->__toString() . ')' .
-                       ', startupDelay=' . $taskEntry['task_startup_delay'] . 'ms' .
-                       ', intervalDelay=' . $taskEntry['task_interval_delay'] . 'ms' .
-                       ', maxRuns=' . $taskEntry['task_max_runs'] . ' ...'
-               );
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: Task registered: taskName=%s (taskInstance=%s), startupDelay=%dms, intervalDelay=%dms, maxRuns=%d ...',
+                       $taskName,
+                       $taskInstance->__toString(),
+                       $taskEntry['task_startup_delay'],
+                       $taskEntry['task_interval_delay'],
+                       $taskEntry['task_max_runs'],
+               ));
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: EXIT!');
        }
 
        /**
@@ -311,9 +347,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        public function hasTasksLeft () {
                // Do we have tasks there?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: CALLED!');
                $tasksLeft = ($this->getListInstance()->count() > 0);
 
                // Return result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: tasksLeft=%d - EXIT!', intval($tasksLeft)));
                return $tasksLeft;
        }
 
@@ -327,16 +365,23 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        public function handleTasks () {
                // Should we rewind?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: CALLED!');
                if (!$this->getListInstance()->getIterator()->valid()) {
                        // Rewind to the beginning for next loop
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: Invoking this->listInstance->iterator->rewind() ...');
                        $this->getListInstance()->getIterator()->rewind();
                }
 
                // Try to execute the task
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: Invoking this->executeCurrentTask() ...');
                $this->executeCurrentTask();
 
                // Go to next entry
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: Invoking this->listInstance->iterator->next() ...');
                $this->getListInstance()->getIterator()->next();
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: EXIT!');
        }
 
        /**
@@ -347,15 +392,15 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        public function doShutdown () {
                // Always rewind to the beginning for next loop
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: Invoking this->listInstance->iterator->rewind() - CALLED!');
                $this->getListInstance()->getIterator()->rewind();
 
-               // Debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Shutting down all ' . $this->getListInstance()->count() . ' tasks...');
-
                // Remember all tasks that has been shutdown for removal
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: Shutting down all %d tasks...', $this->getListInstance()->count()));
                $tasks = [];
 
                // Instance a visitor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('TASK-HANDLER: Setting visitorInstance=shutdown_task_visitor_class from configuration ...');
                $this->setVisitorInstance(ObjectFactory::createObjectByConfiguredName('shutdown_task_visitor_class'));
 
                // Shutdown all tasks in once go
@@ -363,26 +408,28 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        // Get current entry
                        $currentTask = $this->getListInstance()->getIterator()->current();
 
-                       // Output debug message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Shutting down task ' . $currentTask['id'] . ' (taskInstance=' . $currentTask['task_instance']->__toString() . ') ...');
-
                        // Shutdown the task
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('TASK-HANDLER: Shutting down task ' . $currentTask['id'] . ' (taskInstance=' . $currentTask['task_instance']->__toString() . ') ...');
                        $currentTask['task_instance']->accept($this->getVisitorInstance());
 
                        // Remember this task
                        array_push($tasks, $currentTask);
 
                        // Advance to next one
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: Invoking this->listInstance->iterator->next() ...');
                        $this->getListInstance()->getIterator()->next();
                }
 
-               // Debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Shutdown of all tasks completed.');
-
                // Remove all tasks
-               foreach ($tasks as $entry) {
-                       $this->unregisterTask($entry);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('TASK-HANDLER: Shutdown of all tasks completed. tasks()=%d', count($tasks)));
+               foreach ($tasks as $taskEntry) {
+                       // Unregister this task
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TASK-HANDLER: Invokint this->unregisterTask(taskEntry()=%d) ...', count($taskEntry)));
+                       $this->unregisterTask($taskEntry);
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TASK-HANDLER: EXIT!');
        }
 
 }
index f69decf45ee26dce1c383aa39e9700ce8078caec..1e9e9da7d272def5061261f1a76ecefdc886eda1 100644 (file)
@@ -4,13 +4,14 @@ namespace Org\Mxchange\CoreFramework\Captcha\;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * A solveable CAPTCHA
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -66,7 +67,7 @@ class ???Captcha extends BaseCaptcha implements SolveableCaptcha {
         * @todo        0% done
         */
        public function initiateCaptcha () {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
        /**
@@ -76,7 +77,7 @@ class ???Captcha extends BaseCaptcha implements SolveableCaptcha {
         * @todo        0% done
         */
        public function renderCode () {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
 }
index 97bea1e0469438ecd573047a64583bf00d958298..56553c59f1f17a08d3be896b4354082a24886b53 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Traits\Helper\HelperTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 07bd45e3c9ecac113910e8973862518561e77211..ca6e53f08efbcaf61fffbc4c7f63130dfd2adb2b 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a73a261b691ae5942d6429bcbbb5f68cb53e68fe..ade0e84ce94a8b44539f9d18e3752f920a99869c 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Helper\Captcha;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
 use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
 
 /**
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -121,7 +122,7 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha {
                }
 
                // Get crypto instance
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
 
                // Hash the CAPTCHA code for later comparison
                $this->hashedString = $cryptoInstance->hashString($captchaString);
index b7e74f5fc432e860787290a420d43dec35d84f27..5090e9d62be821bf19b79620675d9fecadcfd1d9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 35138c3277ab15407f9c820bc26411ba35ad536b..b6545819801dc7d29d5b2cb98b9031e6597d2f38 100644 (file)
@@ -7,15 +7,19 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
+// Import SPL stuff
+use \BasMethodCallException;
+use \InvalidArgumentException;
+
 /**
  * A generic helper class with generic methods
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -74,11 +78,10 @@ abstract class BaseHelper extends BaseFrameworkSystem {
        private $totalCounter = 0;
 
        // Exception constants
-       const EXCEPTION_GROUP_NOT_OPENED             = 0x1e3;
-       const EXCEPTION_GROUP_ALREADY_FOUND          = 0x1e4;
-       const EXCEPTION_SUB_GROUP_ALREADY_FOUND      = 0x1e5;
-       const EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED = 0x1e6;
-       const EXCEPTION_NO_PREVIOUS_GROUP_OPENED     = 0x1e7;
+       const EXCEPTION_GROUP_NOT_OPENED             = 0x1e0;
+       const EXCEPTION_SUB_GROUP_ALREADY_FOUND      = 0x1e1;
+       const EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED = 0x1e2;
+       const EXCEPTION_NO_PREVIOUS_GROUP_OPENED     = 0x1e3;
 
        /**
         * Protected constructor
@@ -88,7 +91,11 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HELPER: EXIT!');
        }
 
        /**
@@ -96,9 +103,21 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $newContent             New content to add
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        protected final function addContent (string $newContent) {
+               // Check variable
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: newContent=%s - CALLED!', $newContent));
+               if (empty(trim($newContent))) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "newContent" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Append content with EOL
                $this->content .= trim($newContent) . PHP_EOL;
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: this->content()=%d - EXIT!', strlen($this->content)));
        }
 
        /**
@@ -106,10 +125,21 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $content        Content to to the base
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        protected function addHeaderContent (string $content) {
+               // Check variable
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: content=%s - CALLED!', $content));
+               if (empty(trim($content))) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "content" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Add the header content
                $this->groups['header']['content'] = trim($content);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HELPER: EXIT!');
        }
 
        /**
@@ -117,10 +147,21 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $content        Content to to the base
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        protected function addFooterContent (string $content) {
+               // Check variable
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: content=%s - CALLED!', $content));
+               if (empty(trim($content))) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "content" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Add the footer content
                $this->groups['footer']['content'] = trim($content);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HELPER: EXIT!');
        }
 
        /**
@@ -130,8 +171,16 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $newContent             New content to add
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        protected final function addContentToPreviousGroup (string $newContent) {
+               // Check on parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: newContent=%s - CALLED!', $newContent));
+               if (empty($newContent)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "newContent" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Check for sub/group
                if ($this->ifSubGroupOpenedPreviously()) {
                        // Get sub group id
@@ -149,6 +198,9 @@ abstract class BaseHelper extends BaseFrameworkSystem {
                        // Add it directly
                        $this->addContent($newContent);
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HELPER: EXIT!');
        }
 
        /**
@@ -175,13 +227,24 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $fieldName      Name of the field to assign
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function assignField (string $fieldName) {
+               // Check on parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: fieldName=%s - CALLED!', $fieldName));
+               if (empty($fieldName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get the value from value instance
                $fieldValue = $this->getValueField($fieldName);
 
                // Assign it with a template variable
                $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $fieldValue);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HELPER: EXIT!');
        }
 
        /**
@@ -191,18 +254,33 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $fieldName              Name of the field to assign
         * @param       $filterMethod   Method name to call of the value instance
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         * @todo        Rewrite this method using a helper class for filtering data
         */
        public function assignFieldWithFilter (string $fieldName, string $filterMethod) {
+               // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: fieldName=%s,filterMethod=%s - CALLED!', $fieldName, $filterMethod));
+               if (empty($fieldName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($filterMethod)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "filterMethod" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get the value
                $fieldValue = $this->getValueField($fieldName);
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'='.$fieldValue);
 
                // Now filter it through the value through the filter method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: %s[%s]=%s', $fieldName, gettype($fieldValue), $fieldValue));
                $filteredValue = call_user_func_array(array($this, 'doFilter' . StringUtils::convertToClassName($filterMethod)), array($fieldValue));
 
                // Assign it with a template variable
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: filteredValue[%s]=%s', gettype($filteredValue), $filteredValue));
                $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $filteredValue);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HELPER: EXIT!');
        }
 
        /**
@@ -211,42 +289,47 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $registryKey    Registry key which holds an object with values
         * @param       $extraKey               Extra value instance key used if registryKey is null
         * @return      void
-        * @throws      NullPointerException    If recovery of requested value instance failed
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function prefetchValueInstance (string $registryKey, string $extraKey = NULL) {
                // Validate parameter
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('O:'.$registryKey.'/'.$extraKey);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: registryKey=%s,extraKey[%s]=%s - CALLED!', $registryKey, gettype($extraKey), $extraKey));
                if (empty($registryKey)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "registryKey" is empty');
+                       throw new InvalidArgumentException('Parameter "registryKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                try {
                        // Get the required instance
-                       $this->valueInstance = GenericRegistry::getRegistry()->getInstance($registryKey);
+                       $this->valueInstance = ObjectRegistry::getRegistry('generic')->getInstance($registryKey);
                } catch (NullPointerException $e) {
                        // Not set in registry
-                       // @TODO Try to log it here
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($registryKey.'=NULL!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: registryKey=%s returned no instance (NPE thrown)', $registryKey));
                }
 
                // Shall we get an extra instance?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: extraKey[%s]=%s', gettype($extraKey), $extraKey));
                if (!is_null($extraKey)) {
                        try {
                                // Get the extra instance.
-                               $this->extraInstance = GenericRegistry::getRegistry()->getInstance($extraKey);
+                               $this->extraInstance = ObjectRegistry::getRegistry('generic')->getInstance($extraKey);
                        } catch (NullPointerException $e) {
                                // Try to create it
-                               $this->extraInstance = ObjectFactory::createObjectByConfiguredName($extraKey . '_class', array($this->valueInstance));
+                               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: extraKey=%s returned no instance (NPE thrown), this->valueInstance[]=%s', $extraKey, gettype($this->valueInstance)));
+                               $this->extraInstance = ObjectFactory::createObjectByConfiguredName($extraKey . '_class', [$this->valueInstance]);
                        }
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: extraKey=%s,this->extraInstance[%s]=%s', $extraKey, gettype($this->extraInstance), $this->extraInstance));
                }
 
                // Is the value instance valid?
+               //* NOSIY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: this->valueInstance[]=%s - BEFORE!', gettype($this->valueInstance)));
                if (is_null($this->valueInstance)) {
                        // Get the requested instance
                        $this->valueInstance = ObjectFactory::createObjectByConfiguredName($registryKey . '_class', array($this->extraInstance));
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: this->valueInstance[]=%s - AFTER/EXIT!', gettype($this->valueInstance)));
        }
 
        /**
@@ -258,23 +341,31 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $content        Initial content to add to the group
         * @param       $tag            HTML tag used to open this group
         * @return      void
-        * @throws      HelperGroupAlreadyCreatedException      If the group was already created before
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      BadMethodCallException  If the group was already created before
         */
        protected function openGroupByIdContent (string $groupId, string $content, string $tag) {
                // Is the group already there?
-               //* DEBUG: */ echo "OPEN:groupId={$groupId},content=<pre>".htmlentities($content)."</pre>\n";
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: groupdId=%s,content=%s,tag=%s - CALLED!', $groupdId, $content, $tag));
                if (empty($groupId)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupId" is empty');
+                       throw new InvalidArgumentException('Parameter "groupId" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (isset($this->groups[$groupId])) {
                        // Then throw an exception here
-                       throw new HelperGroupAlreadyCreatedException(array($this, $groupId), self::EXCEPTION_GROUP_ALREADY_FOUND);
+                       throw new BadMethodCallException(sprintf('[%s:%d]: groupId=%s is already opened.', $this->__toString(), $groupId), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
+               } elseif (empty($content)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "content" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($tag)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "tag" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Count one up
                $this->totalCounter++;
 
                // Add the group to the stack
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: this->totalCounter=%d', $this->totalCounter));
                $this->groups[$this->totalCounter] = $groupId;
                $this->groups[$groupId]['opened']  = true;
                $this->groups[$groupId]['content'] = sprintf(
@@ -287,7 +378,11 @@ abstract class BaseHelper extends BaseFrameworkSystem {
                $this->groups[$groupId]['tag'] = $tag;
 
                // Mark this group as previously opened
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: Setting this->previousGroupId=%s ...', $groupId));
                $this->setPreviousGroupId($groupId);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HELPER: EXIT!');
        }
 
        /**
@@ -300,6 +395,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         */
        public function closePreviousGroupByContent (string $content = '') {
                // Check if any sub group was opened before
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: content(%d)=%s - CALLED!', strlen($content), $content));
                if ($this->ifSubGroupOpenedPreviously()) {
                        // Close it automatically
                        $this->closePreviousSubGroupByContent();
@@ -336,7 +432,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
 
                // Mark previous group as closed
                $this->setPreviousGroupId('');
-               //* DEBUG: */ echo "CLOSE:groupId={$groupId}<br />\n";
+               //* NOISY-DEBUG: */ echo "CLOSE:groupId={$groupId}<br />\n";
        }
 
        /**
@@ -351,11 +447,11 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @throws      HelperSubGroupAlreadyCreatedException   If the sub group was already created before
         */
        protected function openSubGroupByIdContent (string $subGroupId, string $content, string $tag) {
-               //* DEBUG: */ echo "OPEN:subGroupId={$subGroupId},content=".htmlentities($content)."<br />\n";
+               //* NOISY-DEBUG: */ echo "OPEN:subGroupId={$subGroupId},content=".htmlentities($content)."<br />\n";
                // Is the group already there?
                if (empty($subGroupId)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "subGroupId" is empty');
+                       throw new InvalidArgumentException('Parameter "subGroupId" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (isset($this->subGroups[$subGroupId])) {
                        // Then throw an exception here
                        throw new HelperSubGroupAlreadyCreatedException(array($this, $subGroupId), self::EXCEPTION_SUB_GROUP_ALREADY_FOUND);
@@ -405,7 +501,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
 
                // Mark previous sub group as closed
                $this->setPreviousSubGroupId('');
-               //* DEBUG: */ echo "CLOSE:subGroupId={$subGroupId}<br />\n";
+               //* NOISY-DEBUG: */ echo "CLOSE:subGroupId={$subGroupId}<br />\n";
        }
 
        /**
@@ -432,12 +528,12 @@ abstract class BaseHelper extends BaseFrameworkSystem {
                        if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === false)) {
                                // Then add it's content
                                $groupContent = trim($this->groups[$this->groups[$idx]]['content']);
-                               //* DEBUG: */ echo "group={$this->groups[$idx]},content=<pre>".htmlentities($groupContent)."</pre><br />\n";
+                               //* NOISY-DEBUG: */ echo "group={$this->groups[$idx]},content=<pre>".htmlentities($groupContent)."</pre><br />\n";
                                $content .= $groupContent;
                        } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === false)) {
                                // Then add it's content
                                $subGroupContent = $this->subGroups[$this->subGroups[$idx]]['content'];
-                               //* DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=<pre>".htmlentities($subGroupContent)."</pre><br />\n";
+                               //* NOISY-DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=<pre>".htmlentities($subGroupContent)."</pre><br />\n";
                                $content .= trim($subGroupContent);
                        } else {
                                // Something went wrong
@@ -452,7 +548,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
                }
 
                // Return it
-               //* DEBUG: */ echo "content=<pre>".htmlentities($content)."</pre> (".strlen($content).")<br />\n";
+               //* NOISY-DEBUG: */ echo "content=<pre>".htmlentities($content)."</pre> (".strlen($content).")<br />\n";
                return $content;
        }
 
@@ -461,12 +557,21 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $groupId        Id of group to check
         * @return      $isOpened       Whether the specified group is open
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        protected function ifGroupIsOpened (string $groupId) {
+               // Check on parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: groupId=%s - CALLED!', $groupId));
+               if (empty($groupId)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "groupId" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is the group open?
                $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === true));
 
                // Return status
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: isOpened=%d - EXIT!', intval($isOpened)));
                return $isOpened;
        }
 
@@ -475,33 +580,42 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         *
         * @param       $fieldName              Name of the field we shall fetch
         * @return      $fieldValue             Value from field
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         * @throws      NullPointerException    Thrown if $valueInstance is null
         */
        public function getValueField (string $fieldName) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: fieldName=%s - CALLED!', $fieldName));
+               if (empty($fieldName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "fieldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Init value
                $fieldValue = NULL;
 
                // The $valueInstance attribute should not be null!
                if (is_null($this->getValueInstance())) {
                        // Throws an exception here
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Is the field set?
                if ($this->getValueInstance()->isFieldSet($fieldName)) {
                        // Get the field value
                        $fieldValue = $this->getValueInstance()->getField($fieldName);
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Value instance!');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Value instance!');
                } elseif ((!is_null($this->extraInstance)) && ($this->extraInstance->isFieldSet($fieldName))) {
                        // So try the extra instance
                        $fieldValue = $this->extraInstance->getField($fieldName);
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Extra instance!');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Extra instance!');
                } else {
                        // Field is not set
                        $this->debugOutput('BASE-HELPER: fieldName=' . $fieldName . ' is not set! - @TODO');
                }
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: fieldValue[%s]=%s - EXIT!', gettype($fieldValue), $fieldValue));
                return $fieldValue;
        }
 
index fd717dccb96dc229a441fea6ca2c043505f07f13..dc7f7ca6204c75b76f709252002f17b391e28e50 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -91,7 +91,7 @@ class HtmlBlockHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $withRegistration       Whether with registration date
         */
        public function ifIncludeRegistrationStamp () {
-               $withRegistration = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('block_shows_registration') == 'Y');
+               $withRegistration = FrameworkBootstrap::getConfigurationInstance()->isEnabled('block_shows_registration');
                return $withRegistration;
        }
 
index 7dcdfff7a530f657d97f0e7340eea4b0f2fb3072..224fb18565f9fc0d094e3a157a71d8ca7b9cfae5 100644 (file)
@@ -4,13 +4,14 @@ namespace Org\Mxchange\CoreFramework\Helper\;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * 
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -74,7 +75,7 @@ class Html???Helper extends BaseHtmlHelper implements HelpableTemplate {
         * @todo        0% done
         */
        public function flushContent () {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
 }
index b28191225fe9ce97a806fb7b3ffd7848207a7a83..0626786cee5de0fbab097d1bc27227388b5ce0f5 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 691728bfeb7249eebbe019a720eb09dd0bd5e6a8..967ad93fcfd882feffe46811a82cd9a2e3802d35 100644 (file)
@@ -8,7 +8,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
 // Import SPL stuff
@@ -19,7 +19,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -693,7 +693,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
 
                try {
                        // Get last executed pre filter
-                       $extraInstance = GenericRegistry::getRegistry()->getInstance('extra');
+                       $extraInstance = ObjectRegistry::getRegistry('generic')->getInstance('extra');
                } catch (NullPointerException $e) {
                        // Instance in registry is not set (NULL)
                        // @TODO We need to log this later
@@ -766,7 +766,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether the email address is required
         */
        public function ifRegisterRequiresEmailVerification () {
-               $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_requires_email') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_requires_email');
                return $required;
        }
 
@@ -776,7 +776,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether profile data shall be asked
         */
        public function ifRegisterIncludesProfile () {
-               $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_includes_profile') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_includes_profile');
                return $required;
        }
 
@@ -786,7 +786,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isSecured      Whether this form is secured by a CAPTCHA
         */
        public function ifFormSecuredWithCaptcha () {
-               $isSecured = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($this->getFormName() . '_captcha_secured') == 'Y');
+               $isSecured = FrameworkBootstrap::getConfigurationInstance()->isEnabled($this->getFormName() . '_captcha_secured');
                return $isSecured;
        }
 
@@ -796,7 +796,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether personal data shall be asked
         */
        public function ifRegisterIncludesPersonaData () {
-               $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_personal_data') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_personal_data');
                return $required;
        }
 
@@ -806,7 +806,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether birthday shall be asked
         */
        public function ifProfileIncludesBirthDay () {
-               $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('profile_includes_birthday') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('profile_includes_birthday');
                return $required;
        }
 
@@ -816,7 +816,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isUnique
         */
        public function ifEmailMustBeUnique () {
-               $isUnique = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_email_unique') == 'Y');
+               $isUnique = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_email_unique');
                return $isUnique;
        }
 
@@ -826,7 +826,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether the specified chat protocol is enabled
         */
        public function ifChatEnabled (string $chatProtocol) {
-               $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('chat_protocol_' . $chatProtocol);
                return $required;
        }
 
@@ -836,7 +836,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isEnabled      Whether the login is enabled or disabled
         */
        public function ifLoginIsEnabled () {
-               $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_enabled') == 'Y');
+               $isEnabled = FrameworkBootstrap::getConfigurationInstance()->isEnabled('user_login');
                return $isEnabled;
        }
 
@@ -846,7 +846,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isEnabled      Whether the login shall be done by username
         */
        public function ifLoginWithUsername () {
-               $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == "username");
+               $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == 'username');
                return $isEnabled;
        }
 
@@ -856,7 +856,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isEnabled      Whether the login shall be done by email
         */
        public function ifLoginWithEmail () {
-               $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == "email");
+               $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == 'email');
                return $isEnabled;
        }
 
@@ -866,7 +866,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isAllowed      Whether guest login is allowed
         */
        public function ifGuestLoginAllowed () {
-               $isAllowed = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_allowed') == 'Y');
+               $isAllowed = FrameworkBootstrap::getConfigurationInstance()->isEnabled('guest_login');
                return $isAllowed;
        }
 
@@ -876,7 +876,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $requireConfirm         Whether email change must be confirmed
         */
        public function ifEmailChangeRequireConfirmation () {
-               $requireConfirm = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_change_confirmation') == 'Y');
+               $requireConfirm = FrameworkBootstrap::getConfigurationInstance()->isEnabled('email_change_confirmation');
                return $requireConfirm;
        }
 
@@ -896,7 +896,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $emailChange    Whether changing email address is allowed
         */
        public function ifEmailChangeAllowed () {
-               $emailChange = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_change_allowed') == 'Y');
+               $emailChange = FrameworkBootstrap::getConfigurationInstance()->isEnabled('email_change');
                return $emailChange;
        }
 
@@ -937,7 +937,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $refillActive   Whether the refill page is active
         */
        public function ifRefillPageActive () {
-               $refillActive = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('refill_page_active') == 'Y');
+               $refillActive = FrameworkBootstrap::getConfigurationInstance()->isEnabled('refill_page_active');
                return $refillActive;
        }
 
index cbbf10592d5686933fd8b1a8101b74050470abfb..170a309231c21ae1ef78a3bc3dff51877b952e15 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Configuration\NoConfigEntryException;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
@@ -18,7 +17,7 @@ use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -94,7 +93,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
                // Sanity-check on it
                if (is_null($requestInstance)) {
                        // Throw an exception here
-                       throw new NullPointerException($helperInstance, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($helperInstance, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Get page (this will throw an exception if not set)
index 027e7dc176b7c1a949e5a73929c14e6820514bec..a040bbf78ec356db21e30677168fef966e522e54 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Helper\BaseHelper;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5fdb1685511f9e7c680491cabd4301008e0cc6f7..63e7ec5cb98a3e31c248ce63f8f1895082470d8f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index dc0d08feefb70aee3dff2a211cdd8189ff2845ee..a6f8faa5ef64b30a446a2da7119f70af8fded6a5 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7fffe8a6b4554defcaf3da92995194073d1612a9..4dcc9d3dd7946de590557ca9115ae09d80f2235b 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Image;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
 // Import SPL stuff
@@ -14,7 +15,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -69,7 +70,7 @@ class PngImage extends BaseImage {
         * @todo Rewrite this to SplFileInfo/Object
         */
        public function finishImage () {
-               $this->partialStub('Unfinished method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished method.');
                return;
 
                // Call parent method
index 105d411b4f96da90ebfe694aa0c2d1b3943b1378..5ddd77d7c9e2b0cc3e2016d33fa0968f3b4a6c18 100644 (file)
@@ -14,7 +14,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a529696e3bb02072c8b6e87ee6958e4432326e4e..63cda9e1f13cc8f2fe020ba72378be9a91704cda 100644 (file)
@@ -3,7 +3,6 @@
 namespace Org\Mxchange\CoreFramework\Index;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
@@ -13,14 +12,13 @@ use Org\Mxchange\CoreFramework\Traits\Iterator\IteratorTrait;
 
 // Import SPL stuff
 use \SplFileInfo;
-use \UnexpectedValueException;
 
 /**
  * A general index class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 39f1cbff3bb52f62b8ac82df7def45f12bf20e3a..080678fc73d9a98a1b8001dc4b6b9cea4c317f7a 100644 (file)
@@ -7,6 +7,7 @@ use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
 use Org\Mxchange\CoreFramework\Filesystem\File\BinaryFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Index\BaseIndex;
 use Org\Mxchange\CoreFramework\Index\Indexable;
 use Org\Mxchange\CoreFramework\Utils\Arrays\ArrayUtils;
@@ -22,7 +23,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -82,7 +83,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                                strlen($data),
                                $data,
                                $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (empty(trim($data, chr(0)))) {
                        // Empty file header
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: File header is empty - EXIT!');
@@ -92,14 +93,14 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                        throw new UnexpectedValueException(sprintf('data=%s does not end with "%s"',
                                $data,
                                chr(BinaryFile::SEPARATOR_HEADER_ENTRIES)
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Okay, then remove it
                $data = substr($data, 0, -1);
 
                // And update seek position
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->updateSeekPosition();
 
                /*
@@ -111,7 +112,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                $header = explode(chr(BinaryFile::SEPARATOR_HEADER_DATA), $data);
 
                // Map numeric entries to associative (alpha-numeric) elements
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Calling ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
                //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: header(%d)=%s', count($header), print_r($header, true)));
                $header = ArrayUtils::mapNumericKeysToAssociative($header, [
                        BinaryFile::HEADER_NAME_MAGIC,
@@ -122,13 +123,13 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: HEADER_INDEX_ELEMENT_COUNT=%d,header()=%d', BinaryFile::HEADER_INDEX_ELEMENT_COUNT, count($header)));
                if (count($header) != BinaryFile::HEADER_INDEX_ELEMENT_COUNT) {
                        // Bad header
-                       throw new UnexpectedValueException(sprintf('header()=%d is not expected value %d', count($header), BinaryFile::HEADER_INDEX_ELEMENT_COUNT));
+                       throw new UnexpectedValueException(sprintf('header()=%d is not expected value %d', count($header), BinaryFile::HEADER_INDEX_ELEMENT_COUNT), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif ($header[BinaryFile::HEADER_NAME_MAGIC] !== Indexable::INDEX_MAGIC) {
                        // Magic must be in first element
-                       throw new UnexpectedValueException(sprintf('header[%s]=%s is not the expected magic (%s)', BinaryFile::HEADER_NAME_MAGIC, $header[BinaryFile::HEADER_NAME_MAGIC], Indexable::INDEX_MAGIC));
+                       throw new UnexpectedValueException(sprintf('header[%s]=%s is not the expected magic (%s)', BinaryFile::HEADER_NAME_MAGIC, $header[BinaryFile::HEADER_NAME_MAGIC], Indexable::INDEX_MAGIC), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]) != BinaryFile::LENGTH_COUNT) {
                        // Length of total entries not matching
-                       throw new UnexpectedValueException(sprintf('header[%s](%d)=%s does not have expected length %d', BinaryFile::HEADER_NAME_TOTAL_ENTRIES, strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]), $header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES], BinaryFile::LENGTH_COUNT));
+                       throw new UnexpectedValueException(sprintf('header[%s](%d)=%s does not have expected length %d', BinaryFile::HEADER_NAME_TOTAL_ENTRIES, strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]), $header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES], BinaryFile::LENGTH_COUNT), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Decode count
@@ -164,7 +165,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                );
 
                // Write it to disk (header is always at seek position 0)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header));
                $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header);
 
                // Trace message
@@ -202,7 +203,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                $this->getIteratorInstance()->getBinaryFileInstance()->setHeaderSize($headerSize);
 
                // Init counters and gaps array
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->initCountersGapsArray() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->initCountersGapsArray() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->initCountersGapsArray();
 
                // Default is not created
@@ -211,11 +212,11 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                // Is the file's header initialized?
                if (!$this->getIteratorInstance()->getBinaryFileInstance()->isFileHeaderInitialized()) {
                        // First pre-allocate a bit
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->preAllocateFile(index) ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->preAllocateFile(index) ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->preAllocateFile('index');
 
                        // Then write file header
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->createFileHeader() ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->createFileHeader() ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->createFileHeader();
 
                        // Mark as freshly created
@@ -223,14 +224,14 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                }
 
                // Load the file header
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->readIndexHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->readIndexHeader() ...');
                $this->readIndexHeader();
 
                // Freshly created?
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: created=%d', intval($created)));
                if (!$created) {
                        // Analyze file structure
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->analyzeFileStructure() ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->analyzeFileStructure() ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->analyzeFileStructure();
                }
 
@@ -315,11 +316,11 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                        throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid.', $seekPosition));
                } elseif (empty($dataStream)) {
                        // Empty dataStream
-                       throw new InvalidArgumentException('Parameter "dataStream" is empty');
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call iterated object's method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
                $status = $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition($seekPosition, $dataStream);
 
                // Return status
index 4bea7db9290d9e137f2da2890f85cb4259715daf..f47f423c95bd92dc34523c4d3ac697b1509ea96c 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Index\File\Stack;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Index\File\BaseFileIndex;
 use Org\Mxchange\CoreFramework\Index\File\Stack\IndexableStack;
 use Org\Mxchange\CoreFramework\Index\Indexable;
@@ -19,7 +20,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -80,7 +81,7 @@ class FileStackIndex extends BaseFileIndex implements IndexableStack, Registerab
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,data()=%d - CALLED!', $stackName, count($data)));
                if (empty($stackName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "stackName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (count($data) == 0) {
                        // Throw it again
                        throw new InvalidArgumentException('Parameter "data" is an empty array');
@@ -108,18 +109,18 @@ class FileStackIndex extends BaseFileIndex implements IndexableStack, Registerab
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,rawData(%d)=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), strlen($rawData), $rawData));
 
                // Search for next free gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Calling this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData)));
                $gapPosition = $this->getIteratorInstance()->getBinaryFileInstance()->searchNextGap(strlen($rawData));
 
                // Gap position cannot be smaller or equal than header length
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,gapPosition=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), $gapPosition));
                if ($gapPosition <= ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)) {
                        // Not valid gap position returned
-                       throw new UnexpectedValueException(sprintf('gapPosition[%s]=%d is smaller or equal headerSize+1=%d', gettype($gapPosition), $gapPosition, ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)));
+                       throw new UnexpectedValueException(sprintf('gapPosition[%s]=%d is smaller or equal headerSize+1=%d', gettype($gapPosition), $gapPosition, ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Then write the data at that gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Calling this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData));
                $this->getIteratorInstance()->getBinaryFileInstance()->writeData($gapPosition, $rawData);
 
                // Trace message
index fb10c21829a30b9894307b649270134144d5116d..d08a1d90400f76376655fa091cdbd77e309c6c0b 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Iterator\!!!;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Iterator\BaseIterator;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 // Import SPL stuff
 use \Iterator;
@@ -13,7 +14,7 @@ use \Iterator;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -63,7 +64,7 @@ class ???Iterator extends BaseIterator implements Iterator {
                // Default is null
                $current = null;
 
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
 
                // Return it
                return $current;
@@ -78,7 +79,7 @@ class ???Iterator extends BaseIterator implements Iterator {
                // Default is null
                $key = null;
 
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
 
                // Return it
                return $key;
@@ -90,7 +91,7 @@ class ???Iterator extends BaseIterator implements Iterator {
         * @return      void
         */
        public function next () {
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
        /**
@@ -99,7 +100,7 @@ class ???Iterator extends BaseIterator implements Iterator {
         * @return      void
         */
        public function rewind () {
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
        /**
@@ -108,7 +109,7 @@ class ???Iterator extends BaseIterator implements Iterator {
         * @return      void
         */
        public function valid () {
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
 }
index 4b6b4d2aa5806ec8a968746fc8a790de3b92dcbe..07eb0369ce47a50cbd337964d812eb04e52fd446 100644 (file)
@@ -15,7 +15,7 @@ use \Iterator;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 67d5a5c076db71e3c08b71f1ba0b1e0daab3338e..ba05b58b23b7fd77d8c61e4830cfd5515933e7b8 100644 (file)
@@ -15,7 +15,7 @@ use \Iterator;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7ebae5f0dc949c8daac41e5277b7dcf4aea793b8..face6a395ece52246f7481c2551e40118d0d6d90 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Iterator\File;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\File\BinaryFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Iterator\BaseIterator;
 use Org\Mxchange\CoreFramework\Traits\File\BinaryFileTrait;
 
@@ -18,7 +19,7 @@ use \SeekableIterator;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -79,7 +80,7 @@ class FileIterator extends BaseIterator implements SeekableIterator {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILE-ITERATOR: CALLED!');
                if (!$this->valid()) {
                        // Throw BMCE
-                       throw new BadMethodCallException('Current key cannot be valid, forgot to invoke valid()?');
+                       throw new BadMethodCallException('Current key cannot be valid, forgot to invoke valid()?', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Call file instance
@@ -101,7 +102,7 @@ class FileIterator extends BaseIterator implements SeekableIterator {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILE-ITERATOR: CALLED!');
                if (!$this->valid()) {
                        // Throw BMCE
-                       throw new BadMethodCallException('Current key cannot be valid, forgot to invoke valid()?');
+                       throw new BadMethodCallException('Current key cannot be valid, forgot to invoke valid()?', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Get key from file instance
index b90b6721ddd8432b68ebdc4412833565070ecb25..731c61acdf9c7253e48eef99a4c09ec680868b11 100644 (file)
@@ -7,21 +7,22 @@ use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Iterator\BaseIterator;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Registry\Register;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\Registry\Sub\SubRegistry;
 use Org\Mxchange\CoreFramework\Traits\Registry\RegisterTrait;
 
 // Import SPL stuff
 use \BadMethodCallException;
 use \LogicException;
+use \UnexpectedValueException;
 
 /**
  * A registry iterator
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -84,12 +85,14 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public final static function createRegistryIterator (Register $registryInstance) {
                // Get new instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR: registryInstance=%s - CALLED!', $registryInstance->__toString()));
                $iteratorInstance = new RegistryIterator();
 
                // Set registry here
                $iteratorInstance->setRegistryInstance($registryInstance);
 
                // Return the prepared instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR: iteratorInstance=%s - EXIT!', $iteratorInstance->__toString()));
                return $iteratorInstance;
        }
 
@@ -113,14 +116,14 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public function initIterator (array $onlyRegistries = []) {
                // Set it in this registry
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR: onlyRegistries()=%d - CALLED!', count($onlyRegistries)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR: onlyRegistries()=%d - CALLED!', count($onlyRegistries)));
                $this->setOnlyRegistries($onlyRegistries);
 
                // Get generic registry entries from it
                $entries = $this->getRegistryInstance()->getGenericRegistry();
 
                // Anything in there?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[generic]: entries()=%d', count($entries)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: entries()=%d', count($entries)));
                if (count($entries) > 0) {
                        // Debugging:
                        /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: UNFINISHED: entries=%s', __METHOD__, __LINE__, print_r($entries, TRUE)));
@@ -130,39 +133,39 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                $entries = $this->getRegistryInstance()->getInstanceRegistry();
 
                // Anything in there?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: entries()=%d', count($entries)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: entries()=%d', count($entries)));
                if (count($entries) > 0) {
                        // Then run over all
                        foreach ($entries as $key => $entry) {
                                // Is an unwanted registry found?
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s,entry[]=%s', $key, gettype($entry)));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: key=%s,entry[%s]=%s', $key, gettype($entry), $entry->__toString()));
                                if (substr($key, -8, 8) == 'registry') {
                                        // Skip this!
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s is a registry key, skipping ...', $key));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: key=%s is a registry key, skipping ...', $key));
                                        continue;
                                }
 
                                // Is it an instance of a sub-registry?
                                if (count($onlyRegistries) > 0 && !in_array($key, $onlyRegistries, TRUE)) {
                                        // Not in requested registries
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s is not wanted, skipping ...', $key));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: key=%s is not wanted, skipping ...', $key));
                                        continue;
-                               } elseif ($entry instanceof SubRegistry) {
+                               } elseif ($entry instanceof ObjectRegistry) {
                                        // Get iterator from this instance
-                                       $subRegistryInstances = $entry->getInstanceRegistry();
+                                       $objectRegistryInstances = $entry->getInstanceRegistry();
 
                                        // Add all sub-registry keys to this registry keys array
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: subRegistryInstances()=%d', count($subRegistryInstances)));
-                                       //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: key=%s,subRegistryInstances=%s', __METHOD__, __LINE__, $key, print_r($subRegistryInstances, TRUE)));
-                                       foreach (array_keys($subRegistryInstances) as $subKey) {
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: objectRegistryInstances()=%d', count($objectRegistryInstances)));
+                                       //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: key=%s,objectRegistryInstances=%s', __METHOD__, __LINE__, $key, print_r($objectRegistryInstances, TRUE)));
+                                       foreach (array_keys($objectRegistryInstances) as $subKey) {
                                                // Add it
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: Adding key=%s,subKey=%s ...', $key, $subKey));
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: Adding key=%s,subKey=%s ...', $key, $subKey));
                                                array_push($this->registryKeys['instance'], $subKey);
 
                                                // Is the current key set?
                                                if (is_null($this->key)) {
                                                        // Init key
-                                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: Setting subKey=%s as first key ...', $subKey));
+                                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: Setting this->key=%s as first key (subKey) ...', $subKey));
                                                        $this->key = $subKey;
                                                }
                                        }
@@ -171,25 +174,25 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                                        continue;
                                } elseif (!($entry instanceof Registerable)) {
                                        // Not registerable?!
-                                       throw new LogicException(sprintf('entry[]=%s does not implement Registerable.', gettype($entry)));
+                                       throw new LogicException(sprintf('entry[]=%s does not implement Registerable.', gettype($entry)), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                                }
 
                                // Is the current key set?
                                if (is_null($this->key)) {
                                        // Init key
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: Setting key=%s as first key ...', $key));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: Setting this->key=%s as first key (key) ...', $key));
                                        $this->key = $key;
                                }
 
                                // Add key to array
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s - Adding ...', $key));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: key=%s - Adding ...', $key));
                                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: key=%s,entry=%s', __METHOD__, __LINE__, $key, print_r($entry, TRUE)));
                                array_push($this->registryKeys['instance'], $key);
                        }
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY-ITERATOR: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('REGISTRY-ITERATOR: EXIT!');
        }
 
        /**
@@ -210,7 +213,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public function current () {
                // Default is null
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
                $current = NULL;
                $entries = [];
@@ -219,38 +222,39 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                $allRegistries = $this->getRegistryInstance()->getInstanceRegistry();
 
                // Loop through all sub-sets
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: allRegistries()=%d', $this->key(), count($allRegistries)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: allRegistries()=%d', $this->key(), count($allRegistries)));
                foreach ($allRegistries as $registryKey => $registryInstance) {
                        // Is this key wanted?
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s', $this->key(), $registryKey));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s', $this->key(), $registryKey));
                        if (count($this->onlyRegistries) == 0 || in_array($registryKey, $this->onlyRegistries)) {
                                // Yes, then loop through them only
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s,this->onlyRegistries()=%d', $this->key(), $registryKey, count($this->onlyRegistries)));
                                $instances = $registryInstance->getInstanceRegistry();
 
                                // The key should be there
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: Handling registryKey=%s ...', $this->key(), $registryKey));
-                               //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: instances=%s', __METHOD__, __LINE__, print_r($instances, TRUE)));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: Handling instances()=%d,registryKey=%s ...', $this->key(), count($instances), $registryKey));
                                if (!isset($instances[$this->key()])) {
-                                       // Skip below code
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s has no this->key=%s, skipping ...', $this->key(), $registryKey));
+                                       // Not found
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s has no this->key=%s - CONTINUE!', $this->key(), $registryKey, $this->key()));
                                        continue;
                                }
 
-                               // Set as current element and leave loop
+                               // Set as current
                                $current = $instances[$this->key()];
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s,current=%s found. - BREAK!', $this->key(), $registryKey, $current->__toString()));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: current=%s', $this->key(), $current->__toString()));
                                break;
                        }
                }
 
                // Is current still NULL?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s,current[]=%s', $this->key(), $registryKey, gettype($current)));
                if (is_null($current)) {
                        // This cannot happen and indicates a logic error
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: current[%s]=%s - EXIT!', $this->key(), gettype($current), $current));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: current[%s]=%s - EXIT!', $this->key(), gettype($current), $current));
                return $current;
        }
 
@@ -261,7 +265,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public function key () {
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR: this->key=%s EXIT!', $this->key));
                return $this->key;
        }
 
@@ -274,14 +278,14 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public function next () {
                // Is valid() still TRUE?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
                if (!$this->valid()) {
                        // Bad method call!
-                       throw new BadMethodCallException(sprintf('this->key[%s]=%s is no longer valid, but method was called.', gettype($this->key()), $this->key()));
+                       throw new BadMethodCallException(sprintf('this->key[%s]=%s is no longer valid, but method was called.', gettype($this->key()), $this->key()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ((count($this->registryKeys['generic']) == 0) && (count($this->registryKeys['instance']) == 0)) {
                        // Both arrays are empty
-                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.');
+                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Default is not valid
@@ -290,7 +294,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                $registryType = 'invalid';
 
                // Get first array element ...
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: this->registryKeys[generic]()=%d,this->registryKeys[instance]()=%d', $this->key(), count($this->registryKeys['generic']), count($this->registryKeys['instance'])));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: this->registryKeys[generic]()=%d,this->registryKeys[instance]()=%d', $this->key(), count($this->registryKeys['generic']), count($this->registryKeys['instance'])));
                if (count($this->registryKeys['generic']) > 0) {
                        // First generic array
                        /* UNFINISHED */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
@@ -302,20 +306,21 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
                }
 
                // Is it still valid?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: isNextValid=%d', $this->key(), intval($isNextValid)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: isNextValid=%d', $this->key(), intval($isNextValid)));
                if (!$isNextValid) {
                        // Throw exception
-                       throw new BadMethodCallException(sprintf('this->key=%s is last key in this iteration. Forgot to invoke valid() before?', $this->key()));
+                       throw new BadMethodCallException(sprintf('this->key=%s is last key in this iteration. Forgot to invoke valid() before?', $this->key()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ($registryType == 'invalid') {
                        // Not changed!
-                       throw new UnexpectedValueException('registryType has not been changed.');
+                       throw new UnexpectedValueException('registryType has not been changed.', FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Yes, then advance to that entry
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[%s][%d] ...', $registryType, $nextIndex));
                $this->key = $this->registryKeys[$registryType][$nextIndex];
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key()));
        }
 
        /**
@@ -326,28 +331,29 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public function rewind () {
                // Is current key first key?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
                if (array_search($this->key(), $this->getRegistryKeys()) === 0) {
                        // rewind() cannot rewind first entry!
-                       throw new BadMethodCallException(sprintf('this->key=%s is already first element, but method was called.', $this->key()));
+                       throw new BadMethodCallException(sprintf('this->key=%s is already first element, but method was called.', $this->key()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ((count($this->registryKeys['generic']) == 0) && (count($this->registryKeys['instance']) == 0)) {
                        // Both arrays are empty
-                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.');
+                       throw new BadMethodCallException('No array elements in "generic" and "instance" found but method called.', FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Get first array element ...
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: this->registryKeys[generic]()=%d,this->registryKeys[instance]()=%d', $this->key(), count($this->registryKeys['generic']), count($this->registryKeys['instance'])));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: this->registryKeys[generic]()=%d,this->registryKeys[instance]()=%d', $this->key(), count($this->registryKeys['generic']), count($this->registryKeys['instance'])));
                if (count($this->registryKeys['generic']) > 0) {
                        // First generic array
                        /* UNFINISHED */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
                } elseif (count($this->registryKeys['instance']) > 0) {
                        // Second instance
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[instance][0] ...');
                        $this->key = $this->registryKeys['instance'][0];
                }
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key()));
        }
 
        /**
@@ -357,12 +363,12 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry {
         */
        public function valid () {
                // Is the element there?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: CALLED!', $this->key()));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), print_r($this->registryKeys, TRUE)));
                $valid = (in_array($this->key(), $this->registryKeys['instance']) || in_array($this->key(), $this->registryKeys['generic']));
 
                // Return flag
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[%s]: valid=%d - EXIT!', $this->key(), intval($valid)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: valid=%d - EXIT!', $this->key(), intval($valid)));
                return $valid;
        }
 
index ee41676a0044db4a29ecb01f5d53ae772048a1e0..44e8801f9b844a986e70737aa4a63709c4420b65 100644 (file)
@@ -5,11 +5,11 @@ namespace Org\Mxchange\CoreFramework\Localization;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Localization\ManageableLanguage;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\ObjectArray\FrameworkArrayObject;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 
 // Import SPL stuff
 use \InvalidArgumentException;
@@ -20,7 +20,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -100,7 +100,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
                // Is the base path valid?
                if (empty($languageBasePath)) {
                        // Language path is empty
-                       throw new InvalidArgumentException('languageBasePath is still empty');
+                       throw new InvalidArgumentException('languageBasePath is still empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!is_dir($languageBasePath)) {
                        // Is not a path
                        throw new InvalidArgumentException(sprintf('languageBasePath=%s not found', $languageBasePath), self::EXCEPTION_INVALID_PATH_NAME);
index 2a83285b886d16f47f5769d4b03084aec9fee9d2..93cc43ddad82967780a7dffcbeb050ebd513ffc5 100644 (file)
@@ -1,10 +1,13 @@
 <?php
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+
 /**
  * A ??? list
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -52,7 +55,7 @@ class ???List extends BaseList implements Listable {
         * @todo        0% done
         */
        public function getListIterator () {
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
        /**
@@ -62,7 +65,7 @@ class ???List extends BaseList implements Listable {
         * @todo        0% done
         */
        public function clearList () {
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
 }
index 0e581e8a6697f1b5858e0aee44dd25cf034bbff3..061733a44c14c496a733354567cafde11a2c166f 100644 (file)
@@ -20,7 +20,7 @@ use \Countable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -113,7 +113,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-LIST: groupName=%s - CALLED!', $groupName));
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Check on existence ...
@@ -132,7 +132,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-LIST: groupName=%s - CALLED!', $groupName));
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->isGroupSet($groupName)) {
                        // Throw the exception here
                        throw new BadMethodCallException(sprintf('groupName=%s is already set', $groupName), self::EXCEPTION_GROUP_ALREADY_ADDED);
@@ -157,10 +157,10 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST: groupName=' . $groupName  . ',subGroup=' . $subGroup . ',visitableInstance=' . $visitableInstance->__toString() . ' - CALLED!');
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($subGroup)) {
                        // Throw it again
-                       throw new InvalidArgumentException('Parameter "subGroup" is empty');
+                       throw new InvalidArgumentException('Parameter "subGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
                        throw new BadMethodCallException(sprintf('groupName=%s is not a valid group', $groupName), self::EXCEPTION_GROUP_NOT_FOUND);
@@ -198,7 +198,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST: groupName[' . gettype($groupName) . ']=' . $groupName . ' - CALLED!');
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
                        throw new BadMethodCallException(sprintf('groupName=%s is not a valid group', $groupName), self::EXCEPTION_GROUP_NOT_FOUND);
@@ -243,7 +243,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST: groupName=' . $groupName . ' - CALLED!');
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
                        throw new BadMethodCallException(sprintf('groupName=%s is not a valid group', $groupName), self::EXCEPTION_GROUP_NOT_FOUND);
@@ -281,7 +281,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST: groupName=' . $groupName . ' - CALLED!');
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
                        throw new BadMethodCallException(sprintf('groupName=%s is not a valid group', $groupName), self::EXCEPTION_GROUP_NOT_FOUND);
@@ -377,7 +377,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                // Does this group exist?
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
                        throw new BadMethodCallException(sprintf('groupName=%s is not a valid group', $groupName), self::EXCEPTION_GROUP_NOT_FOUND);
@@ -410,7 +410,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                // Validate parameter
                if (empty($hash)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "hash" is empty');
+                       throw new InvalidArgumentException('Parameter "hash" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!isset($this->cache['is_valid'][$hash])) {
                        // Check it
                        $this->cache['is_valid'][$hash] = ((in_array($hash, $this->listIndex)) && (isset($this->listEntries[$hash])));
@@ -470,7 +470,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-LIST: groupName=%s - CALLED!', $groupName));
                if (empty($groupName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupName" is empty');
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isGroupSet($groupName)) {
                        // Throw the exception here
                        throw new BadMethodCallException(sprintf('groupName=%s is not a valid group', $groupName), self::EXCEPTION_GROUP_NOT_FOUND);
@@ -517,7 +517,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate
                // Is the hash valid?
                if (empty($hash)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "hash" is empty');
+                       throw new InvalidArgumentException('Parameter "hash" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isHashValid($hash)) {
                        // Throw an exception here, hashIndex is unknown at this point
                        throw new InvalidListHashException(array($this, $hash, -999), self::EXCEPTION_INVALID_HASH);
index c25216450977666762f2409ffecfd0f82d442955..8f3f6ac5a765faa53d4fa4d8ac55c62e75366ce7 100644 (file)
@@ -5,13 +5,14 @@ namespace Org\Mxchange\CoreFramework\Lists\Group;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Lists\BaseList;
 use Org\Mxchange\CoreFramework\Lists\Listable;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * A ListGroup list
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -68,7 +69,7 @@ class ListGroupList extends BaseList implements Listable {
         * @todo        0% done
         */
        public function clearList () {
-               $this->partialStub('Please implement this method.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
 }
index a489a776deb34cbafe0da68e23f8ff8ec484e2c1..200cc39ac5398a9110a2637ed6d2c1491c0a14b2 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Lists\Listable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 339b6df86353c2c1d49fcf927187ef1b74cfc94c..55b566a36e5019c2de8461a7842f579ccb105f8f 100644 (file)
@@ -5,13 +5,14 @@ namespace Org\Mxchange\CoreFramework\Mailer\!!!;
 // Import framwork stuff
 use Org\Mxchange\CoreFramework\Mailer\BaseMailer;
 use Org\Mxchange\CoreFramework\Mailer\DeliverableMail;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * A ??? mailer class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -59,7 +60,7 @@ class ???Mailer extends BaseMailer implements DeliverableMail {
         * @todo        0% done
         */
        public function deliverEmail() {
-               $this->partialStub("You have to implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("You have to implement this method.");
        }
 
        /**
@@ -69,7 +70,7 @@ class ???Mailer extends BaseMailer implements DeliverableMail {
         * @todo        0% done
         */
        public function sendAdminNotification() {
-               $this->partialStub("You have to implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("You have to implement this method.");
        }
 
 }
index d2f5385175a8e2bb37b6fc1af5001d9900da3d1b..dd95136132f1b4d3064a09977c57929cc0a57c81 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e3fcd009385c81e5091b0313745a57a148afc8c3..884b385877b1fe035a661b291bd9d79a6534c5b8 100644 (file)
@@ -21,7 +21,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -88,7 +88,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                                // The recipient should be a user instance, right?
                                if (!$recipientInstance instanceof ManageableMember) {
                                        // Invalid entry found!
-                                       throw new UnexpectedValueException(sprintf('recipientInstance[]=%s does not implement ManageableMember', gettype($recipientInstance)));
+                                       throw new UnexpectedValueException(sprintf('recipientInstance[]=%s does not implement ManageableMember', gettype($recipientInstance)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                                }
 
                                // User class found, so entry is valid, first load the template
@@ -108,7 +108,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                                        // Is the value instance there?
                                        if (!isset($recipientList['values'][$variable])) {
                                                // Throw exception
-                                               throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                                               throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                                        }
 
                                        // Get the field from the value instance
index dbf535563a3a1e713d2b95720018d4c754771cea..72ed27cff811fd84e77b477ecc6666e42d1e7405 100644 (file)
@@ -8,7 +8,7 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
 
 /**
index 5f61021464c3c43f9f0335588e77bf26914ec9ec..84b7d53dd215256e589d80f4b5f3ee955b900b3a 100644 (file)
@@ -5,13 +5,14 @@ namespace Org\Mxchange\CoreFramework\Output\;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
 /**
  * A ??? output class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -79,7 +80,7 @@ class ???Output extends BaseOutput implements OutputStreamer, Registerable {
         * @todo        0% done
         */
        public final function output ($outStream = false, $stripTags = false) {
-               $this->partialStub('Please implement this method. outStream()=' . strlen($outStream) . ',stripTags=' . intval($stripTags));
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this method. outStream()=' . strlen($outStream) . ',stripTags=' . intval($stripTags));
        }
 
        /**
index fec98f5745d5528bc4e6546b9b00231448b9861a..d0e5bff199c37f30786dfd5194098dee5db44e05 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3fa0b5051627ec2d8a42405632eace4d9a33652e..453ea8741a2c711e692af492e000ad409358f79f 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 37b4d372a4a6127cf24d42cdfc0035edeb2789ff..efc5788f69cb9666c4f3350864ba956285542559 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Output\BaseOutput;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 12764396a2eaaa63003760992f93d96043bfa051..140365da8eaf583512d146aff1fdf5a7e27b443f 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Debug\Output;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Debug\Debugger;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Output\Debug\BaseDebugOutput;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -15,7 +16,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -36,7 +37,7 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre
        /**
         * Cached configuration entry 'debug_*_output_timings'
         */
-       private $debugOutputTimings = 'N';
+       private $isDebugOutputTimingsEnabled = FALSE;
 
        /**
         * Protected constructor
@@ -48,7 +49,7 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre
                parent::__construct(__CLASS__);
 
                // Cache configuration entry
-               $this->debugOutputTimings = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings');
+               $this->isDebugOutputTimingsEnabled = FrameworkBootstrap::getConfigurationInstance()->isEnabled('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings');
        }
 
        /**
@@ -79,7 +80,7 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre
                }
 
                // Are debug times enabled?
-               if ($this->debugOutputTimings == 'Y') {
+               if ($this->isDebugOutputTimingsEnabled) {
                        // Output it first
                        $output = $this->getPrintableExecutionTime() . $output;
                }
@@ -111,7 +112,7 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre
         */
        public function streamData (string $data) {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 96e30b98a47897935f9bfe6b7176f8b88cef31ca..299824128bd2d4e172eac78ede3c78f345887963 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Output\Debug;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Debug\Debugger;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Output\Debug\BaseDebugOutput;
 use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -101,7 +102,7 @@ class DebugErrorLogOutput extends BaseDebugOutput implements Debugger, OutputStr
         */
        public function streamData (string $data) {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 7a1ac22774850bdc7308c0ca047cf8a9fea5f469..4617d45f7fe76c88ea3271513d67102250a10418 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Output\Debug;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Debug\Debugger;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Output\Debug\BaseDebugOutput;
 use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -90,7 +91,7 @@ class DebugWebOutput extends BaseDebugOutput implements Debugger, OutputStreamer
         */
        public function streamData (string $data) {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index e835967248bcb76d64ec4396555d75d983317c5e..7fbb1a757131805e474b57f3f14f5155b1ce6aaf 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 59d73c4dbe8f37de18f6a6e7fe8f001d00192f6e..e3ec632b0ad359cb03bb0a192828f74422215e5e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a73247a6a7252d182c699a77d31b72aabd82a791..c303459bd2a0a3ef5695c273b816fddcccb16482 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 79da56dab8d6c6ed8e970603c6a159f7db85fa39..7b09884e3d00fb75d1e33bac5185a97e70c35954 100644 (file)
@@ -3,6 +3,8 @@
 namespace Org\Mxchange\CoreFramework\Parser\Xml;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Parser\BaseParser;
 use Org\Mxchange\CoreFramework\Parser\Parseable;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
@@ -15,7 +17,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -69,9 +71,10 @@ class XmlParser extends BaseParser implements Parseable {
         */
        public function parseXmlContent (string $content) {
                // Convert all to UTF8
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: content()=%d - CALLED!', strlen($content)));
                if (empty($content)) {
                        // No empty content
-                       throw new InvalidArgumentException('content is empty');
+                       throw new InvalidArgumentException('content is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (function_exists('recode')) {
                        // Recode found, so use it
                        $content = recode('html..utf8', $content);
@@ -80,13 +83,14 @@ class XmlParser extends BaseParser implements Parseable {
                        $content = mb_convert_encoding($content, 'UTF-8', 'auto');
                } else {
                        // @TODO We need to find a fallback solution here
-                       $this->partialStub('Cannot find recode/mbstring extension!');
+                       DebugMiddleware::getSelfInstance()->partialStub('Cannot find recode/mbstring extension!');
                }
 
                // Get an XML parser
                $xmlParser = xml_parser_create();
 
                // Force case-folding to on
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Created xmlParser=%s ...', $xmlParser));
                xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, TRUE);
 
                // Set UTF-8
@@ -100,14 +104,19 @@ class XmlParser extends BaseParser implements Parseable {
                xml_set_character_data_handler($xmlParser, 'characterHandler');
 
                // Now parse the XML tree
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Invoking xml_parse(%s, content()=%d) ...', $xmlParser, strlen($content)));
                if (!xml_parse($xmlParser, $content)) {
                        // Error found in XML
                        //* DEBUG: */ exit(__METHOD__ . ':<pre>'.htmlentities($content).'</pre>');
-                       throw new XmlParserException(array($this, $xmlParser), Parseable::EXCEPTION_XML_PARSER_ERROR);
+                       throw new XmlParserException([$this, $xmlParser], Parseable::EXCEPTION_XML_PARSER_ERROR);
                }
 
                // Free the parser
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Freeing xmlParser=%s ...', $xmlParser));
                xml_parser_free($xmlParser);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('XML-PARSER: EXIT!');
        }
 
 }
index 49be57d6eb755c18deb57feaf86af1897753b18c..8f451ce343f531d1cabd27aaddb720150085ea30 100644 (file)
@@ -18,7 +18,7 @@ use Org\Mxchange\CoreFramework\User\ManageableAccount;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 29e79cae3c41a41a5626e782fda6de405b491b38..8c395272af686b5c58afaf9809f6660396004fa1 100644 (file)
@@ -17,7 +17,7 @@ use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e15f542473652adca41485902c6dce47bf8cab2e..2ef04379f33a3f8758175d92d06ae098e26dc61b 100644 (file)
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d7b8ddbbc8e1f2e27b016b35f77b0a9dddcef84b..2221eeb69463bcbd486080ede1d1d30ff70930ff 100644 (file)
@@ -13,7 +13,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5cad5306eff29a85f6b85f809aefb6eaa263c619..a4ffbcbceda27072f255889a086b5e82b44e5f63 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Registry\Register;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -32,7 +32,7 @@ class ???Registry extends BaseRegistry implements Register {
        /**
         * Instance of this class
         */
-       private static $registryInstance = null;
+       private static $registryInstances = [];
 
        /**
         * Protected constructor
@@ -50,15 +50,15 @@ class ???Registry extends BaseRegistry implements Register {
         *
         * @return      $registryInstance       Instance of this class
         */
-       public final static function getRegistry () {
+       public final static function getRegistry (string $key) {
                // Is an instance there?
-               if (is_null(self::$registryInstance)) {
+               if (is_null(self::$registryInstances[$key])) {
                        // Not yet, so create one
-                       self::$registryInstance = new ???Registry();
+                       self::$registryInstances[$key] = new ???Registry();
                }
 
                // Return the instance
-               return self::$registryInstance;
+               return self::$registryInstances[$key];
        }
 
 }
index 1cedaab0c233b6eafabe295c18b38b89fe2d4004..b334bfae099834a4e6eccb4dcbb507e8c2e3a279 100644 (file)
@@ -4,20 +4,21 @@ namespace Org\Mxchange\CoreFramework\Registry;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Traits\Iterator\IteratorTrait;
 
 // Import SPL stuff
 use \InvalidArgumentExeption;
 use \IteratorAggregate;
+use \UnexpectedValueException;
 
 /**
  * A general Registry
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -51,11 +52,14 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
 
                // Init generic arrays
                $this->initGenericArrayGroup('registry', 'generic');
-               $this->initGenericArrayGroup('registry', 'instance');
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-REGISTRY: EXIT!');
        }
 
        /**
@@ -65,57 +69,29 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
         * @return      $iteratorInstance       An instance of a Iterator class
         */
        public function getIterator (array $onlyRegistries = []) {
+               // Get iterator
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: onlyRegistries()=%d - CALLED!', count($onlyRegistries)));
+               $iteratorInstance = $this->getIteratorInstance();
+
                // Is it set?
-               if (is_null($this->getIteratorInstance())) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: iteratorInstance[]=%s', gettype($iteratorInstance)));
+               if (is_null($iteratorInstance)) {
                        // Then instance it
                        $iteratorInstance = ObjectFactory::createObjectByConfiguredName('registry_iterator_class', [$this]);
 
                        // ... and set it here
                        $this->setIteratorInstance($iteratorInstance);
-               } else {
-                       // Use set iterator
-                       $iteratorInstance = $this->getIteratorInstance();
                }
 
                // Init iterator instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: Invoking iteratorInstance->initIterator(onlyRegistries()=%d) ...', count($onlyRegistries)));
                $iteratorInstance->initIterator($onlyRegistries);
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: iteratorInstance=%s - EXIT!', $iteratorInstance->__toString()));
                return $iteratorInstance;
        }
 
-       /**
-        * Checks whether an instance key was found
-        *
-        * @param       $instanceKey    The key holding an instance in registry
-        * @return      $exists                 Whether the key exists in registry
-        */
-       public function instanceExists (string $instanceKey) {
-               // Does this key exists?
-               $exists = $this->isGenericArrayKeySet('registry', 'instance', $instanceKey);
-
-               // Return the result
-               return $exists;
-       }
-
-       /**
-        * Adds/overwrites a new instance to the registry at the given key
-        *
-        * @param       $instanceKey            The key to identify the instance
-        * @param       $objectInstance         An instance we shall store
-        * @return      void
-        */
-       public function addInstance (string $instanceKey, Registerable $objectInstance) {
-               // Validate parameter
-               if (empty($instanceKey)) {
-                       // Throw IAE
-                       throw new InvalidArgumentExeption('Parameter "instanceKey" is empty');
-               }
-
-               // Set entry in generic array
-               $this->setGenericArrayKey('registry', 'instance', $instanceKey, $objectInstance);
-       }
-
        /**
         * Getter for whole generic registry
         *
@@ -125,15 +101,6 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
                return $this->getGenericSubArray('registry', 'generic');
        }
 
-       /**
-        * Getter for whole instance registry
-        *
-        * @return      $instanceRegistry       The whole instance registry array
-        */
-       public final function getInstanceRegistry () {
-               return $this->getGenericSubArray('registry', 'instance');
-       }
-
        /**
         * Adds a new entry to the given list name. If you want to add objects
         * please use addInstance() and getInstance() instead.
@@ -141,10 +108,22 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
         * @param       $key    The key to identify the whole list
         * @param       $value  The value to be stored
         * @return      void
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public final function addEntry (string $key, $value) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: key=%s,value[]=%s - CALLED!', $key, gettype($value)));
+               if (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentExeption('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Push it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: Invoking this->pushValueToGenericArrayKey(registry,generic,%s,value[]=%s) ...', $key, gettype($value)));
                $this->pushValueToGenericArrayKey('registry', 'generic', $key, $value);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-REGISTRY: EXIT!');
        }
 
        /**
@@ -152,18 +131,30 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
         *
         * @param       $key    Key
         * @return      $entries        An array with entries from this registry
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
         */
        public final function getEntries (string $key = NULL) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: key[%s]=%s - CALLED!', gettype($key), $key));
+               if (!is_null($key) && empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentExeption('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Default is whole array
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-REGISTRY: Invoking this->getGenericArray(registry) ...');
                $entries = $this->getGenericArray('registry');
 
                // Is $key set?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: key[]=%s,entries()=%d', $key, count($entries)));
                if (!is_null($key)) {
                        // Then use this entry
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: Invoking this->getGenericArrayKey(registry,generic,%s) ...', $key));
                        $entries = $this->getGenericArrayKey('registry', 'generic', $key);
                }
 
                // Return the array
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: entries()=%d - EXIT!', count($entries)));
                return $entries;
        }
 
@@ -173,32 +164,48 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
         * @param       $arrayKey       The array (key) to look in
         * @param       $lookFor        The key to look for
         * @return      $entry          An array with all keys
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
+        * @throws      UnexpectedValueException        If $value3 is not an array
         */
        public function getArrayFromKey (string $arrayKey, string $lookFor) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: arrayKey=%s,lookFor=%s - CALLED!', $arrayKey, $lookFor));
+               if (empty($arrayKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentExeption('Parameter "arrayKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($lookFor)) {
+                       // Throw IAE
+                       throw new InvalidArgumentExeption('Parameter "lookFor" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Init array
                $entry = [];
 
                // "Walk" over all entries
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY: Checking arrayKey=' . $arrayKey . ',lookFor=' . $lookFor);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: Checking arrayKey=%s,lookFor=%s', $arrayKey, $lookFor));
                foreach ($this->getEntries($arrayKey) as $key => $value) {
                        // If $value matches the $lookFor, we need to look for more entries for this!
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY: Checking key=' . $key . ',value=' . $value . ',lookFor=' . $lookFor);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: Checking key=%s,value=%s,lookFor=%s', $key, $value, $lookFor));
                        if ($lookFor == $value) {
                                // Look for more entries
                                foreach ($this->getEntries() as $key2 => $value2) {
                                        // Now "walk" through all entries, if an array is returned
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: key2=%s,value2[]=%s', $key2, gettype($value2)));
                                        if (is_array($value2)) {
                                                // "Walk" through all of them
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY: Checking key2=' . $key2 . ',value2()=' . count($value2) . ',lookFor=' . $lookFor);
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: Checking key2=%s,value2()=%s,lookFor=%s', $key2, count($value2), $lookFor));
                                                foreach ($value2 as $key3 => $value3) {
                                                        // $value3 needs to be an array
-                                                       assert(is_array($value3));
+                                                       if (!is_array($value3)) {
+                                                               // Throw exception
+                                                               throw new UnexpectedValueException(sprintf('arrayKey=%s,key=%s,value=%s,key2=%s,key3=%s has unexpected value3[]=%s', $arrayKey, $key, $value, $key2, $key3, gettype($value3)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+                                                       }
 
                                                        // Both keys must match!
-                                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY: Checking key=' . $key . ',key3=' . $key3 . ',isset()=' . isset($value3[$key]) . ' ...');
+                                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: Checking key=%s,key3=%s,isset()=%s ...', $key, $key3, intval(isset($value3[$key]))));
                                                        if (($key == $key3) || (isset($value3[$key]))) {
                                                                // Then add it
-                                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY: Adding ' . $value3[$key] . ' ...');
+                                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-REGISTRY: Adding value3[%s]=%s ...', $key, $value3[$key]));
                                                                $entry[$key3] = $value3[$key];
                                                        }
                                                }
@@ -206,36 +213,16 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
                                }
 
                                // Skip further lookups
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('BASE-REGISTRY: BREAK!');
                                break;
                        }
                }
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY: Returning entry(' . count($entry) . ')=' . print_r($entry, true));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: entry()=%d - EXIT!', count($entry)));
                return $entry;
        }
 
-       /**
-        * Gets a registered instance or null if not found
-        *
-        * @param       $instanceKey            The key to identify the instance
-        * @return      $objectInstance         An instance we shall store
-        * @throws      NullPointerException    If the requested key is not found
-        */
-       public function getInstance (string $instanceKey) {
-               // Is the instance there?
-               if (!$this->instanceExists($instanceKey)) {
-                       // This might happen if a non-registered key was requested
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-               }
-
-               // Get the instance
-               $objectInstance = $this->getGenericArrayKey('registry', 'instance', $instanceKey);
-
-               // Return the result
-               return $objectInstance;
-       }
-
        /**
         * "Getter" for a registry key for given prefix and array. This method
         * calls implode() to get a suitable key. This method does not care about
@@ -246,10 +233,21 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
         * @return      $registryKey    A registry key
         */
        public static function getRegistryKeyFromArray (string $prefix, array $data) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: prefix=%s,data()=%d - CALLED!', $prefix, count($data)));
+               if (empty($prefix)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "prefix" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (count($data) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "data" is an empty array', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // "Generate" the key
                $registryKey = $prefix . self::REGISTRY_KEY_GLUE . implode(self::REGISTRY_KEY_GLUE, $data);
 
                // Return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: registryKey=%s - EXIT!', $registryKey));
                return $registryKey;
        }
 
index a5080482b8f0997ee0c122d38e165deee44e44f5..d5f96b20fe978fb337e890aa60b6c1526ac7dfc0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 59c653aa6943ccbbbc76d6567f9bce1c3d944ec5..c40b19a893df221e645ba2856bc8041a173e312b 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Registry\Upgrade\Format\Lfdb;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
 use Org\Mxchange\CoreFramework\Upgrade\Format\Database\UpgradeableDatabaseFormat;
 use Org\Mxchange\CoreFramework\Upgrade\Format\RegisterableFormatUpgrade;
@@ -12,7 +13,7 @@ use Org\Mxchange\CoreFramework\Upgrade\Format\RegisterableFormatUpgrade;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -70,7 +71,7 @@ class LocalFileDatabaseFormatUpgradeRegistry extends BaseRegistry implements Reg
         * @todo        0% done
         */
        public function registerFormatUpgrader (UpgradeableDatabaseFormat $upgradeInstance) {
-               $this->partialStub();
+               DebugMiddleware::getSelfInstance()->partialStub();
        }
 
 }
index 3a0bad5ad3281acdef01c98b3e03fb0d0164c029..f5ce8237c4882baaedd9248257f02d551b2382c1 100644 (file)
@@ -2,13 +2,16 @@
 // Own namespace
 namespace Org\Mxchange\CoreFramework\Registry;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+
 /**
  * A registry for several data types and objects. Objects should be added by
  * addInstance() and therefore must implement the interface Registerable.
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -45,17 +48,28 @@ class GenericRegistry extends BaseRegistry implements Register {
         * Singleton getter for self instance. This class has no factory pattern
         * because here is no need for special parameters.
         *
+        * @param       $key    Key for for this instance
         * @return      $registryInstance       Instance of this class
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
-       public static final function getRegistry () {
+       public static final function getRegistry (string $key) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: key=%s - CALLED!', $key));
+               if (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is an instance there?
-               if (is_null(self::$registryInstance)) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('OBJECT-REGISTRY: self::registryInstance[%s]?=%d', $key, intval(isset((self::$registryInstances[$key])))));
+               if (!isset(self::$registryInstances[$key])) {
                        // Not yet, so create one
-                       self::$registryInstance = new GenericRegistry();
+                       self::$registryInstances[$key] = new ObjectRegistry();
                }
 
                // Return the instance
-               return self::$registryInstance;
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: self::registryInstance[%s]=%s - EXIT!', $key, self::$registryInstances[$key]->__toString()));
+               return self::$registryInstances[$key];
        }
 
 }
diff --git a/framework/main/classes/registry/object/class_ObjectRegistry.php b/framework/main/classes/registry/object/class_ObjectRegistry.php
new file mode 100644 (file)
index 0000000..0d01db6
--- /dev/null
@@ -0,0 +1,178 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Registry\Object;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A registry for several data types and objects. Objects should be added by
+ * addInstance() and therefore must implement the interface Registerable.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ObjectRegistry extends BaseRegistry implements ObjectRegister {
+       /**
+        * Instances of this class
+        */
+       private static $registryInstances = [];
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       private function __construct () {
+               // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: CONSTRUCTED!');
+               parent::__construct(__CLASS__);
+
+               // Init own array
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: Invoking this->initGenericArrayGroup(registry,instance) ...');
+               $this->initGenericArrayGroup('registry', 'instance');
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: EXIT!');
+       }
+
+       /**
+        * Singleton getter for self instance. This class has no factory pattern
+        * because here is no need for special parameters.
+        *
+        * @param       $key    Key for for this instance
+        * @return      $registryInstance       Instance of this class
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        */
+       public static final function getRegistry (string $key) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: key=%s - CALLED!', $key));
+               if (empty($key)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Is an instance there?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('OBJECT-REGISTRY: self::registryInstance[%s]?=%d', $key, intval(isset(self::$registryInstances[$key]))));
+               if (!isset(self::$registryInstances[$key])) {
+                       // Not yet, so create one
+                       self::$registryInstances[$key] = new ObjectRegistry();
+               }
+
+               // Return the instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: self::registryInstance[%s]=%s - EXIT!', $key, self::$registryInstances[$key]->__toString()));
+               return self::$registryInstances[$key];
+       }
+
+       /**
+        * Checks whether an instance key was found
+        *
+        * @param       $instanceKey    The key holding an instance in registry
+        * @return      $exists                 Whether the key exists in registry
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
+        */
+       public function instanceExists (string $instanceKey) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: instanceKey=%s - CALLED!', $instanceKey));
+               if (empty($instanceKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Does this key exists?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->isGenericArrayKeySet(registry, instance, %s) ...', $instanceKey));
+               $exists = $this->isGenericArrayKeySet('registry', 'instance', $instanceKey);
+
+               // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: exists=%d - EXIT!', intval($exists)));
+               return $exists;
+       }
+
+       /**
+        * Getter for whole instance registry
+        *
+        * @return      $instanceRegistry       The whole instance registry array
+        */
+       public final function getInstanceRegistry () {
+               return $this->getGenericSubArray('registry', 'instance');
+       }
+
+       /**
+        * Adds/overwrites a new instance to the registry at the given key
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @param       $objectInstance         An instance we shall store
+        * @return      void
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
+        */
+       public function addInstance (string $instanceKey, Registerable $objectInstance) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: instanceKey=%s,objectInstance=%s - CALLED!', $instanceKey, $objectInstance->__toString()));
+               if (empty($instanceKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentExeption('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Set entry in generic array
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->setGenericArrayKey(registry,instance,%s,%s) ...', $instanceKey, $objectInstance->__toString()));
+               $this->setGenericArrayKey('registry', 'instance', $instanceKey, $objectInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: EXIT!');
+       }
+
+       /**
+        * Gets a registered instance or null if not found
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @return      $objectInstance         An instance we shall store
+        * @throws      InvalidArgumentException        If a paramter has an invalid value
+        * @throws      NullPointerException    If the requested key is not found
+        */
+       public function getInstance (string $instanceKey) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: instanceKey=%s - CALLED!', $instanceKey));
+               if (empty($instanceKey)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Is the instance there?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->instanceExists(%s) ...', $instanceKey));
+               if (!$this->instanceExists($instanceKey)) {
+                       // This might happen if a non-registered key was requested
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
+               }
+
+               // Get the instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->getGenericArrayKey(registry,instance,%s) ...', $instanceKey));
+               $objectInstance = $this->getGenericArrayKey('registry', 'instance', $instanceKey);
+
+               // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: objectInstance=%s - EXIT!', $objectInstance->__toString()));
+               return $objectInstance;
+       }
+
+}
index ecbb34522ff2e6c4d162f3314e20fb43ec9b7677..fbdd82ef6b5f1fc706cc4926ed9f84a58ede9944 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Registry\Register;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 57a8e151d7dc421281dd3b6b56e1734a8b9da533..c4ab6a908ef0a39f616b572762879d4d5aefcada 100644 (file)
@@ -2,12 +2,15 @@
 // Own namespace
 namespace Org\Mxchange\CoreFramework\Request;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+
 /**
  * A concrete request class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -58,7 +61,7 @@ class ???Request extends BaseRequest implements Requestable {
         * @todo        Needs to be implemented
         */
        protected function prepareRequestData () {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
        /**
@@ -68,7 +71,7 @@ class ???Request extends BaseRequest implements Requestable {
         * @return      $headerValue    Value of the header or 'null' if not found
         */
        public function getHeaderElement ($headerName) {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
        /**
@@ -77,7 +80,7 @@ class ???Request extends BaseRequest implements Requestable {
         * @return      $requestMethod  Used request method
         */
        public final function getRequestMethod () {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
                return $_SERVER['REQUEST_METHOD'];
        }
 
@@ -88,7 +91,7 @@ class ???Request extends BaseRequest implements Requestable {
         * @return      $cookieValue    Value of cookie or null if not found
         */
        public final function readCookie ($cookieName) {
-               $this->partialStub("Please implement this method.");
+               DebugMiddleware::getSelfInstance()->partialStub("Please implement this method.");
        }
 
 }
index 6736fea140ed80a10ad7ab3c9abbbbd751b09b10..26b18d891cf7b85c63f29777874582d94ea2449f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -38,7 +38,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * valid so make sure your intercepting filters sets this attribute to false
         * when they need to intercept the data flow.
         */
-       private $requestIsValid = true;
+       private $isRequestValid = true;
 
        /**
         * Protected constructor
@@ -119,22 +119,22 @@ abstract class BaseRequest extends BaseFrameworkSystem {
        }
 
        /**
-        * Sets whether the request was valid (default: true)
+        * Sets whether the request was valid
         *
         * @param       $isValid        Whether the request is valid
         * @return      void
         */
-       public final function requestIsValid (bool $isValid = true) {
-               $this->requestIsValid = $isValid;
+       public final function setIsRequestValid (bool $isValid) {
+               $this->isRequestValid = $isValid;
        }
 
        /**
         * Returns whether this request is valid
         *
-        * @return      $requestIsValid         Whether this request is valid
+        * @return      $isRequestValid         Whether this request is valid
         */
        public final function isRequestValid () {
-               return $this->requestIsValid;
+               return $this->isRequestValid;
        }
 
 }
index 2bdf7ea1bc1e30936de3c84feeccce36d047fa01..065430a11a3db641827942db900cf70d1f4cefd5 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Request;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 
@@ -11,7 +12,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -107,7 +108,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         */
        public function getHeaderElement (string $headerName) {
                // Console doesn't have any headers
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -129,7 +130,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         */
        public final function readCookie (string $cookieName) {
                // There are no cookies on console
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -140,7 +141,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         */
        public function isGetRequestMethod () {
                // Not support method
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -151,7 +152,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         */
        public function isHeadRequestMethod () {
                // Not support method
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -162,7 +163,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         */
        public function isPostRequestMethod () {
                // Not support method
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 86666802069124801ec78e739f26f957630f0913..2fdb53127153f83640430d24d13c8005d1a49811 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Move out the cookie part to a seperate class, e.g. Cookie
index 2832256d67a66582088834eeeb9797a6bfbb6f5e..a266d2e1d19852e7867a5607674937ff196cdb25 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Action;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Resolver\BaseResolver;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
@@ -15,7 +16,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -80,10 +81,10 @@ abstract class BaseActionResolver extends BaseResolver {
                // Is a action set?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($actionName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "actionName" is empty');
+                       throw new InvalidArgumentException('Parameter "actionName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Create class name
index 2c36a2cc83017d26751ed76bc7faaf720c6332b5..ad70b5b69080ccd9176a6963bfdf68d23ecea31e 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Action;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 
 // Import SPL stuff
@@ -14,7 +15,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -65,7 +66,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver {
                // Is the variable $actionName set and the action is valid?
                if (empty($actionName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "actionName" is empty');
+                       throw new InvalidArgumentException('Parameter "actionName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($resolverInstance->isActionValid($actionName) === false) {
                        // Invalid action found
                        throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
index 9bbe3dfb8a58e26285ca1a072dc3e43ae011e9ed..01f71e090fef9bfb70e04588def0c0671c7e372e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index aebdd7a02a3ae036073483f0db6f8daff3b75944..20ca0f72543f2527df96b39c9495136aabe0c63d 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a49cd88ba5cb0c01d984534445a75534d303d2bf..2a231dc0ee4e98c0fcda71db7f27b1fd268d795a 100644 (file)
@@ -7,6 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\BaseResolver;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
@@ -20,7 +21,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -142,7 +143,7 @@ abstract class BaseCommandResolver extends BaseResolver {
                // And validate it
                if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
                        // This command has an invalid instance!
-                       throw new UnexpectedValueException(sprintf('commandInstance for commandName=%s is not object (%s) or does not implement Commandable.', $commandName, gettype($commandInstance)), self::EXCEPTION_INVALID_COMMAND);
+                       throw new UnexpectedValueException(sprintf('commandInstance for commandName=%s is not object (%s) or does not implement Commandable.', $commandName, gettype($commandInstance)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Set last command
@@ -167,10 +168,10 @@ abstract class BaseCommandResolver extends BaseResolver {
                // Is a action set?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($commandName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "commandName" is empty');
+                       throw new InvalidArgumentException('Parameter "commandName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Initiate the instance variable
@@ -211,10 +212,10 @@ abstract class BaseCommandResolver extends BaseResolver {
                // Is namespace and command name set?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($commandName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "commandName" is empty');
+                       throw new InvalidArgumentException('Parameter "commandName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // By default nothing shall be valid
index 46095e2c9731982bc5589218b6c0fdfa03f4898d..11833a18a3e4779865941edb923ca2dfc197d66c 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Command;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 
 // Import SPL stuff
@@ -15,7 +16,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -62,10 +63,10 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol
                // Is the variable $commandName set and the command is valid?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($commandName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "commandName" is empty');
+                       throw new InvalidArgumentException('Parameter "commandName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$resolverInstance->isCommandValid($namespace, $commandName)) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
index ada5cc4734cdbee18c9343a51a53a905d343749d..ecd1ff7af5d4cd1387e9384457441389f9b1c69b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 78229a10dde77e58074fff4018c0fa2e04b6db5e..46ee3eae05d4350d553cc1be9b7abef41a4e89d7 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Command;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 
 // Import SPL stuff
@@ -14,7 +15,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -65,7 +66,7 @@ class HtmlCommandResolver extends BaseCommandResolver implements CommandResolver
                // Is the variable $commandName set and the command is valid?
                if (empty($commandName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "commandName" is empty');
+                       throw new InvalidArgumentException('Parameter "commandName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // Invalid command found
                        // @TODO Missing namespace!
index c799155e19b3ed8b7c294da166e5f52961d6f991..c74f08b04179322a883c5aa7cd5d1d0ff798d6de 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Command;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
 
 // Import SPL stuff
@@ -14,7 +15,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -65,7 +66,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                // Is the variable $commandName set and the command is valid?
                if (empty($commandName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "commandName" is empty');
+                       throw new InvalidArgumentException('Parameter "commandName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // @TODO Missing namespace!
                        // Invalid command found
index 91676a07c74dc71f83d42d9971cbc79c539305d1..f60774d82ef0c7b4524b259075f05911fed76886 100644 (file)
@@ -8,8 +8,8 @@ use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Controller\DefaultControllerException;
 use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Resolver\BaseResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
@@ -22,7 +22,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -163,10 +163,10 @@ abstract class BaseControllerResolver extends BaseResolver {
                // Is a action set?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($controllerName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "controllerName" is empty');
+                       throw new InvalidArgumentException('Parameter "controllerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // By default nothing shall be valid
index 8312593596bd7555bbf3295c8a8ceb6d351b5273..36e32e05059914ee687b95a874162e738f41c5ec 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Controller;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\BaseController;
 use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 
@@ -16,7 +17,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -63,10 +64,10 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro
                // Is the variable $controllerName set and the controller is valid?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($controllerName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "controllerName" is empty');
+                       throw new InvalidArgumentException('Parameter "controllerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
index 4b359d619c65a91b108bebeb41fff13be7376f7e..81cbd0de452abbfe3769a1d7c88d37cecab2785f 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Controller;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\BaseController;
 use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 
@@ -16,7 +17,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -63,10 +64,10 @@ class HtmlControllerResolver extends BaseControllerResolver implements Controlle
                // Are all parameter set and the controller is valid?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($controllerName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "controllerName" is empty');
+                       throw new InvalidArgumentException('Parameter "controllerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
index a18464e0c77d271743d8cc03edb65c1700df74cd..0c878929a87bf628e0c369056dde0ceff4a54891 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Resolver\Controller;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\BaseController;
 use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 
@@ -16,7 +17,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -63,10 +64,10 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
                // Are all parameter set and the controller is valid?
                if (empty($namespace)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "namespace" is empty');
+                       throw new InvalidArgumentException('Parameter "namespace" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (empty($controllerName)) {
                        // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "controllerName" is empty');
+                       throw new InvalidArgumentException('Parameter "controllerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
index afd4e35361d26960f8b56bc3fafe8fc3db3a8e2e..33f6efec9746289e7ca8d09f6fae5dadf51b3898 100644 (file)
@@ -6,14 +6,13 @@ namespace Org\Mxchange\CoreFramework\Response;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 
 /**
  * A generic request class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index efa31fe76291c7cfb752821f57551606c909ef88..4cb10564e10ca4a2ec8bc90b35ab3a30490bc106 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Response;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
 /**
@@ -11,7 +12,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -70,7 +71,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         */
        public function addCookie (string $cookieName, $cookieValue, bool $encrypted = FALSE, int $expires = NULL) {
                //* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
-               $this->partialStub('Naturally unimplemented in console response.');
+               DebugMiddleware::getSelfInstance()->partialStub('Naturally unimplemented in console response.');
        }
 
        /**
@@ -82,7 +83,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         * @throws      ResponseHeadersAlreadySentException             If headers are already sent
         */
        public function redirectToConfiguredUrl ($configEntry) {
-               $this->partialStub('Naturally unimplemented in console response.');
+               DebugMiddleware::getSelfInstance()->partialStub('Naturally unimplemented in console response.');
        }
 
        /**
@@ -92,7 +93,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         * @return      void
         */
        public function expireCookie ($cookieName) {
-               $this->partialStub('Naturally unimplemented in console response.');
+               DebugMiddleware::getSelfInstance()->partialStub('Naturally unimplemented in console response.');
        }
 
        /**
@@ -102,7 +103,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         * @return      void
         */
        public function refreshCookie ($cookieName) {
-               $this->partialStub('Naturally unimplemented in console response.');
+               DebugMiddleware::getSelfInstance()->partialStub('Naturally unimplemented in console response.');
        }
 
        /**
@@ -114,7 +115,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         * @throws      ResponseHeadersAlreadySentException             Thrown if headers are already sent
         */
        public function flushBuffer ($force = false) {
-               $this->partialStub('Please implement this class.');
+               DebugMiddleware::getSelfInstance()->partialStub('Please implement this class.');
        }
 
 }
index 0a224f25723a2a6d9e5c243c580e49c9b8836952..5c5beed73b33693a84d647b14b431f1f6f61603d 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Response;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
 /**
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -86,7 +86,7 @@ class HtmlResponse extends BaseResponse implements Responseable {
                // Shall we encrypt the cookie?
                if ($encrypted) {
                        // Unsupported at the moment
-                       $this->partialStub('Encryption is unsupported at the moment.');
+                       DebugMiddleware::getSelfInstance()->partialStub('Encryption is unsupported at the moment.');
                }
 
                // For slow browsers set the cookie array element first
index 87acbf7e52c212690ad96fec789e0774b44a6812..783c84894f77d6cbcaa2c5f0f8267865e7274ea5 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Image\BaseImage;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
 /**
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -109,7 +109,7 @@ class ImageResponse extends BaseResponse implements Responseable {
                // Shall we encrypt the cookie?
                if ($encrypted) {
                        // Unsupported at the moment
-                       $this->partialStub('Encryption is unsupported at the moment.');
+                       DebugMiddleware::getSelfInstance()->partialStub('Encryption is unsupported at the moment.');
                }
 
                // For slow browsers set the cookie array element first
index 91c40bb6968a2375ac00baac7d94b6027e9dc121..7b83f9d053a864e187a9defee7266666a4f33760 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -119,7 +119,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
                $serverIp = 'cluster';
 
                // Do we have a single server?
-               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('is_single_server') == 'Y') {
+               if (FrameworkBootstrap::getConfigurationInstance()->isEnabled('single_server')) {
                        // Then use that IP for extra security
                        $serverIp = FrameworkBootstrap::detectServerAddress();
                }
@@ -214,7 +214,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
                $key = md5($this->getExtraSalt());
 
                // Get key
-               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('crypt_fixed_salt') == 'Y') {
+               if (FrameworkBootstrap::getConfigurationInstance()->isEnabled('crypt_fixed_salt')) {
                        $key = md5($this->getFixedSalt());
                }
 
index 2a1bd34cf29a0339f33f496ffff93818899640f2..b8e5aa096b202144ac1750f549d4edcf26ab2b2e 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Stack\!!!;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Stack\BaseStacker;
 use Org\Mxchange\CoreFramework\Stack\Stackable;
 
@@ -11,7 +12,7 @@ use Org\Mxchange\CoreFramework\Stack\Stackable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -65,7 +66,7 @@ class ???Stacker extends BaseStacker implements Stackable {
         * @throws      StackerFullException    If the stack is full
         */
        public function pushNamed ($stackerName, $value) {
-               $this->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
+               DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
        }
 
        /**
@@ -77,7 +78,7 @@ class ???Stacker extends BaseStacker implements Stackable {
         * @throws      EmptyStackerException   If the named stacker is empty
         */
        public function popNamed ($stackerName) {
-               $this->partialStub('stackerName=' . $stackerName);
+               DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName);
        }
 
        /**
@@ -89,7 +90,7 @@ class ???Stacker extends BaseStacker implements Stackable {
         * @throws      EmptyStackerException   If the named stacker is empty
         */
        public function getNamed ($stackerName) {
-               $this->partialStub('stackerName=' . $stackerName);
+               DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName);
        }
 
 }
index b9f80972e0f98f9643cde122a86da2aeb2b19103..cdfa4bc42426a46a7e0210fba4ce4689e83db7b7 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Stack;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
@@ -15,7 +16,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -33,12 +34,6 @@ use \InvalidArgumentException;
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 abstract class BaseStacker extends BaseFrameworkSystem {
-       // Exception codes
-       const EXCEPTION_STACKER_ALREADY_INITIALIZED = 0x050;
-       const EXCEPTION_STACKER_IS_FULL             = 0x051;
-       const EXCEPTION_NO_STACKER_FOUND            = 0x052;
-       const EXCEPTION_STACKER_IS_EMPTY            = 0x053;
-
        /**
         * Array "caches" configuration entries for saving "expensive" method
         * invocations
@@ -70,10 +65,10 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s,forceReInit=%d - CALLED!', $stackerName, intval($forceReInit)));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (($forceReInit === false) && ($this->isStackInitialized($stackerName))) {
                        // Then throw the exception
-                       throw new BadMethodCallException(array($this, $stackerName, $forceReInit), self::EXCEPTION_STACKER_ALREADY_INITIALIZED);
+                       throw new BadMethodCallException(array($this, $stackerName, $forceReInit), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Initialize the given stack and "cache" configuration entry
@@ -95,13 +90,13 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stacks()=%d,forceReInit=%d - CALLED!', count($stacks), intval($forceReInit)));
                if (count($stacks) == 0) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Array "stacks" is empty');
+                       throw new InvalidArgumentException('Array "stacks" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // "Walk" through all (more will be added as needed
                foreach ($stacks as $stackerName) {
                        // Init this stack
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling this->initStack(%s,%d) ...', $stackerName, intval($forceReInit)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking this->initStack(%s,%d) ...', $stackerName, intval($forceReInit)));
                        $this->initStack($stackerName, $forceReInit);
                }
 
@@ -121,7 +116,7 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Is is there?
@@ -145,10 +140,10 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // So, is the stack full?
@@ -172,10 +167,10 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // So, is the stack empty?
@@ -199,10 +194,10 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now, count the array of entries
@@ -228,13 +223,13 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s,value[]=%s - CALLED!', $stackerName, gettype($value)));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ($this->isStackFull($stackerName)) {
                        // Stacker is full
-                       throw new FullStackerException([$this, $stackerName, $value], self::EXCEPTION_STACKER_IS_FULL);
+                       throw new BadMethodCallException(sprintf('stackerName=%s is full but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now add the value to the stack
@@ -258,17 +253,20 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
+               // Calculate last index
+               $lastIndex = $this->getStackCount($stackerName) - 1;
+
                // Now get the last value
-               $value = $this->getGenericArrayElement('stacks', $stackerName, 'entries', $this->getStackCount($stackerName) - 1);
+               $value = $this->getGenericArrayElement('stacks', $stackerName, 'entries', $lastIndex);
 
                // Return it
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: value[]=%s - EXIT!', gettype($value)));
@@ -289,17 +287,17 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now get the first value
-               $value = $this->getGenericArrayElement('stacks', $stackerName, 'entries', 0);
+               $value = $this->getGenericArrayElement('stacks', $stackerName, 'entries', '0');
 
                // Return it
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: value[]=%s - EXIT!', gettype($value)));
@@ -320,13 +318,13 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException(sprintf('stackerName=%s is empty but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now, remove the last entry, we don't care about the return value here, see elseif() block above
@@ -351,13 +349,13 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException(sprintf('stackerName=%s not yet initialized but method called.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now, remove the last entry, we don't care about the return value here, see elseif() block above
index 4aab590ecbec7894d4929f5dbdb5bd57b1090cc7..2ab3ec5f632c3f9b0f2784cc27a87cf713be5962 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Mxchange\CoreFramework\Stack;
 
+// Import framework-specific stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+
 // Import SPL stuff
 use \InvalidArgumentException;
 
@@ -10,7 +13,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -61,18 +64,18 @@ class FiFoStacker extends BaseStacker implements Stackable {
         * @param       $value                  Value to push on it
         * @return      void
         * @throws      InvalidArgumentException        If a parameter is invalid
-        * @throws      StackerFullException    If the stack is full
+        * @throws      BadMethodCallException  If the stack is full
         */
        public function pushNamed (string $stackerName, $value) {
                // Validate parameter
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s,value[]=%s - CALLED!', $stackerName, gettype($value)));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
                parent::addValueToStack($stackerName, $value);
 
                // Trace message
@@ -93,15 +96,15 @@ class FiFoStacker extends BaseStacker implements Stackable {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get the value
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling this->getNamed(%s) ...', $stackerName));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking this->getNamed(%s) ...', $stackerName));
                $value = $this->getNamed($stackerName);
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling parent::popFirst(%s) ...', $stackerName));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking parent::popFirst(%s) ...', $stackerName));
                parent::popFirst($stackerName);
 
                // Return the value
@@ -123,11 +126,11 @@ class FiFoStacker extends BaseStacker implements Stackable {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling parent::getFirstValue(%s) ...', $stackerName));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking parent::getFirstValue(%s) ...', $stackerName));
                $value = parent::getFirstValue($stackerName);
 
                // Return value
index 0795f788fe4e92f1dd2c4b7819d212c5d72b52e2..091d752601158452d3ce2a9ef31aa9ecb085917a 100644 (file)
@@ -1,10 +1,13 @@
 <?php
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+
 /**
  * A ??? file-based stack
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2022 Core Developer Team
+ * @copyright  Copyright (c) 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -58,7 +61,7 @@ class ???FileStack extends BaseFileStack implements StackableFile, Registerable
         * @throws      StackerFullException    If the stack is full
         */
        public function pushNamed ($stackerName, $value) {
-               $this->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
+               DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
        }
 
        /**
@@ -70,7 +73,7 @@ class ???FileStack extends BaseFileStack implements StackableFile, Registerable
         * @throws      EmptyStackerException   If the named stacker is empty
         */
        public function popNamed ($stackerName) {
-               $this->partialStub('stackerName=' . $stackerName);
+               DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName);
        }
 
        /**
@@ -82,7 +85,7 @@ class ???FileStack extends BaseFileStack implements StackableFile, Registerable
         * @throws      EmptyStackerException   If the named stacker is empty
         */
        public function getNamed ($stackerName) {
-               $this->partialStub('stackerName=' . $stackerName);
+               DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName);
        }
 
        /**
@@ -92,7 +95,7 @@ class ???FileStack extends BaseFileStack implements StackableFile, Registerable
         * @return      void
         */
        public function seek ($seekPosition) {
-               $this->partialStub('seekPosition=' . $seekPosition);
+               DebugMiddleware::getSelfInstance()->partialStub('seekPosition=' . $seekPosition);
        }
 
        /**
@@ -101,7 +104,7 @@ class ???FileStack extends BaseFileStack implements StackableFile, Registerable
         * @return      $size   Size (in bytes) of file
         */
        public function size () {
-               $this->partialStub();
+               DebugMiddleware::getSelfInstance()->partialStub();
        }
 
 }
index 6718eac25e97926c7df484b9a95dd372c9a362af..303caca77c7666d0f91e05b18640b50d3c199cc7 100644 (file)
@@ -7,7 +7,9 @@ use Org\Mxchange\CoreFramework\Factory\Stack\File\FileStackIndexFactory;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
 use Org\Mxchange\CoreFramework\Filesystem\File\BinaryFile;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Stack\BaseStacker;
 use Org\Mxchange\CoreFramework\Traits\Index\IndexableTrait;
 use Org\Mxchange\CoreFramework\Traits\Iterator\IteratorTrait;
@@ -24,7 +26,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -93,7 +95,7 @@ abstract class BaseFileStack extends BaseStacker {
                                strlen($data),
                                $data,
                                $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (empty(trim($data, chr(0)))) {
                        // Empty header, file is freshly pre-allocated
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Empty file header detected - EXIT!');
@@ -107,14 +109,14 @@ abstract class BaseFileStack extends BaseStacker {
                        throw new UnexpectedValueException(sprintf('data=%s does not have separator=0x%s at the end.',
                                $data,
                                dechex(BinaryFile::SEPARATOR_HEADER_ENTRIES)
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Okay, then remove it
                $data = substr($data, 0, -1);
 
                // And update seek position
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->updateSeekPosition();
 
                /*
@@ -127,7 +129,7 @@ abstract class BaseFileStack extends BaseStacker {
                $header = explode(chr(BinaryFile::SEPARATOR_HEADER_DATA), $data);
 
                // Map numeric indexes to associative indexes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
                $header = ArrayUtils::mapNumericKeysToAssociative($header, [
                        BinaryFile::HEADER_NAME_MAGIC,
                        BinaryFile::HEADER_NAME_TOTAL_ENTRIES,
@@ -143,7 +145,7 @@ abstract class BaseFileStack extends BaseStacker {
                                $data,
                                count($header),
                                BinaryFile::HEADER_STACK_ELEMENT_COUNT
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif ($header[BinaryFile::HEADER_NAME_MAGIC] != StackableFile::STACK_MAGIC) {
                        // Bad magic
                        throw new InvalidMagicException($data, self::EXCEPTION_BAD_MAGIC);
@@ -154,7 +156,7 @@ abstract class BaseFileStack extends BaseStacker {
                                strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]),
                                $header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES],
                                BinaryFile::LENGTH_COUNT
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (strlen($header[BinaryFile::HEADER_NAME_SEEK_POSITION]) != BinaryFile::LENGTH_POSITION) {
                        // Position length not valid
                        throw new UnexpectedValueException(sprintf('header[%s](%d)=%s is not expected %d length',
@@ -162,7 +164,7 @@ abstract class BaseFileStack extends BaseStacker {
                                strlen($header[BinaryFile::HEADER_NAME_SEEK_POSITION]),
                                $header[BinaryFile::HEADER_NAME_SEEK_POSITION],
                                BinaryFile::LENGTH_POSITION
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Decode count and seek position
@@ -205,7 +207,7 @@ abstract class BaseFileStack extends BaseStacker {
                );
 
                // Write it to disk (header is always at seek position 0)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling this->iteratorInstance->writeAtPosition(0, header=%s) ...', $header));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->iteratorInstance->writeAtPosition(0, header=%s) ...', $header));
                $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header);
 
                // Trace message
@@ -226,7 +228,7 @@ abstract class BaseFileStack extends BaseStacker {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: fileInfoInstance[%s]=%s,type=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance, $type));
                if (empty($type)) {
                        // Invalid parameter
-                       throw new InvalidArgumentException('Parameter "type" is empty');
+                       throw new InvalidArgumentException('Parameter "type" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get a stack file instance
@@ -253,7 +255,7 @@ abstract class BaseFileStack extends BaseStacker {
                $this->getIteratorInstance()->getBinaryFileInstance()->setHeaderSize($headerSize);
 
                // Init counters and gaps array
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->initCountersGapsArray() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->initCountersGapsArray() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->initCountersGapsArray();
 
                /*
@@ -270,7 +272,7 @@ abstract class BaseFileStack extends BaseStacker {
                // Is the file's header initialized?
                if (!$this->getIteratorInstance()->getBinaryFileInstance()->isFileHeaderInitialized()) {
                        // First pre-allocate a bit
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->preAllocateFile(file_stack) ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->preAllocateFile(file_stack) ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->preAllocateFile('file_stack');
 
                        // Then create file header
@@ -279,22 +281,22 @@ abstract class BaseFileStack extends BaseStacker {
                }
 
                // Load the file header
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->readStackHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->readStackHeader() ...');
                $this->readStackHeader();
 
                // Is the index loaded correctly, e.g. the stack file is just created?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->indexInstance->isIndexLoaded() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->indexInstance->isIndexLoaded() ...');
                if (!$this->getIndexInstance()->isIndexLoaded()) {
                        /*
                         * Something horrible has happened to the index as it should be
                         * loaded at this point. The stack's file structure then needs to
                         * be analyzed and the index rebuild.
                         */
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->analyzeFileStructure() ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->analyzeFileStructure() ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->analyzeFileStructure();
 
                        // Rebuild index from file
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling this->iteratorInstance->rebuildIndexFromStack(%s) ...', $this->__toString()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->iteratorInstance->rebuildIndexFromStack(%s) ...', $this->__toString()));
                        $this->getIndexInstance()->rebuildIndexFromStack($this);
                }
 
@@ -318,10 +320,10 @@ abstract class BaseFileStack extends BaseStacker {
                //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackerName=%s,value[%s]=%s', $stackerName, gettype($value), print_r($value, true)));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->isStackFull($stackerName)) {
                        // Stacker is full
-                       throw new FullStackerException([$this, $stackerName, $value], self::EXCEPTION_STACKER_IS_FULL);
+                       throw new BadMethodCallException(sprintf('stackerName=%s is full but method call.', $stackerName), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                } elseif (is_resource($value) || is_object($value)) {
                        // Not wanted type
                        throw new InvalidArgumentException(sprintf('value[]=%s is not supported', gettype($value)));
@@ -331,11 +333,12 @@ abstract class BaseFileStack extends BaseStacker {
                 * Now add the value to the file stack which returns gap position, a
                 * hash and length of the raw data.
                 */
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->iteratorInstance->binaryFileInstance->writeValueToFile(%s,value[]=%s) ...', $stackerName, gettype($value)));
                $data = $this->getIteratorInstance()->getBinaryFileInstance()->writeValueToFile($stackerName, $value);
 
                // Add the hash and gap position to the index
                //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: data=%s', print_r($data, true));
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling this->indexInstance->addHashedDataToIndex(%s,data()=%d) ...', $stackerName, count($data)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->indexInstance->addHashedDataToIndex(%s,data()=%d) ...', $stackerName, count($data)));
                $this->getIndexInstance()->addHashedDataToIndex($stackerName, $data);
 
                // Trace message
@@ -355,14 +358,14 @@ abstract class BaseFileStack extends BaseStacker {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException([$this, $stackerName], self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException([$this, $stackerName], FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now get the last value
-               /* NOISY-DEBUG: */ $this->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
+               /* NOISY-DEBUG: */ DebugMiddleware::getSelfInstance()->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
                $value = NULL;
 
                // Return it
@@ -383,14 +386,14 @@ abstract class BaseFileStack extends BaseStacker {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException([$this, $stackerName], self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException([$this, $stackerName], FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now get the first value
-               /* NOISY-DEBUG: */ $this->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
+               /* NOISY-DEBUG: */ DebugMiddleware::getSelfInstance()->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
                $value = NULL;
 
                // Return it
@@ -411,14 +414,14 @@ abstract class BaseFileStack extends BaseStacker {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException([$this, $stackerName], self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException([$this, $stackerName], FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now, remove the last entry, we don't care about the return value here, see elseif() block above
-               /* NOISY-DEBUG: */ $this->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
+               /* NOISY-DEBUG: */ DebugMiddleware::getSelfInstance()->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
                return NULL;
        }
 
@@ -435,14 +438,14 @@ abstract class BaseFileStack extends BaseStacker {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($this->isStackEmpty($stackerName)) {
                        // Throw an exception
-                       throw new BadMethodCallException([$this, $stackerName], self::EXCEPTION_STACKER_IS_EMPTY);
+                       throw new BadMethodCallException([$this, $stackerName], FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Now, remove the last entry, we don't care about the return value here, see elseif() block above
-               /* NOISY-DEBUG: */ $this->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
+               /* NOISY-DEBUG: */ DebugMiddleware::getSelfInstance()->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
                return NULL;
        }
 
@@ -458,11 +461,11 @@ abstract class BaseFileStack extends BaseStacker {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // @TODO Please implement this, returning false
-               /* NOISY-DEBUG: */ $this->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
+               /* NOISY-DEBUG: */ DebugMiddleware::getSelfInstance()->partialStub('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName);
                $isFull = false;
 
                // Return result
@@ -483,7 +486,7 @@ abstract class BaseFileStack extends BaseStacker {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // So, is the stack empty?
@@ -502,7 +505,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function isStackInitialized (string $stackerName) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -512,7 +515,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function isEndOfFileReached () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -566,7 +569,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function initCountersGapsArray () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -576,7 +579,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public final function getHeaderSize () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -587,7 +590,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public final function setHeaderSize (int $headerSize) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -597,7 +600,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public final function getHeader () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -608,7 +611,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public final function setHeader (array $header) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -618,7 +621,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function updateSeekPosition () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -628,7 +631,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public final function getCounter () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -642,7 +645,7 @@ abstract class BaseFileStack extends BaseStacker {
         */
        public function writeData (int $seekPosition, string $data, bool $flushHeader = true) {
                // Not supported
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -655,7 +658,7 @@ abstract class BaseFileStack extends BaseStacker {
         */
        public function writeAtPosition (int $seekPosition, string $dataStream) {
                // Not supported
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -667,7 +670,7 @@ abstract class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function writeValueToFile (string $stackName, $value) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -680,7 +683,7 @@ abstract class BaseFileStack extends BaseStacker {
         */
        public function searchNextGap (int $length) {
                // Not supported here
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getBinaryFileInstance()), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -705,10 +708,23 @@ abstract class BaseFileStack extends BaseStacker {
         * @param       $hash           Hash from encoded value
         * @param       $encoded        Encoded value to be written to the file
         * @return      $data           Gap position and length of the raw data
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function writeDataToFreeGap (string $stackName, string $hash, string $encoded) {
-               // Raw data been written to the file
+               // Check parameter
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: stackName=%s,hash{}=0x%s,encoded()=%d - CALLED!', $stackName, bin2hex($hash), strlen($encoded)));
+               if (empty($stackName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "stackName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($hash)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "hash" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($encoded)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "encoded" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Raw data been written to the file
                $rawData = sprintf('%s%s%s%s%s',
                        $stackName,
                        BinaryFile::SEPARATOR_GROUP_HASH,
@@ -729,7 +745,7 @@ abstract class BaseFileStack extends BaseStacker {
                                gettype($gapPosition),
                                $gapPosition,
                                $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
-                       ));
+                       ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                }
 
                // Then write the data at that gap
index ab0e6928e0dd5f598790afd210062cfb8b41ae46..3c291361d5ee1e1052c54bd75676bd8f10395c72 100644 (file)
@@ -4,6 +4,8 @@ namespace Org\Mxchange\CoreFramework\Stack\File;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Filesystem\Block\CalculatableBlock;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Stack\File\BaseFileStack;
 use Org\Mxchange\CoreFramework\Stack\File\StackableFile;
@@ -18,7 +20,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2022 Core Developer Team
+ * @copyright  Copyright (c) 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -59,14 +61,14 @@ class FiFoFileStack extends BaseFileStack implements StackableFile, Calculatable
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: fileInfoInstance[%s]=%s,type=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance, $type));
                if (empty($type)) {
                        // No empty type
-                       throw new InvalidArgumentException('Parameter "type" is empty');
+                       throw new InvalidArgumentException('Parameter "type" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get new instance
                $stackInstance = new FiFoFileStack();
 
                // Init this stack
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Calling stackInstance->initFileStack([%s]=%s,%s) ...', get_class($fileInfoInstance), $fileInfoInstance, $type));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Invoking stackInstance->initFileStack([%s]=%s,%s) ...', get_class($fileInfoInstance), $fileInfoInstance, $type));
                $stackInstance->initFileStack($fileInfoInstance, $type);
 
                // Return the prepared instance
@@ -81,21 +83,21 @@ class FiFoFileStack extends BaseFileStack implements StackableFile, Calculatable
         * @param       $value                  Value to push on it
         * @return      void
         * @throws      InvalidArgumentException        If a parameter is invalid
-        * @throws      StackerFullException    If the stack is full
+        * @throws      BadMethodCallException  If the stack is full
         */
        public function pushNamed (string $stackerName, $value) {
                // Validate parameter
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: stackerName=%s,value[]=%s - CALLED!', $stackerName, gettype($value)));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (is_object($value) || is_resource($value)) {
                        // Those types for $value are not allowed
                        throw new InvalidArgumentException(sprintf('value[]=%s is not valid', gettype($value)));
                }
 
                // Call the protected method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Calling parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Invoking parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
                parent::addValueToStack($stackerName, $value);
 
                // Trace message
@@ -116,7 +118,7 @@ class FiFoFileStack extends BaseFileStack implements StackableFile, Calculatable
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get the value
@@ -145,7 +147,7 @@ class FiFoFileStack extends BaseFileStack implements StackableFile, Calculatable
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call the protected method
@@ -174,7 +176,7 @@ class FiFoFileStack extends BaseFileStack implements StackableFile, Calculatable
                }
 
                // @TODO Unfinished method or invoke inner iterator's method?
-               $this->partialStub('seekPosition=' . $seekPosition);
+               DebugMiddleware::getSelfInstance()->partialStub('seekPosition=' . $seekPosition);
 
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FIFO-FILE-STACK: EXIT!');
index 090e721b498730748baecb54dc5feb95821f692a..5f5a5abc1dd00581809589bef12e9f66af7a75a2 100644 (file)
@@ -2,12 +2,15 @@
 // Own namespace
 namespace Org\Mxchange\CoreFramework\Stack;
 
+// Import framework-specific stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+
 /**
  * A FiLo Stacker class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -60,18 +63,18 @@ class FiLoStacker extends BaseStacker implements Stackable {
         * @param       $value                  Value to push on it
         * @return      void
         * @throws      InvalidArgumentException If a parameter is invalid
-        * @throws      StackerFullException    If the stack is full
+        * @throws      BadMethodCallException  If the stack is full
         */
        public function pushNamed (string $stackerName, $value) {
                // Validate parameter
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILO-FILE-STACK: stackerName=%s,value[]=%s - CALLED!', $stackerName, gettype($value)));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILO-FILE-STACK: Calling parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILO-FILE-STACK: Invoking parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
                parent::addValueToStack($stackerName, $value);
 
                // Trace message
@@ -92,7 +95,7 @@ class FiLoStacker extends BaseStacker implements Stackable {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILO-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get the value
@@ -122,7 +125,7 @@ class FiLoStacker extends BaseStacker implements Stackable {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILO-FILE-STACK: stackerName=%s - CALLED!', $stackerName));
                if (empty($stackerName)) {
                        // No empty stack name
-                       throw new InvalidArgumentException('Parameter "stackerName" is empty');
+                       throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call the protected method
index 8ad475d60a0fad382a8246494d3151a0778e644b..45ffbfbbcdb4c386ee2e22c2c15877114a863152 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 2faed1b601d5bc5e7fa5a55a604eb2149fb81e0d..ca17995351c1b8db48227da5252e980f293661b2 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\State;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Executor\Executor;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\State\Stateable;
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\State\Stateable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -78,7 +79,7 @@ abstract class BaseState extends BaseFrameworkSystem implements Stateable {
         * @throws      UnsupportedOperationException   This method should be overwritten
         */
        public function executeState (Executor $executorInstance) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 56f69b0b760c0b7a8911a1df2e806bf082494e4d..53bd4ed8ca86746d48936df0bcf558e42a722a12 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 28d748b75becb8beba6bbe2c6bba48760d86c3e3..f1ffed0c642d632aa81df15a9263b115a60220fe 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Stream\BaseStream;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/framework/main/classes/streams/crypto/mcrypt/class_McryptStream.php b/framework/main/classes/streams/crypto/mcrypt/class_McryptStream.php
deleted file mode 100644 (file)
index 1554b6f..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Stream\Crypto\Mcrypt;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Crypto\RandomNumber\RandomNumberGenerator;
-use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
-use Org\Mxchange\CoreFramework\Stream\Crypto\BaseCryptoStream;
-use Org\Mxchange\CoreFramework\Stream\Crypto\EncryptableStream;
-
-/**
- * A mcrypt-based encryption stream
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @todo               mcrypt will become deprecated, rewrite to OpenSSL
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class McryptStream extends BaseCryptoStream implements EncryptableStream {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this node class
-        *
-        * @param       $rngInstance            An RNG instance
-        * @return      $streamInstance         An instance of this node class
-        */
-       public static final function createMcryptStream (RandomNumberGenerator $rngInstance) {
-               // Get a new instance
-               $streamInstance = new McryptStream();
-
-               // Set the RNG instance
-               $streamInstance->setRngInstance($rngInstance);
-
-               // Return the instance
-               return $streamInstance;
-       }
-
-       /**
-        * Encrypt the string with fixed salt
-        *
-        * @param       $str            The unencrypted string
-        * @param       $key            Optional key, if none provided, a random key will be generated
-        * @return      $encrypted      Encrypted string
-        */
-       public function encryptStream (string $str, string $key = NULL) {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MCRYPT-STREAM: key[' . gettype($key) . ']=' . $key);
-
-               // Init crypto module
-               $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
-               $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
-
-               // Generate key, if none provided
-               if (is_null($key)) {
-                       // None provided
-                       $key = $this->getRngInstance()->generateKey();
-               }
-
-               // Add some "payload" to the string
-               switch ($this->getRngInstance()->randomNumber(0, 8)) {
-                       case 0:
-                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . crc32($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 1:
-                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . md5($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 2:
-                               $payloadString = crc32($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . sha1($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 3:
-                               $payloadString = md5($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . crc32($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 4:
-                               $payloadString = md5($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . md5($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 5:
-                               $payloadString = md5($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . sha1($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 6:
-                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . crc32($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 7:
-                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . md5($this->getRngInstance()->randomString(20));
-                               break;
-
-                       case 8:
-                               $payloadString = sha1($this->getRngInstance()->randomString(10)) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . base64_encode($str) . EncryptableStream::DATA_PAYLOAD_SEPARATOR . sha1($this->getRngInstance()->randomString(20));
-                               break;
-               }
-
-               // Encrypt the string
-               $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $payloadString, MCRYPT_MODE_ECB, $iv);
-
-               // Return the string
-               return $encrypted;
-       }
-
-       /**
-        * Decrypt the string with fixed salt
-        *
-        * @param       $encrypted      Encrypted string
-        * @param       $key            Optional key, if none provided, a random key will be generated
-        * @return      $str            The unencrypted string
-        */
-       public function decryptStream (string $encrypted, string $key = NULL) {
-               // Init crypto module
-               $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
-               $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
-
-               // Shall we use a default key or custom?
-               if (is_null($key)) {
-                       // Generate (default) key
-                       $key = $this->getRngInstance()->generateKey();
-               }
-
-               // Decrypt the string
-               $payloadString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
-
-               // Get the real string out
-               $strArray = explode(EncryptableStream::DATA_PAYLOAD_SEPARATOR, $payloadString);
-
-               // Does the element count match?
-               assert(count($strArray) == 3);
-
-               // Decode the string
-               $str = base64_decode($strArray[1]);
-
-               // Trim trailing nulls away
-               $str = rtrim($str, "\0");
-
-               // Return the string
-               return $str;
-       }
-
-       /**
-        * Streams the data and maybe does something to it
-        *
-        * @param       $data   The data (string mostly) to "stream"
-        * @return      $data   The data (string mostly) to "stream"
-        * @throws      UnsupportedOperationException   If this method is called (which is a mistake)
-        */
-       public function streamData (string $data) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
-       }
-
-}
index 978320dd9521c39720401adc0680e6e7a4fe18f3..ed7f37aa182dbc2db94611bfed75dc23fcb3ff26 100644 (file)
@@ -3,13 +3,14 @@
 namespace Org\Mxchange\CoreFramework\Stream\Crypto\Null;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Stream\Crypto\BaseCryptoStream;
 use Org\Mxchange\CoreFramework\Stream\Crypto\EncryptableStream;
 
 /**
- * A null-encryption stream does not encrypt anything but can be used if e.e.
- * mcrypt is not installed.
+ * A null-encryption stream does not encrypt anything but can be used if e.g.
+ * openssl is not installed.
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
@@ -87,7 +88,7 @@ class NullCryptoStream extends BaseCryptoStream implements EncryptableStream {
         */
        public function streamData (string $data) {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 8ec20d1dce5e12a01dd9a55d2bd4ae1b719e4f6b..e69c4a1fa6f7938b059ea42909dbe7b5717ec2d8 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Stream\Crypto\OpenSsl;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Crypto\RandomNumber\RandomNumberGenerator;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Stream\Crypto\BaseCryptoStream;
 use Org\Mxchange\CoreFramework\Stream\Crypto\EncryptableStream;
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\Stream\Crypto\EncryptableStream;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -177,7 +178,7 @@ class OpenSslStream extends BaseCryptoStream implements EncryptableStream {
         */
        public function streamData (string $data) {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
 }
index 4dcd93cd7cbf73e38f44f40aedccacd9767c01e2..efce727eb2beedfd70f8da46ae70a7a090f2cd13 100644 (file)
@@ -3,6 +3,7 @@
 namespace Tld\Domain\Project\Task\___;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -73,7 +74,7 @@ class !!!???Task extends BaseTask implements Taskable, Visitable {
         * @todo        0%
         */
        public function executeTask () {
-               $this->partialStub('Unimplemented task.');
+               DebugMiddleware::getSelfInstance()->partialStub('Unimplemented task.');
        }
 
        /**
index 8d422fe70dd7bde83d9913d8d07e323fdfb8bbed..2459c4a6d8125c4ed6f185c23f52fa4744466a5f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a4c159d9b537797d17b1ea7cd0afc19a6237fb6e..60d42fdc88312b5ec7495f167610f3e6974d538d 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 52e58cc86241c97b4cafcc1d0d1d540b4fb6338a..cadba7c273244b4807cb3b51d8ad7e1d4c8f0479 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index c8b2e19991d4430afd38c0fcfd70d4cb70a98b21..dccbddc41df98b31ab945f89005e05fad5c9bb28 100644 (file)
@@ -7,16 +7,17 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\Traits\Handler\Io\IoHandlerTrait;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 // Import SPL stuff
+use \BadMethodCallException;
 use \InvalidArgumentException;
 use \SplFileInfo;
 
@@ -25,7 +26,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -52,6 +53,11 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
        const EXCEPTION_INVALID_VIEW_HELPER           = 0x112;
        const EXCEPTION_VARIABLE_IS_MISSING           = 0x113;
 
+       /**
+        * HTML template type
+        */
+       private static $htmlTemplateType = 'invalid';
+
        /**
         * The local path name where all templates and sub folders for special
         * templates are stored. We will internally determine the language plus
@@ -179,13 +185,21 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
 
                // Init file I/O instance
                $ioInstance = ObjectFactory::createObjectByConfiguredName('file_io_class');
 
                // Set it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: ioInstance=%s', $ioInstance->__toString()));
                $this->setFileIoInstance($ioInstance);
+
+               // "Cache" config entry
+               self::$htmlTemplateType = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('html_template_type');
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: self::htmlTemplateType=%s - EXIT!', self::$htmlTemplateType));
        }
 
        /**
@@ -197,27 +211,30 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function getVariableIndex (string $variableName, string $variableGroup = NULL) {
                // Replace all dashes to underscores to match variables with configuration entries
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableName=%s,variableGroup[%s]=%s - CALLED!', $variableName, gettype($variableGroup), $variableGroup));
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
                // First everything is not found
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableName=%s', $variableName));
                $found = false;
 
                // If the stack is NULL, use the current group
                if (is_null($variableGroup)) {
                        // Use current group
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: this->currGroup=%s set as stack!', $this->currGroup));
                        $variableGroup = $this->currGroup;
                }
 
                // Is the group there?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableGroup=%s', $variableGroup));
                if ($this->isVarStackSet($variableGroup)) {
                        // Now search for it
                        foreach ($this->getVarStack($variableGroup) as $index => $currEntry) {
-                               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.':currGroup=' . $variableGroup . ',idx=' . $index . ',currEntry=' . $currEntry['name'] . ',variableName=' . $variableName);
                                // Is the entry found?
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: index=%d,currGroup=%s,currEntry[name]=%s,variableName=%s', $index, $variableGroup, $currEntry['name'], $variableName));
                                if ($currEntry['name'] == $variableName) {
                                        // Found!
-                                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.':FOUND!');
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: index=%d - BREAK!', $index));
                                        $found = $index;
                                        break;
                                }
@@ -225,6 +242,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                }
 
                // Return the current position
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: found=%d - EXIT!', $found));
                return $found;
        }
 
@@ -233,13 +251,22 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         *
         * @param       $variableGroup  Variable group to check
         * @return      $isSet                  Whether the given variable group is set
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        protected final function isVarStackSet (string $variableGroup) {
+               // Validate parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableGroup=%s - CALLED!', $variableGroup));
+               if (empty($variableGroup)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Check it
-               $isSet = isset($this->varStack[$variableGroup]);
+               $isset = isset($this->varStack[$variableGroup]);
 
                // Return result
-               return $isSet;
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: isset=%d - EXIT!', intval($isset)));
+               return $isset;
        }
 
        /**
@@ -247,8 +274,18 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         *
         * @param       $variableGroup  Variable group to check
         * @return      $varStack               Found variable group
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public final function getVarStack (string $variableGroup) {
+               // Validate parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableGroup=%s - CALLED!', $variableGroup));
+               if (empty($variableGroup)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Return value
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: this->varStack[%s]()=%d - EXIT!', $variableGroup, count($this->varStack[$variableGroup])));
                return $this->varStack[$variableGroup];
        }
 
@@ -258,9 +295,21 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $variableGroup  Variable group to check
         * @param       $varStack               Variable stack to check
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        protected final function setVarStack (string $variableGroup, array $varStack) {
+               // Validate parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableGroup=%s,varStack()=%d - CALLED!', $variableGroup, count($varStack)));
+               if (empty($variableGroup)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Set var stack
                $this->varStack[$variableGroup]  = $varStack;
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -269,18 +318,30 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $variableName   The variable we are looking for
         * @param       $variableGroup  Optional variable group to look in
         * @return      $content                Content of the variable or null if not found
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        protected function readVariable (string $variableName, string $variableGroup = NULL) {
+               // Check parameters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableName=%s,variableGroup[%s]=%s - CALLED!', $variableName, gettype($variableGroup), $variableGroup));
+               if (empty($variableName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!is_null($variableGroup) && empty($variableGroup)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Replace all dashes to underscores to match variables with configuration entries
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
                // First everything is not found
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableName=%s', $variableName));
                $content = NULL;
 
                // If the stack is NULL, use the current group
                if (is_null($variableGroup)) {
                        // Use current group
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: this->currGroup=%s set as stack!', $this->currGroup));
                        $variableGroup = $this->currGroup;
                }
 
@@ -288,13 +349,15 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                $found = $this->getVariableIndex($variableName, $variableGroup);
 
                // Is the variable found?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: found[]=%s', gettype($found)));
                if ($found !== false) {
                        // Read it
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->getVariableValue(%s,%s) ...', $variableGroup, $found));
                        $content = $this->getVariableValue($variableGroup, $found);
                }
 
                // Return the current position
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': variableGroup=' . $variableGroup . ',variableName=' . $variableName . ', content[' . gettype($content) . ']=' . $content);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: content()=%d - EXIT!', strlen($content)));
                return $content;
        }
 
@@ -307,10 +370,15 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function addVariable (string $variableName, $value) {
                // Set general variable group
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableName=%s,value[]=%s - CALLED!', $variableName, gettype($value)));
                $this->setVariableGroup('general');
 
                // Add it to the stack
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->addVariableGroup(%s,value[]=%s) ...', $variableName, gettype($value)));
                $this->addGroupVariable($variableName, $value);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -320,15 +388,19 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function readCurrentGroup () {
                // Default is not found
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: CALLED!');
                $result = [];
 
                // Is the group there?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: this->currGroup=%s', $this->currGroup));
                if ($this->isVarStackSet($this->currGroup)) {
                        // Then use it
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->getVarStack(%s) ...', $this->currGroup));
                        $result = $this->getVarStack($this->currGroup);
                }
 
                // Return result
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: result()=%d - EXIT!', count($result)));
                return $result;
        }
 
@@ -338,18 +410,29 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $groupName      Name of variable group
         * @param       $add            Whether add this group
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function setVariableGroup (string $groupName, bool $add = true) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: groupName=%s,add=%d - CALLED!', $groupName, intval($add)));
+               if (empty($groupName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "groupName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Set group name
-               //* DEBIG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': currGroup=' . $groupName);
                $this->currGroup = $groupName;
 
                // Skip group 'general'
                if (($groupName != 'general') && ($add === true)) {
+                       // Mark as 'OK'
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Marking groupName=%s as OK ...', $groupdName));
                        $this->variableGroups[$groupName] = 'OK';
                }
-       }
 
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
+       }
 
        /**
         * Adds a variable to current group
@@ -357,34 +440,54 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $variableName   Variable to set
         * @param       $value                  Value to store in variable
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function addGroupVariable (string $variableName, $value) {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableName=%s,value[]=%s - CALLED!', $variableName, gettype($value)));
+               if (empty($variableName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (is_object($value) || is_resource($value)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException(sprintf('value[]=%s is not supported', gettype($value)), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Replace all dashes to underscores to match variables with configuration entries
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking StringUtils::convertDashesToUnderscores(%s) ...', $variableName));
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
-               // Debug message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': group=' . $this->currGroup . ', variableName=' . $variableName . ', value=' . $value);
-
                // Get current variables in group
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: this->currGroup=%s,variableName=%s,value[]=%s', $this->currGroup, $variableName, gettype($value)));
                $currVars = $this->readCurrentGroup();
 
                // Append our variable
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: currVars()=%d - BEFORE!', count($currVars)));
                array_push($currVars, $this->generateVariableArray($variableName, $value));
 
                // Add it to the stack
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->setVarStack(%s,currVars()=%d) - AFTER!', $this->currGroup, count($currVars)));
                $this->setVarStack($this->currGroup, $currVars);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
         * Getter for variable value, throws a NoVariableException if the variable is not found
         *
         * @param       $variableGroup  Variable group to use
-        * @param       $index          Index in variable array
-        * @return      $value          Value to set
+        * @param       $index  Index in variable array
+        * @return      $value  Value to set
         */
        private function getVariableValue (string $variableGroup, int $index) {
                // Return it
-               return $this->varStack[$variableGroup][$index]['value'];
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableGroup=%s,index[]=%d - CALLED!', $variableGroup, $index));
+               $value = $this->varStack[$variableGroup][$index]['value'];
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: value[]=%s - EXIT!', gettype($value)));
+               return $value;
        }
 
        /**
@@ -393,23 +496,22 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $variableName   The variable we are looking for
         * @param       $value                  The value we want to store in the variable
         * @return      void
-        * @throws      NoVariableException     If the given variable is not found
         */
        private function modifyVariable (string $variableName, $value) {
                // Replace all dashes to underscores to match variables with configuration entries
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableName=%s,value[]=%s - CALLED!', $variableName, gettype($value)));
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
                // Get index for variable
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: this->getVariableIndex(%s) ...', $variableName));
                $index = $this->getVariableIndex($variableName);
 
-               // Is the variable set?
-               if ($index === false) {
-                       // Unset variables cannot be modified
-                       throw new NoVariableException(array($this, $variableName, $value), self::EXCEPTION_VARIABLE_IS_MISSING);
-               }
-
                // Then modify it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: this->setVariableValue(%s,%d,value[]=%s) ...', $this->currGroup, $index, gettype($value)));
                $this->setVariableValue($this->currGroup, $index, $value);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -421,7 +523,12 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      void
         */
        private function setVariableValue (string $variableGroup, int $index, $value) {
+               // Set variable
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableGroup=%s,index[]=%d,value[]=%s - CALLED!', $variableGroup, $index, gettype($value)));
                $this->varStack[$variableGroup][$index]['value'] = $value;
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -433,28 +540,47 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $variableName   Variable to set
         * @param       $value                  Value to set
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        protected function setVariable (string $variableGroup, string $variableName, $value) {
+               // Check parameters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableGroup=%s,variableName=%s,value[]=%s - CALLED!', $variableGroup, $variableName, gettype($value)));
+               if (empty($variableGroup)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($variableName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Replace all dashes to underscores to match variables with configuration entries
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
                // Get index for variable
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: this->getVariableIndex(%s) ...', $variableName));
                $index = $this->getVariableIndex($variableName);
 
                // Is the variable set?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: index[]=%s', gettype($index)));
                if ($index === false) {
                        // Is the stack there?
                        if (!isset($this->varStack[$variableGroup])) {
                                // Then initialize it here
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Initializing this->varStack[%s] ...', $variableGroup));
                                $this->varStack[$variableGroup] = [];
                        }
 
                        // Not found, add it
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Pushing variableGroup=%s,variableName=%s,value[]=%s ...', $variableGroup, $variableName, gettype($value)));
                        array_push($this->varStack[$variableGroup], $this->generateVariableArray($variableName, $value));
                } else {
                        // Then modify it
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->setVariableValue(%s,%d,value[]=%s) ...', $this->currGroup, $index, gettype($value)));
                        $this->setVariableValue($this->currGroup, $index, $value);
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -467,15 +593,17 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function generateVariableArray (string $variableName, $value) {
                // Replace all dashes to underscores to match variables with configuration entries
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableName=%s,value[]=%s - CALLED!', $variableName, gettype($value)));
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
                // Generate the temporary array
-               $varData = array(
+               $varData = [
                        'name'  => $variableName,
                        'value' => $value
-               );
+               ];
 
                // And return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: varData()=%d - EXIT!', count($varData)));
                return $varData;
        }
 
@@ -613,22 +741,40 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $index                  Index to unset
         * @param       $variableGroup  Variable group (default: currGroup)
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
+        * @throws      BadMethodCallException  If this method was called but combination of variableGroup/index isn't found
         */
        protected final function unsetVariableStackOffset (int $index, string $variableGroup = NULL) {
+               // Check variables
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: index=%d,variableGroup[%s]=%s - CALLED!', $index, gettype($variableGroup), $variableGroup));
+               if ($index < 0) {
+                       // Invalid index
+                       throw new InvalidArgumentException(sprintf('index=%d is below zero', $index), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (!is_null($variableGroup) && empty($variableGroup)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is the variable group not set?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableGroup[]=%s', gettype($variableGroup)));
                if (is_null($variableGroup)) {
                        // Then set it to current
                        $variableGroup = $this->currGroup;
                }
 
                // Is the entry there?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Checking variableGroup=%s,index=%d ...', $variableGroup, $index));
                if (!isset($this->varStack[$variableGroup][$index])) {
                        // Abort here, we need fixing!
-                       $this->debugInstance();
+                       throw new BadMethodCallException(sprintf('variableGroup=%s,index=%d does not exist, but method was invoked', $variableGroup, $index), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
                }
 
                // Remove it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Unsetting variableGroup=%s,index=%d ...', $variableGroup, $index));
                unset($this->varStack[$variableGroup][$index]);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -639,8 +785,6 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        protected final function setRawTemplateData (string $rawTemplateData) {
                // And store it in this class
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': ' . strlen($rawTemplateData) . ' Bytes set.');
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': ' . $this->currGroup . ' variables: ' . count($this->getVarStack($this->currGroup)) . ', groups=' . count($this->varStack));
                $this->rawTemplateData = $rawTemplateData;
        }
 
@@ -650,7 +794,6 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      $rawTemplateData        The raw data from the template
         */
        public final function getRawTemplateData () {
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: ' . strlen($this->rawTemplateData) . ' Bytes read.');
                return $this->rawTemplateData;
        }
 
@@ -662,7 +805,6 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private final function setCompiledData (string $compiledData) {
                // And store it in this class
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: ' . strlen($compiledData) . ' Bytes set.');
                $this->compiledData = $compiledData;
        }
 
@@ -672,7 +814,6 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      $compiledData   Compiled template data
         */
        public final function getCompiledData () {
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: ' . strlen($this->compiledData) . ' Bytes read.');
                return $this->compiledData;
        }
 
@@ -682,9 +823,17 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $templateName   The template we shall load
         * @param       $extOther       An other extension to use
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         * @throws      FileNotFoundException   If the template was not found
         */
        protected function loadTemplate (string $templateName, string $extOther = '') {
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: templateName=%s,extOther=%s - CALLED!', $templateName, $extOther));
+               if (empty($templateName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "templateName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get extension for the template if empty
                if (empty($extOther)) {
                        // None provided, so get the raw one
@@ -699,6 +848,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                 * now entirely done by php_intl. These old thing with language-based
                 * template paths comes from an older time.
                 */
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: ext=%s', $ext));
                $fileInstance = new SplFileInfo(sprintf('%s%s%s%s%s%s',
                        $this->getTemplateBasePath(),
                        $this->getGenericBasePath(),
@@ -709,16 +859,20 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                ));
 
                // First try this
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: fileInstance=%s', $fileInstance->__toString()));
                try {
                        // Load the raw template data
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->loadRawTemplateData(%s) ...', $fileInstance->__toString()));
                        $this->loadRawTemplateData($fileInstance);
                } catch (FileNotFoundException $e) {
                        // If we shall load a code-template we need to switch the file extension
-                       if (($this->getTemplateType() != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('html_template_type')) && (empty($extOther))) {
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: this->templateType=%s,self::htmlTemplateType=%s,extOther=%s', $this->getTemplateType(), self::$htmlTemplateType, $extOther));
+                       if (($this->getTemplateType() != self::$htmlTemplateType) && (empty($extOther))) {
                                // Switch over to the code-template extension and try it again
                                $ext = $this->getCodeTemplateExtension();
 
                                // Try it again...
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->loadTemplate(%s,%s) ...', $templateName, $ex));
                                $this->loadTemplate($templateName, $ext);
                        } else {
                                // Throw it again
@@ -726,6 +880,8 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                        }
                }
 
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -736,14 +892,19 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function loadRawTemplateData (SplFileInfo $fileInstance) {
                // Load the raw template
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: fileInstance=' . $fileInstance);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: fileInstance=%s - CALLED!', $fileInstance->__toString()));
                $rawTemplateData = $this->getFileIoInstance()->loadFileContents($fileInstance);
 
                // Store the template's contents into this class
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->setRawTemplateData(%d) ...', strlen($rawTemplateData)));
                $this->setRawTemplateData($rawTemplateData);
 
                // Remember the template's file instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->setLastTemplate(%s) ...', $fileInstance->__toString()));
                $this->setLastTemplate($fileInstance);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -752,22 +913,28 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         *
         * @param       $variableName   The variable's name (shall be content or config)
         *                                                      by default
-        * @param       $variableName   The variable we want to assign
+        * @param       $configKey      Possible configuration key
         * @return      void
         */
-       private function assignTemplateVariable (string $variableName, $var) {
+       private function assignTemplateVariable (string $variableName, string $configKey = '') {
                // Replace all dashes to underscores to match variables with configuration entries
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: variableName=' . $variableName . ',var=' . $var);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: variableName=%s,configKey=%s - CALLED!', $variableName, $configKey));
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
                // Is it not a config variable?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableName=%s', $variableName));
                if ($variableName != 'config') {
                        // Regular template variables
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->assignVariable(%s,"") ...', $variableName));
                        $this->assignVariable($variableName, '');
                } else {
                        // Configuration variables
-                       $this->assignConfigVariable($var);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->assignConfigVariable(%s,"") ...', $configKey));
+                       $this->assignConfigVariable($configKey);
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -778,23 +945,31 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function extractVariablesFromRawData (string $rawData) {
                // Search for variables
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE:rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: rawData(%d)=%s - CALLED!', strlen($rawData), $rawData));
                preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches);
 
                // Did we find some variables?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableMatches[]=%s', gettype($variableMatches)));
                if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
                        // Initialize all missing variables
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableMatches()=%d', count($variableMatches)));
                        foreach ($variableMatches[3] as $key => $var) {
                                // Variable name
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: key=%s,var=%s', $key, $var));
                                $variableName = $variableMatches[1][$key];
 
                                // Workarround: Do not assign empty variables
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: variableName=%s', $variableName));
                                if (!empty($var)) {
                                        // Try to assign it, empty strings are being ignored
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->assignTemplateVariable(%s,%s) ...', $variableName, $var));
                                        $this->assignTemplateVariable($variableName, $var);
                                }
                        }
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -813,9 +988,11 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function analyzeTemplate (array $templateMatches) {
                // Backup raw template data
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: templateMatches()=%d', count($templateMatches)));
                $backup = $this->getRawTemplateData();
 
                // Initialize some arrays
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: backup[%s]()=%d,this->loadedRawData[]=%s', gettype($backup), strlen($backup), gettype($this->loadedRawData)));
                if (is_null($this->loadedRawData)) {
                        // Initialize both
                        $this->loadedRawData = [];
@@ -823,32 +1000,41 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                }
 
                // Load all requested templates
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: templateMatches[1]()=%d', count($templateMatches[1])));
                foreach ($templateMatches[1] as $template) {
                        // Load and compile only templates which we have not yet loaded
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: template=%s', $template));
                        // RECURSIVE PROTECTION! BE CAREFUL HERE!
                        if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) {
-                               // Debug message
-                               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE:template=' . $template);
-
                                // Template not found, but maybe variable assigned?
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: template=%s not loaded yet', $template));
                                if ($this->getVariableIndex($template) !== false) {
                                        // Use that content here
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Assigning this->loadedTemplateData[%s] from variable template=%s ...', $template, $template));
                                        $this->loadedRawData[$template] = $this->readVariable($template);
 
                                        // Recursive protection:
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
                                        array_push($this->loadedTemplates, $template);
                                } else {
                                        // Then try to search for code-templates
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: template=%s is maybe name of code template?', $template));
                                        try {
-                                               // Load the code template and remember it's contents
+                                               // Load the code template ...
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->loadCodeTemplate(%s) ...', $template));
                                                $this->loadCodeTemplate($template);
+
+                                               // ... and remember it's contents
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template));
                                                $this->loadedRawData[$template] = $this->getRawTemplateData();
 
                                                // Remember this template for recursion detection
                                                // RECURSIVE PROTECTION!
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
                                                array_push($this->loadedTemplates, $template);
                                        } catch (FileNotFoundException $e) {
                                                // Even this is not done... :/
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
                                                array_push($this->rawTemplates, $template);
                                        }
                                }
@@ -856,7 +1042,11 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                }
 
                // Restore the raw template data
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->setRawTemplateData(backup()=%d) ...', strlen($backup)));
                $this->setRawTemplateData($backup);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -868,30 +1058,41 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function compileCode (string $code, string $template) {
                // Is this template already compiled?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: code=%s,template=%s - CALLED!', $code, $template));
                if (in_array($template, $this->compiledTemplates)) {
                        // Abort here...
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Found template=%s in this->compiledTemplates - EXIT!', $template));
                        return;
                }
 
                // Remember this template being compiled
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Adding template=%s to this->compiledTemplates ...', $template));
                array_push($this->compiledTemplates, $template);
 
                // Compile the loaded code in five steps:
                //
                // 1. Backup current template data
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: this->compiledTemplates()=%d', count($this->compiledTemplates)));
                $backup = $this->getRawTemplateData();
 
                // 2. Set the current template's raw data as the new content
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->setRawTemplateData(code()=%d) ... - backup[%s]()=%d', strlen($code), gettype($backup), strlen($backup)));
                $this->setRawTemplateData($code);
 
                // 3. Compile the template data
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: Invoking this->compileTemplate() ...');
                $this->compileTemplate();
 
                // 4. Remember it's contents
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template));
                $this->loadedRawData[$template] = $this->getRawTemplateData();
 
                // 5. Restore the previous raw content from backup variable
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: Invoking this->setRawTemplateData(backup()=%d) ...', strlen($backup)));
                $this->setRawTemplateData($backup);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -903,24 +1104,30 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function insertAllTemplates (array $templateMatches) {
                // Run through all loaded codes
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-TEMPLATE: templateMatches()=%d', count($templateMatches)));
                foreach ($this->loadedRawData as $template => $code) {
-
                        // Search for the template
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: template=%s,code()=%d', $template, strlen($code)));
                        $foundIndex = array_search($template, $templateMatches[1]);
 
                        // Lookup the matching template replacement
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: foundIndex[%s]=d', gettype($foundIndex), $foundIndex));
                        if (($foundIndex !== false) && (isset($templateMatches[0][$foundIndex]))) {
-
                                // Get the current raw template
                                $rawData = $this->getRawTemplateData();
 
                                // Replace the space holder with the template code
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: rawData()=%s - BEFORE!', strlen($rawData)));
                                $rawData = str_replace($templateMatches[0][$foundIndex], $code, $rawData);
 
                                // Set the new raw data
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: rawData()=%s - AFTER!', strlen($rawData)));
                                $this->setRawTemplateData($rawData);
                        }
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-TEMPLATE: EXIT!');
        }
 
        /**
@@ -962,10 +1169,8 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @todo        Unfinished work or don't die here.
         */
        private function assignAllVariables (array $varMatches) {
-               // Debug message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE:varMatches()=' . count($varMatches));
-
                // Search for all variables
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE:varMatches()=' . count($varMatches));
                foreach ($varMatches[1] as $key => $var) {
                        // Replace all dashes to underscores to match variables with configuration entries
                        $var = trim(StringUtils::convertDashesToUnderscores($var));
@@ -997,10 +1202,8 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      void
         */
        private function compileRawTemplateData (array $templateMatches) {
-               // Debug message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE:loadedRawData()= ' .count($this->loadedRawData));
-
                // Are some code-templates found which we need to compile?
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE:loadedRawData()= ' .count($this->loadedRawData));
                if (count($this->loadedRawData) > 0) {
                        // Then compile all!
                        foreach ($this->loadedRawData as $template => $code) {
@@ -1059,13 +1262,6 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                $content = $this->getRawTemplateData();
                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: content before=' . strlen($content) . ' (' . md5($content) . ')');
 
-               // Do we have the stack?
-               if (!$this->isVarStackSet('general')) {
-                       // Abort here silently
-                       // @TODO This silent abort should be logged, maybe.
-                       return;
-               }
-
                // Walk through all variables
                foreach ($this->getVarStack('general') as $currEntry) {
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: name=' . $currEntry['name'] . ', value=<pre>' . htmlentities($currEntry['value']) . '</pre>');
@@ -1091,10 +1287,17 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $template       The web template we shall load which is located in
         *                                              'html' by default
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function loadHtmlTemplate (string $template) {
+               // Validate parameter
+               if (empty($template)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "template" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Set template type
-               $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('html_template_type'));
+               $this->setTemplateType(self::$htmlTemplateType);
 
                // Load the special template
                $this->loadTemplate($template);
@@ -1112,7 +1315,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                // Validate parameter
                if (empty($variableName)) {
                        // Throw an exception
-                       throw new InvalidArgumentException('Parameter "variableName" is empty');
+                       throw new InvalidArgumentException('Parameter "variableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Replace all dashes to underscores to match variables with configuration entries
@@ -1139,8 +1342,18 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $variableName   The variable we are looking for
         * @param       $variableGroup  Name of variable group (default: 'general')
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public final function removeVariable (string $variableName, string $variableGroup = 'general') {
+               // Validate parameter
+               if (empty($variableName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($variableGroup)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableGroup" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // First search for the variable if it was already added
                $index = $this->getVariableIndex($variableName, $variableGroup);
 
@@ -1158,8 +1371,18 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $templateName   Name of the template we want to assign
         * @param       $variableName   Name of the variable we want to assign
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function assignTemplateWithVariable (string $templateName, string $variableName) {
+               // Validate parameter
+               if (empty($templateName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "templateName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($variableName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get the content from last loaded raw template
                $content = $this->getRawTemplateData();
 
@@ -1175,8 +1398,15 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         *
         * @param       $variableName   The configuration variable we want to assign
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function assignConfigVariable (string $variableName) {
+               // Validate parameter
+               if (empty($variableName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "variableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Replace all dashes to underscores to match variables with configuration entries
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
@@ -1231,8 +1461,15 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $template       The code template we shall load which is
         *                                              located in 'code' by default
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function loadCodeTemplate (string $template) {
+               // Validate parameter
+               if (empty($template)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "template" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Set template type
                $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type'));
 
@@ -1246,8 +1483,15 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $template       The email template we shall load which is
         *                                              located in 'emails' by default
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function loadEmailTemplate (string $template) {
+               // Validate parameter
+               if (empty($template)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "template" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Set template type
                $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_template_type'));
 
@@ -1445,8 +1689,15 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         *
         * @param       $helperName             The helper's name
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        protected function loadViewHelper (string $helperName) {
+               // Validate parameter
+               if (empty($helperName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "helperName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Is this view helper loaded?
                if (!isset($this->helpers[$helperName])) {
                        // Create a class name
@@ -1477,8 +1728,15 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $rawCode                        Raw code to compile
         * @param       $setMatchAsCode         Sets $match if readVariable() returns empty result
         * @return      $rawCode        Compile code with inserted variable value
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function compileRawCode (string $rawCode, bool $setMatchAsCode = false) {
+               // Validate parameter
+               if (empty($rawCode)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "rawCode" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Find the variables
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE:rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
                preg_match_all($this->regExpVarValue, $rawCode, $varMatches);
@@ -1531,9 +1789,19 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $oldName        Old name of variable
         * @param       $newName        New name of variable
         * @return      void
+        * @throws      InvalidArgumentException        If the variable name is left empty
         */
        public function renameVariable (string $oldName, string $newName) {
+               // Validate parameter
                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: oldName=' . $oldName . ', newName=' . $newName);
+               if (empty($oldName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "oldName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($newName)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "newName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get raw template code
                $rawData = $this->getRawTemplateData();
 
@@ -1570,6 +1838,12 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      $compactedContent               The compacted content
         */
        public function compactContent (string $uncompactedContent) {
+               // Validate parameter
+               if (empty($uncompactedContent)) {
+                       // Throw an exception
+                       throw new InvalidArgumentException('Parameter "uncompactedContent" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // First, remove all tab/new-line/revert characters
                $compactedContent = str_replace(chr(9), '', str_replace(chr(10), '', str_replace(chr(13), '', $uncompactedContent)));
 
index 350a5eac9b1dcefcdbba6b56c87b9f93c1914c1b..438e5a398c16b35368022efda513f41cadfeeedb 100644 (file)
@@ -5,8 +5,8 @@ namespace Org\Mxchange\CoreFramework\Template\Engine;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
 
@@ -18,7 +18,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -70,7 +70,7 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem
                // Is the base path valid?
                if (empty($templateBasePath)) {
                        // Base path is empty
-                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (!is_dir($templateBasePath)) {
                        // Is not a path
                        throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
index 0b15d419958a3397a5461165cbd8a4a20d0cd5b9..8894b9bbe1ffac7429ab473e865015d4acea28b1 100644 (file)
@@ -5,8 +5,8 @@ namespace Org\Mxchange\CoreFramework\Template\Engine;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
 
@@ -19,7 +19,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -70,7 +70,7 @@ class HtmlTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                // Is the base path valid?
                if (empty($templateBasePath)) {
                        // Base path is empty
-                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (!is_dir($templateBasePath)) {
                        // Is not a path
                        throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
index d41c4f32bdbedc8098ce4c33970ef6b3de6f57b1..31a011da6426459a28df8ab2b968646f0b2a5507 100644 (file)
@@ -6,10 +6,11 @@ namespace Org\Mxchange\CoreFramework\Template\Engine;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Image\BaseImage;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Parser\Parseable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
@@ -24,7 +25,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -114,7 +115,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
                // Is the base path valid?
                if (empty($templateBasePath)) {
                        // Base path is empty
-                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (!is_dir($templateBasePath)) {
                        // Is not a path
                        throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
@@ -265,7 +266,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
                }
 
                // Unfinished work!
-               $this->partialStub('Handling extra characters is not yet supported!');
+               DebugMiddleware::getSelfInstance()->partialStub('Handling extra characters is not yet supported!');
        }
 
        /**
index ea0be0ae01fb7304db0770555ea2857ce5041a23..a54f98d9cbc28c947e57bf7ebe766cdb23f8561d 100644 (file)
@@ -5,10 +5,10 @@ namespace Org\Mxchange\CoreFramework\Template\Engine;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Mailer\DeliverableMail;
 use Org\Mxchange\CoreFramework\Parser\Parseable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
@@ -22,7 +22,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -104,7 +104,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                // Is the base path valid?
                if (empty($templateBasePath)) {
                        // Base path is empty
-                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (!is_dir($templateBasePath)) {
                        // Is not a path
                        throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
index f2bbb72f581409bc0c7443e0666bb9996db03460..e7e932a5849233003447b7b0edc0ed26ff09c1f9 100644 (file)
@@ -6,10 +6,10 @@ namespace Org\Mxchange\CoreFramework\Template\Engine;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Menu\RenderableMenu;
 use Org\Mxchange\CoreFramework\Parser\Parseable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Traits\Stack\StackableTrait;
@@ -24,7 +24,7 @@ use \UnexpectedValueException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -166,7 +166,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                // Is the base path valid?
                if (empty($templateBasePath)) {
                        // Base path is empty
-                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+                       throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
                } elseif (!is_dir($templateBasePath)) {
                        // Is not a path
                        throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
index 6175b9c72178746b36d234e70050a2bfa4335e9b..0b7cb3790dcb49d483bfb605e504536d861fe2cc 100644 (file)
@@ -6,8 +6,8 @@ namespace Org\Mxchange\CoreFramework\Template\Engine\Xml;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Factory\Template\XmlTemplateEngineFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
 use Org\Mxchange\CoreFramework\Template\Xml\CompileableXmlTemplate;
@@ -99,7 +99,11 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: className=%s - CONSTRUCTED!', $className));
                parent::__construct($className);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-XML-TEMPLATE-ENGINE: EXIT!');
        }
 
        /**
@@ -108,6 +112,7 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @param       $typePrefix                             Type prefix
         * @param       $xmlTemplateType                Type of XML template
         * @return      $templateInstance               An instance of TemplateEngine
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
         * @throws      InvalidBasePathStringException  If $templateBasePath is no string
         * @throws      BasePathIsNoDirectoryException  If $templateBasePath is no
@@ -116,6 +121,16 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         *                                                                                      read-protected
         */
        protected function initXmlTemplateEngine (string $typePrefix, string $xmlTemplateType) {
+               // Check on parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: typePrefix=%s,xmlTemplateType=%s - CALLED!', $typePrefix, $xmlTemplateType));
+               if (empty($typePrefix)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "typePrefix" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($xmlTemplateType)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "xmlTemplateType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Set XML template type and prefix
                $this->xmlTemplateType = $xmlTemplateType;
                $this->typePrefix      = $typePrefix;
@@ -125,9 +140,15 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
                $applicationInstance = ApplicationHelper::getSelfInstance();
 
                // Determine base path
-               $templateBasePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path') . FrameworkBootstrap::getRequestInstance()->getRequestElement('app') . '/';
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: applicationInstance=%s', $applicationInstance->__toString()));
+               $templateBasePath = sprintf('%s%s%s',
+                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path'),
+                       FrameworkBootstrap::getRequestInstance()->getRequestElement('app'),
+                       DIRECTORY_SEPARATOR
+               );
 
                // Is the base path valid?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: templateBasePath=%s', $templateBasePath));
                if (empty($templateBasePath)) {
                        // Base path is empty
                        throw new BasePathIsEmptyException($this, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
@@ -159,13 +180,18 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
                $this->stackerName = $typePrefix . '_' . $xmlTemplateType;
 
                // Init stacker
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: this->stackerName=%s', $this->stackerName));
                $stackInstance->initStack($this->stackerName);
 
                // Set it
                $this->setStackInstance($stackInstance);
 
                // Set it in main nodes
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: Adding xmlTemplateType=%s to this->mainNodes ...', $xmlTemplateType));
                array_push($this->mainNodes, str_replace('_', '-', $xmlTemplateType));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-XML-TEMPLATE-ENGINE: EXIT!');
        }
 
        /**
@@ -176,16 +202,22 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         */
        public function loadXmlTemplate (string $templateName = '') {
                // Is the template name empty?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: templateName=%s - CALLED!', $templateName));
                if (empty($templateName)) {
                        // Set generic template name
                        $templateName = $this->typePrefix . '_' . $this->xmlTemplateType . '_template_type';
                }
 
                // Set template type
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: templateName=%s', $templateName));
                $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($templateName));
 
                // Load the special template
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: Invoking this->loadTemplate(%s) ...', $this->xmlTemplateType));
                $this->loadTemplate($this->xmlTemplateType);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-XML-TEMPLATE-ENGINE: EXIT!');
        }
 
        /**
@@ -253,22 +285,24 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         */
        public function readXmlData (string $key) {
                // Is key parameter valid?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-XML-TEMPLATE-ENGINE: key=%s - CALLED!', $key));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: key=%s - CALLED!', $key));
                if (empty($key)) {
                        // Throw exception
-                       throw new InvalidArgumentException('Parameter key is empty');
+                       throw new InvalidArgumentException('Parameter key is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Read the variable
                $value = parent::readVariable($key, 'general');
 
                // Is this null?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: value[]=%s', gettype($value)));
                if (is_null($value)) {
                        // Bah, needs fixing.
                        $this->debugInstance(sprintf('[%s:%d]: key=%s returns NULL', __METHOD__, __LINE__, $key));
                }
 
                // Return value
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: value[%s]=%s - EXIT!', gettype($value), $value));
                return $value;
        }
 
@@ -278,25 +312,43 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @param       $node                                   The XML node we should load a dependency template
         * @param       $templateDependency             A template to load to satisfy dependencies
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        protected function handleTemplateDependency (string $node, string $templateDependency) {
-               // Check that the XML node is not empty
-               assert(!empty($node));
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: node=%s,templateDependency=%s - CALLED!', $node, $templateDependency));
+               if (empty($node)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "node" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($templateDependency)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "templateDependency" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
 
                // Is the template dependency set?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: node=%s,templateDependency=%s', $node, $templateDependency));
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
+                       // Create class name
+                       $configKey = sprintf('%s_%s_%s_template_class', $this->typePrefix, self::convertDashesToUnderscores($node), $this->xmlTemplateType);
+
                        // Get a temporay template instance
-                       $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance($this->typePrefix . '_' . self::convertDashesToUnderscores($node) . '_' . $this->xmlTemplateType . '_template_class');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: configKey=%s', $configKey));
+                       $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance();
 
                        // Then load it
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: templateInstance=%s', $templateInstance->__toString()));
                        $templateInstance->loadXmlTemplate($templateDependency);
 
                        // Parse the XML content
                        $templateInstance->renderXmlContent();
 
                        // Save the parsed raw content in our dependency array
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: Invoking templateInstance->getRawTemplateData() for this->dependencyContent[%s] ...', $node));
                        $this->dependencyContent[$node] = $templateInstance->getRawTemplateData();
                }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-XML-TEMPLATE-ENGINE: EXIT!');
        }
 
        /**
@@ -306,17 +358,29 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @param       $element                The element we shall handle
         * @param       $attributes             All attributes
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         * @throws      InvalidXmlNodeException         If an unknown/invalid XML node name was found
         */
        public final function startElement ($resource, string $element, array $attributes) {
+               // Check parameters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: resource[%s]=%s,element=%s,attributes()=%d - CALLED!', gettype($resource), $resource, $element, count($attributes)));
+               if (!is_resource($resource)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('Parameter resource has unexpected type %s', gettype($resource)), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($element)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "element" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Initial method name which will never be called...
                $methodName = $this->initMethodName;
 
                // Make the element name lower-case
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: methodName=%s', $methodName));
                $element = strtolower($element);
 
                // Is the element a main node?
-               //* DEBUG: */ echo "START: &gt;".$element."&lt;<br />\n";
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: element=%s', $element));
                if (in_array($element, $this->getMainNodes())) {
                        // Okay, main node found!
                        $methodName = 'start' . StringUtils::convertToClassName($element);
@@ -332,7 +396,11 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
                }
 
                // Call method
-               call_user_func_array(array($this, $methodName), $attributes);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: Invoking this->%s(attributes()=%d) ...', $methodName, count($attributes)));
+               call_user_func_array([$this, $methodName], $attributes);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-XML-TEMPLATE-ENGINE: EXIT!');
        }
 
        /**
@@ -344,22 +412,35 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @throws      XmlNodeMismatchException        If current main node mismatches the closing one
         */
        public final function finishElement ($resource, string $nodeName) {
+               // Check parameters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: resource[%s]=%s,nodeName=%s - CALLED!', gettype($resource), $resource, $nodeName));
+               if (!is_resource($resource)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('Parameter resource has unexpected type %s', gettype($resource)), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($nodeName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "nodeName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Make all lower-case
                $nodeName = strtolower($nodeName);
 
                // Does this match with current main node?
-               //* DEBUG: */ echo "END: &gt;".$nodeName."&lt;<br />\n";
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: nodeName=%s', $nodeName));
                if (($nodeName != $this->getCurrMainNode()) && (in_array($nodeName, $this->getMainNodes()))) {
                        // Did not match!
-                       throw new XmlNodeMismatchException (array($this, $nodeName, $this->getCurrMainNode()), XmlParser::EXCEPTION_XML_NODE_MISMATCH);
+                       throw new XmlNodeMismatchException ([$this, $nodeName, $this->getCurrMainNode()], XmlParser::EXCEPTION_XML_NODE_MISMATCH);
                }
 
                // Construct method name
                $methodName = 'finish' . StringUtils::convertToClassName($nodeName);
 
                // Call the corresponding method
-               //* DEBUG: */ echo "call: ".$methodName."<br />\n";
-               call_user_func_array(array($this, $methodName), array());
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: Invoking this->%s() ...', $methodName));
+               call_user_func_array([$this, $methodName], []);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-XML-TEMPLATE-ENGINE: EXIT!');
        }
 
        /**
@@ -367,26 +448,35 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         *
         * @param       $content        Valid XML content or if not set the current loaded raw content
         * @return      void
-        * @throws      XmlParserException      If an XML error was found
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function renderXmlContent (string $content = NULL) {
                // Is the content set?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: content[%s]()=%d - CALLED!', gettype($content), strlen($content)));
                if (is_null($content)) {
                        // Get current content
                        $content = $this->getRawTemplateData();
+               } elseif (empty($content)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "content" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Get a XmlParser instance
                $parserInstance = ObjectFactory::createObjectByConfiguredName('xml_parser_class', [$this]);
 
                // Check if XML compacting is enabled
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: parserInstance=%s', $parserInstance->__toString()));
                if ($this->isXmlCompactingEnabled()) {
                        // Yes, so get a decorator class for transparent compacting
-                       $parserInstance = ObjectFactory::createObjectByConfiguredName('deco_compacting_xml_parser_class', array($parserInstance));
+                       $parserInstance = ObjectFactory::createObjectByConfiguredName('deco_compacting_xml_parser_class', [$parserInstance]);
                }
 
                // Parse the XML document
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-XML-TEMPLATE-ENGINE: Invoking parserInstance->parseXmlContent(content()=%d) ...', strlen($content)));
                $parserInstance->parseXmlContent($content);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-XML-TEMPLATE-ENGINE: EXIT!');
        }
 
        /**
index b46f50b8828fed9bb2d04debbadea1a49c77026e..0051dfcc158379aef3dea465451c4ec9f89cb097 100644 (file)
@@ -7,19 +7,21 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
 use Org\Mxchange\CoreFramework\Generic\FrameworkException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Socket\InvalidSocketException;
 
 // Import SPL stuff
 use \InvalidArgumentException;
 use \SplFileInfo;
+use \UnexpectedValueException;
 
 /**
  * This class contains static helper functions for console applications
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -44,7 +46,12 @@ class ConsoleTools extends BaseFrameworkSystem {
        /**
         * Default is that this class is noisy
         */
-       private static $quietResolver = FALSE;
+       private static $isQuietResolver = FALSE;
+
+       /**
+        * Cached values
+        */
+       private static $cache = [];
 
        /**
         * Protected constructor
@@ -56,7 +63,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                parent::__construct(__CLASS__);
 
                // Cache configuration entry
-               self::$quietResolver = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('quiet_dns_resolver');
+               self::$isQuietResolver = FrameworkBootstrap::getConfigurationInstance()->isEnabled('quiet_dns_resolver');
        }
 
        /**
@@ -66,6 +73,7 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        protected function isProxyUsed () {
                // Do we have cache?
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CONSOLE-TOOLS: CALLED!');
                if (!isset($GLOBALS[__METHOD__])) {
                        // Determine it
                        $GLOBALS[__METHOD__] = (
@@ -78,6 +86,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                }
 
                // Return cache
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: isUsed=%d', $GLOBALS[__METHOD__]));
                return $GLOBALS[__METHOD__];
        }
 
@@ -92,9 +101,10 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        protected function setupProxyTunnel (string $host, int $port, $socketResource) {
                // Validate parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: host=%s,port=%d,socketResource=%s - CALLED!', $host, $port, $socketResource));
                if (empty($host)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "host" is empty');
+                       throw new InvalidArgumentException('Parameter "host" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif ($port < 1) {
                        // Throw IAE
                        throw new InvalidArgumentException(sprintf('port=%d is not valid', $port));
@@ -121,14 +131,16 @@ class ConsoleTools extends BaseFrameworkSystem {
 
                // Add last new-line
                $proxyTunnel .= self::HTTP_EOL;
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONSOLE-TOOLS: proxyTunnel=' . $proxyTunnel);
 
                // Write request
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: Sending %d bytes to socketResource=%s (proxy tunnel) ...', strlen($proxyTunnel), $socketResource));
                fwrite($socketResource, $proxyTunnel);
 
                // Got response?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: feof(%s)=%d', $socketResource, intval(feof($socketResource))));
                if (feof($socketResource)) {
                        // No response received
+                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: response()=%d, feof! - EXIT!', count($response)));
                        return $response;
                }
 
@@ -141,6 +153,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                }
 
                // All fine!
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: respArray()=%d - EXIT!', count($respArray)));
                return $respArray;
        }
 
@@ -153,9 +166,10 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        protected function extractHostnameFromRawData (string $rawData) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: rawData=%s - CALLED!', $rawData));
                if (empty($rawData)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "rawData" is empty');
+                       throw new InvalidArgumentException('Parameter "rawData" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Default is invalid
@@ -165,13 +179,16 @@ class ConsoleTools extends BaseFrameworkSystem {
                $data = explode(PHP_EOL, $rawData);
 
                // "Walk" through it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: data()=%d', count($data)));
                foreach ($data as $line) {
                        // Trim it
                        $line = trim($line);
 
                        // Begins with a hash (#) = comment?
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: line=%s', $line));
                        if (substr($line, 0, 1) == '#') {
                                // Then skip it
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: line=%s - SKIPPED!', $line));
                                continue;
                        }
 
@@ -181,7 +198,11 @@ class ConsoleTools extends BaseFrameworkSystem {
                                $hostData = explode('=', $line);
 
                                // Make sure only a key=value pair goes through
-                               assert(count($hostData) == 2);
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: hostData()=%d', count($hostData)));
+                               if (count($hostData) < 2) {
+                                       // Ops, wrong count
+                                       throw new UnexpectedValueException(sprintf('hostData()=%d is unexpected, line=%s', count($hostData), $line), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
+                               }
 
                                // Try to get it and abort
                                $hostname = str_replace(
@@ -189,15 +210,18 @@ class ConsoleTools extends BaseFrameworkSystem {
                                        ['', ''],
                                        $hostData[1]
                                );
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: hostname=%s from hostData - BREAK!', $hostname));
                                break;
                        } else {
                                // Use it directly
                                $hostname = $line;
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: hostname=%s from line - BREAK!', $line));
                                break;
                        }
                }
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: hostname=%s - EXIT!', $hostname));
                return $hostname;
        }
 
@@ -212,12 +236,13 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        public static function resolveIpAddress (string $hostname) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: hostname=%s - CALLED!', $hostname));
                if (empty($hostname)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "hostname" is empty');
-               } elseif (self::$quietResolver !== TRUE) {
+                       throw new InvalidArgumentException('Parameter "hostname" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (self::$isQuietResolver !== TRUE) {
                        // Debug message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Host name to resolve is: %s',
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('[%s:] Host name to resolve is: %s',
                                __CLASS__,
                                $hostname
                        ));
@@ -240,89 +265,140 @@ class ConsoleTools extends BaseFrameworkSystem {
 
                // Resolve it
                // @TODO Here should the cacher be implemented
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: hostname=%s', $hostname));
                $ipResolved = gethostbyname($hostname);
 
                // Was it fine?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: ipResolved[%s]=%s', gettype($ipResolved), $ipResolved));
                if (($ipResolved !== false) && ($ipResolved != $hostname)) {
                        // Okay, this works!
                        $ipAddress = $ipResolved;
 
                        // Quiet?
-                       if (self::$quietResolver !== TRUE) {
+                       if (self::$isQuietResolver !== TRUE) {
                                // Debug message
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Resolved IP address is: %s',
+                               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('[%s:] Resolved IP address is: %s',
                                        __CLASS__,
                                        $ipAddress
                                ));
                        }
                } else {
                        // Problem while resolving IP address
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.',
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.',
                                __CLASS__,
                                $hostname
                        ));
                }
 
                // Return resolved IP
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: ipAddress=%s - EXIT!', $ipAddress));
                return $ipAddress;
        }
 
        /**
-        * Aquires the IP address of this host by reading the /etc/hostname file
-        * and solving it. It is now stored in configuration
+        * acquires this host's LAN name. It tries a varity of different source.
         *
-        * @return      $ipAddress      Aquired IPv4 address
+        * @return      $hostName       The acquired name of this host or something invalid
         */
-       public static function acquireSelfIpAddress () {
-               // Local IP by default
-               $ipAddress = '127.0.0.1';
+       public static function acquireHostname () {
+               // Is cache there?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CONSOLE-TOOLS: CALLED!');
+               if (!isset(self::$cache[__METHOD__])) {
+                       // Get a new instance
+                       $toolsInstance = new ConsoleTools();
 
-               // Get a new instance
-               $helperInstance = new ConsoleTools();
+                       // Get SplFileInfo instance
+                       $infoInstance = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hostname_file'));
 
-               // Get SplFileInfo instance
-               $infoInstance = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hostname_file'));
+                       // Init host name
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: infoInstance=%s', $infoInstance->__toString()));
+                       $hostname = 'host.invalid';
 
-               try {
-                       // Get a file pointer
-                       $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_class', array($infoInstance));
+                       // Try to check /etc/hostname first
+                       try {
+                               // Get a file pointer
+                               $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_class', [$infoInstance]);
 
-                       // Read the file
-                       $rawData = trim($fileInstance->readFromFile());
+                               // Read the file
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: fileInstance=%s', $fileInstance->__toString()));
+                               $rawData = trim($fileInstance->readFromFile());
 
-                       // Close the file
-                       $fileInstance->closeFile();
+                               // Close the file
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: rawData=%s', $rawData));
+                               $fileInstance->closeFile();
 
-                       // Extract hostname from it
-                       $hostname = $helperInstance->extractHostnameFromRawData($rawData);
+                               // Extract hostname from it
+                               $hostname = $toolsInstance->extractHostnameFromRawData($rawData);
 
-                       // Resolve the IP number
-                       $ipAddress = self::resolveIpAddress($hostname);
-               } catch (FileNotFoundException $e) {
-                       // Fall-back to 'SESSION_SVR' which found on my Sun Station
-                       if (isset($_SERVER['SESSION_SVR'])) {
-                               // Resolve it
-                               $ipAddress = self::resolveIpAddress($_SERVER['SESSION_SVR']);
-                       } elseif (isset($_SERVER['COMPUTERNAME'])) {
-                               // May happen on some Windows XP systems, so also try this
-                               $ipAddress = self::resolveIpAddress($_SERVER['COMPUTERNAME']);
-                       } else {
-                               // Could not find our hostname
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] WARNING: Cannot resolve my own IP address.',
-                                       $helperInstance->__toString()
+                               // Debug message
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: hostname=%s from /etc/hostname', $hostname));
+                       } catch (FileNotFoundException $e) {
+                               // Fall-back to 'SESSION_SVR' which found on my Sun Station
+                               if (isset($_SERVER['SESSION_SVR'])) {
+                                       // Resolve it
+                                       $hostname = $_SERVER['SESSION_SVR'];
+                               } elseif (isset($_SERVER['COMPUTERNAME'])) {
+                                       // May happen on some Windows XP systems, so also try this
+                                       $hostname = $_SERVER['COMPUTERNAME'];
+                               } else {
+                                       // Could not find our hostname
+                                       self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('[%s:] WARNING: Cannot acquire my own host name.',
+                                               $toolsInstance->__toString()
+                                       ));
+                               }
+
+                               // Debug message
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: hostname=%s from _SERVER array', $hostname));
+                       } catch (FrameworkException $e) {
+                               // Output debug message
+                               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('[%s:] Problem while resolving own IP address: [%s|%s]:%s',
+                                       $toolsInstance->__toString(),
+                                       $e->__toString(),
+                                       $e->getHexCode(),
+                                       $e->getMessage()
                                ));
                        }
-               } catch (FrameworkException $e) {
-                       // Output debug message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Problem while resolving own IP address: [%s|%s]:%s',
-                               $helperInstance->__toString(),
-                               $e->__toString(),
-                               $e->getHexCode(),
-                               $e->getMessage()
-                       ));
+
+                       // Set cache
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: Setting hostname=%s ...', $hostname));
+                       self::$cache[__METHOD__] = $hostname;
+               } else {
+                       // Get from cache
+                       $hostname = self::$cache[__METHOD__];
+               }
+
+               // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: hostname=%s - EXIT!', $hostname));
+               return $hostname;
+       }
+
+       /**
+        * acquires the IP address of this host by reading the /etc/hostname file
+        * and solving it. It is now stored in configuration
+        *
+        * @return      $ipAddress      acquired IPv4 address
+        */
+       public static function acquireSelfIpAddress () {
+               // Is cache there?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CONSOLE-TOOLS: CALLED!');
+               if (!isset(self::$cache[__METHOD__])) {
+                       // Get host name
+                       $hostname = self::acquireHostname();
+
+                       // Resolve the IP number
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: hostname=%s', $hostname));
+                       $ipAddress = self::resolveIpAddress($hostname);
+
+                       // Set cache
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: Setting ipAddress=%s ...', $ipAddress));
+                       self::$cache[__METHOD__] = $ipAddress;
+               } else {
+                       // Get it from cache
+                       $ipAddress = self::$cache[__METHOD__];
                }
 
                // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: ipAddress=%s - EXIT!', $ipAddress));
                return $ipAddress;
        }
 
@@ -345,17 +421,19 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        public static function determineExternalAddress () {
                // Get helper instance
-               $helperInstance = new ConsoleTools();
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CONSOLE-TOOLS: CALLED!');
+               $toolsInstance = new ConsoleTools();
 
                // First get a socket
                // @TODO Add some DNS caching here
 
                // Open connection
-               if ($helperInstance->isProxyUsed() === true) {
+               if ($toolsInstance->isProxyUsed() === true) {
                        // Resolve hostname into IP address
                        $ipAddress = self::resolveIpAddress(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host'));
 
                        // Connect to host through proxy connection
+                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: ipAddress=%s', $ipAddress));
                        $socketResource = fsockopen($ipAddress, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
                } else {
                        // Connect to host directly
@@ -363,28 +441,29 @@ class ConsoleTools extends BaseFrameworkSystem {
                }
 
                // Check if there was an error else
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: socketResource[%s]=%s,errorNo=%d,errorStr=%s', gettype($socketResource), $socketResource, $errorNo, $errorStr));
                if ($errorNo > 0) {
                        // Then throw again
-                       throw new InvalidSocketException(array($helperInstance, $socketResource, $errorNo, $errorStr), BaseFrameworkSystem::EXCEPTION_INVALID_SOCKET);
+                       throw new InvalidSocketException([$toolsInstance, $socketResource, $errorNo, $errorStr], BaseFrameworkSystem::EXCEPTION_INVALID_SOCKET);
                }
 
                // Prepare the GET request
-               $request  = 'GET ' . ($helperInstance->isProxyUsed() === true ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
+               $request  = 'GET ' . ($toolsInstance->isProxyUsed() === true ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
                $request .= 'Host: shipsimu.org' . self::HTTP_EOL;
                $request .= 'User-Agent: ' . self::HTTP_USER_AGENT . self::HTTP_EOL;
                $request .= 'Connection: close' . self::HTTP_EOL;
 
                // Do we use proxy?
-               if ($helperInstance->isProxyUsed() === true) {
+               if ($toolsInstance->isProxyUsed() === true) {
                        // CONNECT method?
-                       if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
+                       if (FrameworkBootstrap::getConfigurationInstance()->isEnabled('proxy_connect_method')) {
                                // Setup proxy tunnel
-                               $response = $helperInstance->setupProxyTunnel('shipsimu.org', 80, $socketResource);
+                               $response = $toolsInstance->setupProxyTunnel('shipsimu.org', 80, $socketResource);
 
                                // If the response is invalid, abort
                                if ((count($response) == 3) && (empty($response[0])) && (empty($response[1])) && (empty($response[2]))) {
                                        // Invalid response!
-                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, true));
+                                       $toolsInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, true));
                                }
                        } else {
                                // Add header for proxy
@@ -396,6 +475,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                $request .= self::HTTP_EOL;
 
                // Send it to the socket
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: Writing %d bytes to socketResource=%s ...', strlen($request), $socketResource));
                fwrite($socketResource, $request);
 
                // Init IP (this will always be the last line)
@@ -404,11 +484,14 @@ class ConsoleTools extends BaseFrameworkSystem {
                // And read the reply
                while (!feof($socketResource)) {
                        // Get line
+                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: feof()=%d', intval(feof($socketResource))));
                        $externalAddress = trim(fgets($socketResource, 128));
 
                        // Detect HTTP response
+                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CONSOLE-TOOLS: externalAddress=%s', $externalAddress));
                        if ((substr($externalAddress, 0, 7) == 'HTTP/1.') && (substr($externalAddress, -6, 6) != '200 OK')) {
                                // Stop processing
+                               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CONSOLE-TOOLS: BREAK!');
                                break;
                        }
                }
@@ -417,7 +500,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                fclose($socketResource);
 
                // Return determined external address
-               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONSOLE-TOOLS: Resolved external address: ' . $externalAddress);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: externalAddress=%s - EXIT!', $externalAddress));
                return $externalAddress;
        }
 
@@ -430,6 +513,7 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        public static function analyzeEnvironmentForType () {
                // Default is the console
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CONSOLE-TOOLS: CALLED!');
                $type = 'console';
 
                // Now, do we have a request method, or query string set?
@@ -439,6 +523,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                }
 
                // Return it
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: type=%s - EXIT!', $type));
                return $type;
        }
 
@@ -457,6 +542,7 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        public static function analyzeEnvironmentForClassType () {
                // Default is the console
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CONSOLE-TOOLS: CALLED!');
                $type = 'console';
 
                // Now, do we have a request method, or query string set?
@@ -466,6 +552,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                }
 
                // Return it
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CONSOLE-TOOLS: type=%s - EXIT!', $type));
                return $type;
        }
 
index 023ba4b6a793d8d54ad6d4cebf9b47984c8d9de5..920127ed6cacf5c6767ede07182e12e0bf1fc48c 100644 (file)
@@ -17,7 +17,7 @@ use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -307,7 +307,7 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
                $frontendInstance = ObjectFactory::createObjectByConfiguredName('user_db_frontend_class');
 
                // Get the primary key back from the frontend
-               $primaryKey = $frontendInstance->getPrimaryKeyValue();
+               $primaryKey = $frontendInstance->generatePrimaryKey();
 
                // Get that field
                $primaryValue = $this->getField($primaryKey);
index 41630078de26fb7da199506eb99b5eb6e0e55f15..0ffd9eaea0728309fede32fa46ee74ccde5b6521 100644 (file)
@@ -3,18 +3,22 @@
 namespace Org\Mxchange\CoreFramework\User\Guest;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Manager\Guest\ManageableGuest;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\User\BaseUser;
 use Org\Mxchange\CoreFramework\User\UsernameMissingException;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * A generic class for handling guests
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -84,7 +88,13 @@ class Guest extends BaseUser implements ManageableGuest, Registerable {
         * @throws      UsernameMissingException        If the username does not exist
         * @throws      UserNoGuestException            If the user is no guest account
         */
-       public static final function createGuestByUsername ($userName) {
+       public static final function createGuestByUsername (string $userName) {
+               // Check parameter
+               if (empty($userName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Paramter "userName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get a new instance
                $userInstance = new Guest();
 
@@ -111,7 +121,13 @@ class Guest extends BaseUser implements ManageableGuest, Registerable {
         * @param       $email                  Email address of the user
         * @return      $userInstance   An instance of this user class
         */
-       public static final function createGuestByEmail ($email) {
+       public static final function createGuestByEmail (string $email) {
+               // Check parameter
+               if (empty($email)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Paramter "email" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get a new instance
                $userInstance = new Guest();
 
index 27baa42b73394ae55ebcd48687810e8fcb134e8b..c6a98a118974ce87a24329f737fb8e4d2f97bc81 100644 (file)
@@ -6,17 +6,21 @@ namespace Org\Mxchange\CoreFramework\User\Login;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Manager\Login\ManageableMember;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\User\BaseUser;
 use Org\Mxchange\CoreFramework\User\UsernameMissingException;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * A generic class for handling users
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -54,7 +58,13 @@ class Member extends BaseUser implements ManageableMember, Registerable {
         * @throws      UsernameMissingException        If the username does not exist
         * @throws      UnexpectedGuestAccountException         If the user status is 'guest'
         */
-       public static final function createMemberByUsername ($userName) {
+       public static final function createMemberByUsername (string $userName) {
+               // Check parameter
+               if (empty($userName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "userName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get a new instance
                $userInstance = new Member();
 
@@ -81,7 +91,13 @@ class Member extends BaseUser implements ManageableMember, Registerable {
         * @param       $email                  Email address of the user
         * @return      $userInstance   An instance of this user class
         */
-       public static final function createMemberByEmail ($email) {
+       public static final function createMemberByEmail (string $email) {
+               // Check parameter
+               if (empty($email)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "email" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Get a new instance
                $userInstance = new Member();
 
index bb28ff037ca55126e388948306a7e5993c90b326..884a29f3c50cb1a1e09e0d409295e38f5c3a67ad 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Utils\Arrays;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
@@ -15,7 +16,7 @@ use \OutOfBoundsException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -54,12 +55,13 @@ final class ArrayUtils extends BaseFrameworkSystem {
         */
        public static function mapNumericKeysToAssociative (array $numericArray, array $mapping) {
                // Validate parameters
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('ARRAY-UTILS: numericArray()=%d,mapping()=%d - CALLED!', count($numericArray), count($mapping)));
                if (count($numericArray) == 0) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Array "numericArray" is empty');
+                       throw new InvalidArgumentException('Array "numericArray" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (count($mapping) == 0) {
                        // Throw it again
-                       throw new InvalidArgumentException('Array "mapping" is empty');
+                       throw new InvalidArgumentException('Array "mapping" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (count($numericArray) != count($mapping)) {
                        // Throw it yet again
                        throw new InvalidArgumentException(sprintf('numericArray()=%d does not match mapping()=%d', count($numericArray), count($mapping)));
@@ -71,9 +73,10 @@ final class ArrayUtils extends BaseFrameworkSystem {
                // "Walk" over the mapping array
                foreach ($mapping as $sourceIndex => $targetName) {
                        // Is the source index not there?
+                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('ARRAY-UTILS: sourceIndex=%d,targetName=%s', $sourceIndex, $targetName));
                        if (!array_key_exists($sourceIndex, $numericArray)) {
                                // Should always be there!
-                               throw new OutOfBoundsException(sprintf('numericArray[%d] does not exist.', $sourceIndex));
+                               throw new OutOfBoundsException(sprintf('numericArray[%d] does not exist.', $sourceIndex), FrameworkInterface::EXCEPTION_OUT_OF_BOUNDS);
                        }
 
                        // "Map" (copy) it to new array
@@ -81,6 +84,7 @@ final class ArrayUtils extends BaseFrameworkSystem {
                }
 
                // Return fully mapped array
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('ARRAY-UTILS: mappedArray()=%d - EXIT!', count($mappedArray)));
                return $mappedArray;
        }
 
index 5db28e4a3e005ee030d032034faaef4d43afa5bc..69885f9becb021a55ba7fe0a616b132bcf58368a 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Utils\Crypto;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
@@ -15,7 +16,7 @@ use \LogicException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -59,13 +60,18 @@ final class CryptoUtils extends BaseFrameworkSystem {
         */
        private static function staticInitializer () {
                // Is $hashFunction set?
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPRO-UTILS: self::hashFunction[]=%s - CALLED!', gettype(self::$hashFunction)));
                if (empty(self::$hashFunction)) {
                        // Get instance
                        $dummyInstance = new CryptoUtils();
 
                        // Set hash function from configuration
+                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CRYPRO-UTILS: Setting self::hashFunction from configuration entry ...');
                        self::$hashFunction = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('crypto_hash_function_name');
                }
+
+               // Trace message
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPRO-UTILS: EXIT!');
        }
 
        /**
@@ -79,23 +85,25 @@ final class CryptoUtils extends BaseFrameworkSystem {
         */
        public static final function hash (string $str) {
                // Validate parameter/mhash extension
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRYPTO-UTILS: str=%s - CALLED!', $str));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPTO-UTILS: str=%s - CALLED!', $str));
                if (empty($str)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "str" is empty');
+                       throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!extension_loaded('hash')) {
                        // Should be there
-                       throw new LogicException('Extension ext-hash not loaded');
+                       throw new LogicException('Extension ext-hash not loaded', FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Invoke static initializer
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPRO-UTILS: Invoking self::staticInitializier() ...');
                self::staticInitializer();
 
                // Hash given string with (better secure) hasher
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPRO-UTILS: Invoking hash(self::%s,%s,true) ...', $hashFunction, $str));
                $hash = hash(self::$hashFunction, $str, true);
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRYPTO-UTILS: hash{}=0x%s - EXIT!', bin2hex($hash)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPTO-UTILS: hash{}=0x%s - EXIT!', bin2hex($hash)));
                return $hash;
        }
 
@@ -107,15 +115,18 @@ final class CryptoUtils extends BaseFrameworkSystem {
         */
        public static final function getHashLength () {
                // Invoke static initializer
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CRYPRO-UTILS: Invoking self::staticInitializer() ... - CALLED!');
                self::staticInitializer();
 
                // Is it cashed?
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CRYPRO-UTILS: self::hashLength[%s]=%d', gettype(self::$hashLength), self::$hashLength));
                if (is_null(self::$hashLength)) {
                        // No, then hash a string and save its length.
                        self::$hashLength = strlen(self::hash('abc123'));
                }
 
                // Return it
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CRYPRO-UTILS: self::hashLength=%d - EXIT!', self::$hashLength));
                return self::$hashLength;
        }
 
index a610a6280972679d3e17a5022240df913f342d3d..aafd71d60021b139cba508934fd2ddb8067ee249 100644 (file)
@@ -4,14 +4,18 @@ namespace Org\Mxchange\CoreFramework\Utils\Numbers;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * A number utility class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -42,10 +46,18 @@ final class NumberUtils extends BaseFrameworkSystem {
        /**
         * Filter a given number into a localized number
         *
-        * @param       $value          The raw value from e.g. database
+        * @param       $value          The raw float value from e.g. database
         * @return      $localized      Localized value
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
-       public static function doFilterFormatNumber ($value) {
+       public static function doFilterFormatNumber (float $value) {
+               // Check value
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: value=%s - CALLED!', $value));
+               if ($value < 0) {
+                       // Not valid value
+                       throw new InvalidArgumentException(sprintf('value=%s cannot be below zero', $value));
+               }
+
                // Generate it from config and localize dependencies
                switch (FrameworkBootstrap::getLanguageInstance()->getLanguageCode()) {
                        case 'de': // German format is a bit different to default
@@ -58,6 +70,7 @@ final class NumberUtils extends BaseFrameworkSystem {
                }
 
                // Return it
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: localized=%s - CALLED!', $localized));
                return $localized;
        }
 
@@ -68,8 +81,16 @@ final class NumberUtils extends BaseFrameworkSystem {
         *
         * @param       $timestamp      Timestamp to prepare (filter) for display
         * @return      $readable       A readable timestamp
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
-       public static function doFilterFormatTimestamp ($timestamp) {
+       public static function doFilterFormatTimestamp (string $timestamp = NULL) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: timestamp[%s]=%s - CALLED!', gettype($timestamp), $timestamp));
+               if (empty($timestamp)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "timestamp" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Default value to return
                $readable = '???';
 
@@ -103,6 +124,7 @@ final class NumberUtils extends BaseFrameworkSystem {
                }
 
                // Return the stamp
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: readable=%s - EXIT!', $readable));
                return $readable;
        }
 
@@ -113,24 +135,35 @@ final class NumberUtils extends BaseFrameworkSystem {
         * @param       $castValue      Whether to cast the value to double. Do only use this to secure numbers from Requestable classes.
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $formatted      The (hopefully) secured numbered value
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public static function bigintval (string $num, bool $castValue = true, bool $assertMismatch = false) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: num=%s,castValue=%d,assertMismatch=%d - CALLED!', $num, intval($castValue), intval($assertMismatch)));
+               if ($num === '') {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "num" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Filter all numbers out
                $formatted = preg_replace('/[^0123456789]/', '', $num);
 
                // Shall we cast?
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NUMBER-UTILS: formatted=%s', $formatted));
                if ($castValue === true) {
                        // Cast to biggest numeric type, int is not enough for this cast
                        $formatted = (double) $formatted;
                }
 
                // Assert only if requested
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('NUMBER-UTILS: formatted[%s]=%s', gettype($formatted), $formatted));
                if ($assertMismatch === true) {
                        // Has the whole value changed?
                        assert(('' . $formatted . '' != '' . $num . '') && (!is_null($num)));
                }
 
                // Return result
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('NUMBER-UTILS: formatted[%s]=%s - EXIT!', gettype($formatted), $formatted));
                return $formatted;
        }
 
index 8f48bf9d85c60662103b3500ab71e41aa448237b..972035c12e0b827bc14a177fdc97b2166d078d56 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Utils\Strings;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Configuration\FrameworkConfiguration;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
@@ -16,7 +17,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -128,9 +129,11 @@ final class StringUtils extends BaseFrameworkSystem {
         */
        private function __construct () {
                // Call parent constructor
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STRING-UTILS: CONSTRUCTED!');
                parent::__construct(__CLASS__);
 
                // Is one not set?
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: self::archArrayElement=%d', self::$archArrayElement));
                if (empty(self::$archArrayElement)) {
                        // Set array element
                        self::$archArrayElement = (PHP_INT_SIZE === 8 ? 64 : 32);
@@ -139,6 +142,9 @@ final class StringUtils extends BaseFrameworkSystem {
                        self::$thousands = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('thousands_separator');
                        self::$decimals = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('decimals_separator');
                }
+
+               // Trace message
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('STRING-UTILS: EXIT!');
        }
 
        /**
@@ -151,15 +157,17 @@ final class StringUtils extends BaseFrameworkSystem {
         */
        public static function convertDashesToUnderscores (string $str) {
                // Validate parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: str=%s - CALLED!', $str));
                if (empty($str)) {
                        // Entry is empty
-                       throw new InvalidArgumentException('Parameter "str" is empty');
+                       throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Convert them all
                $str = str_replace('-', '_', $str);
 
                // Return converted string
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: str=%s - EXIT!', $str));
                return $str;
        }
 
@@ -173,7 +181,7 @@ final class StringUtils extends BaseFrameworkSystem {
         */
        public static function encodeData ($rawData) {
                // Make sure no objects or resources pass through
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: rawData[]=%s - CALLED!', gettype($rawData)));
+               //* N NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: rawData[]=%s - CALLED!', gettype($rawData)));
                if (is_object($rawData) || is_resource($rawData)) {
                        // Not all variable types should be serialized here
                        throw new InvalidArgumentException(sprintf('rawData[]=%s cannot be serialized.', gettype($rawData)));
@@ -186,7 +194,7 @@ final class StringUtils extends BaseFrameworkSystem {
                $encoded = self::packString(json_encode($rawData));
 
                // And return it
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: encoded()=%d - EXIT!', strlen($encoded)));
+               //* N NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: encoded()=%d - EXIT!', strlen($encoded)));
                return $encoded;
        }
 
@@ -199,10 +207,10 @@ final class StringUtils extends BaseFrameworkSystem {
         */
        public static final function convertToClassName (string $str) {
                // Is the parameter valid?
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: str=%s - CALLED!', $str));
+               //* N NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: str=%s - CALLED!', $str));
                if (empty($str)) {
                        // No empty strings, please
-                       throw new InvalidArgumentException('Parameter "str" is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
+                       throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (!isset(self::$cache[$str])) {
                        // Init class name
                        $className = '';
@@ -211,19 +219,19 @@ final class StringUtils extends BaseFrameworkSystem {
                        $str = self::convertDashesToUnderscores($str);
 
                        // Now use that underscores to get classname parts for hungarian style
-                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: str=%s - AFTER!', $str));
+                       //* N NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: str=%s - AFTER!', $str));
                        foreach (explode('_', $str) as $strPart) {
                                // Make the class name part lower case and first upper case
                                $className .= ucfirst(strtolower($strPart));
                        }
 
                        // Set cache
-                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: self[%s]=%s - SET!', $str, $className));
+                       //* N NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: self[%s]=%s - SET!', $str, $className));
                        self::$cache[$str] = $className;
                }
 
                // Return class name
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: self[%s]=%s - EXIT!', $str, $className));
+               //* N NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: self[%s]=%s - EXIT!', $str, $className));
                return self::$cache[$str];
        }
 
@@ -239,12 +247,14 @@ final class StringUtils extends BaseFrameworkSystem {
         */
        public static function formatCurrency (float $value, string $currency = '&euro;', int $decNum = 2) {
                // Init instance
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: value=%s,currency=%s,decNum=%d - CALLED!', $value, $currency, $decNum));
                $dummyInstance = new StringUtils();
 
                // Reformat the US number
                $price = number_format($value, $decNum, self::$decimals, self::$thousands) . $currency;
 
                // Return as string...
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: price=%s - EXIT!', $price));
                return $price;
        }
 
@@ -257,8 +267,16 @@ final class StringUtils extends BaseFrameworkSystem {
         *
         * @param       $hex    Hexadecimal string
         * @return      $dec    Decimal number
+        * @throws      InvalidArgumentException        If a paramter is invalid
         */
        public static function hex2dec (string $hex) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: hex=%s - CALLED!', $hex));
+               if (empty($hex)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "hex" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Convert to all lower-case
                $hex = strtolower($hex);
 
@@ -277,6 +295,7 @@ final class StringUtils extends BaseFrameworkSystem {
                }
 
                // Return the decimal number
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: sign=%s,dec=%s - EXIT!', $sign, $dec));
                return $sign . $dec;
        }
 
@@ -290,10 +309,18 @@ final class StringUtils extends BaseFrameworkSystem {
         * @param       $dec            Decimal number, even with negative sign
         * @param       $maxLength      Optional maximum length of the string
         * @return      $hex    Hexadecimal string
+        * @throws      InvalidArgumentException        If a paramter is invalid
         */
-       public static function dec2hex (string $dec, int $maxLength = 0) {
-               // maxLength can be zero or devideable by 2
-               assert(($maxLength == 0) || (($maxLength % 2) == 0));
+       public static function dec2hex (int $dec, int $maxLength = 0) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: dec=%d,maxLength=%d - CALLED!', $dec, $maxLength));
+               if ($dec < 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('dec=%d is below zero', $dec));
+               } elseif ($maxLength != 0 && ($maxLength % 2) != 0) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('maxLength=%d is not dividable by 2 or zero', $maxLength));
+               }
 
                // Detect sign (negative/positive numbers)
                $sign = '';
@@ -323,6 +350,7 @@ final class StringUtils extends BaseFrameworkSystem {
                }
 
                // Return the hexadecimal string
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: sign=%s,hex=%s - EXIT!', $sign, $hex));
                return $sign . $hex;
        }
 
@@ -331,15 +359,25 @@ final class StringUtils extends BaseFrameworkSystem {
         *
         * @param       $asc    The ASCII string to be converted
         * @return      $dec    Decimal number
+        * @throws      InvalidArgumentException        If a paramter is invalid
         */
        public static function asc2dec (string $asc) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: asc=%s - CALLED!', $asc));
+               if (empty($asc)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "asc" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Convert it into a hexadecimal number
                $hex = bin2hex($asc);
 
                // And back into a decimal number
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: hex=%s', $hex));
                $dec = self::hex2dec($hex);
 
                // Return it
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: dec=%d - EXIT!', $dec));
                return $dec;
        }
 
@@ -348,15 +386,25 @@ final class StringUtils extends BaseFrameworkSystem {
         *
         * @param       $dec            Decimal number
         * @return      $asc    An ASCII string
+        * @throws      InvalidArgumentException        If a paramter is invalid
         */
-       public static function dec2asc (string $dec) {
+       public static function dec2asc (int $dec) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: dec=%d - CALLED!', $dec));
+               if ($dec < 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException(sprintf('dec=%d is below zero', $dec));
+               }
+
                // First convert the number into a hexadecimal string
                $hex = self::dec2hex($dec);
 
                // Then convert it into the ASCII string
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: hex=%s', $hex));
                $asc = self::hex2asc($hex);
 
                // Return it
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: asc=%s - EXIT!', $asc));
                return $asc;
        }
 
@@ -366,11 +414,18 @@ final class StringUtils extends BaseFrameworkSystem {
         *
         * @param       $hex    Hexadecimal string
         * @return      $asc    An ASCII string
+        * @throws      InvalidArgumentException        If a paramter is invalid
         */
-       public static function hex2asc ($hex) {
+       public static function hex2asc (string $hex) {
                // Check for length, it must be devideable by 2
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('hex='.$hex);
-               assert((strlen($hex) % 2) == 0);
+               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: hex=%s - CALLED!', $hex));
+               if (empty($hex)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "hex" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif ((strlen($hex) % 2) != 0) {
+                       // Throw it again
+                       throw new InvalidArgumentException(sprintf('hex=%s length not dividable by 2', $hex));
+               }
 
                // Walk the string
                $asc = '';
@@ -383,6 +438,7 @@ final class StringUtils extends BaseFrameworkSystem {
                }
 
                // Return the final string
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: asc=%s - EXIT!', $asc));
                return $asc;
        }
 
@@ -392,17 +448,25 @@ final class StringUtils extends BaseFrameworkSystem {
         *
         * @param       $str            Unpacked string
         * @return      $packed         Packed string
+        * @throws      InvalidArgumentException        If a paramter is invalid
         * @todo        Improve documentation
         */
        private static function packString (string $str) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: str=%s - CALLED!', $str));
+               if (empty($str)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "str" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // First compress the string (gzcompress is okay)
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: str=%s - CALLED!', $str));
                $str = gzcompress($str);
 
                // Init variable
                $packed = '';
 
                // And start the "encoding" loop
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: Looping through str()=%d ...', strlen($str)));
                for ($idx = 0; $idx < strlen($str); $idx += self::$packingData[self::$archArrayElement]['step']) {
                        $big = 0;
                        for ($i = 0; $i < self::$packingData[self::$archArrayElement]['step']; $i++) {
@@ -425,13 +489,13 @@ final class StringUtils extends BaseFrameworkSystem {
 
                        // Create chunk
                        $chunk = str_pad(pack(self::$packingData[self::$archArrayElement]['format'], $l, $r), 8, '0', STR_PAD_LEFT);
-                       //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: big=%d,chunk(%d)=%s', $big, strlen($chunk), md5($chunk)));
+                       //* N NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: big=%d,chunk(%d)=%s', $big, strlen($chunk), md5($chunk)));
 
                        $packed .= $chunk;
                }
 
                // Return it
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STRING-UTILS: packed=%s - EXIT!', $packed));
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: packed=%s - EXIT!', $packed));
                return $packed;
        }
 
@@ -441,18 +505,28 @@ final class StringUtils extends BaseFrameworkSystem {
         * @param       $num    A string consisting only chars between 0 and 9
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $ret    The (hopefully) secured hext-numbered value
+        * @throws      InvalidArgumentException        If a paramter is invalid
         */
        public static function hexval (string $num, bool $assertMismatch = false) {
+               // Check parameter
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: num=%s,assertMismatch=%d - CALLED!', $num, intval($assertMismatch)));
+               if (empty($num)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "num" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Filter all numbers out
                $ret = preg_replace('/[^0123456789abcdefABCDEF]/', '', $num);
 
                // Assert only if requested
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('STRING-UTILS: ret=%s', $ret));
                if ($assertMismatch === true) {
                        // Has the whole value changed?
                        assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
                }
 
                // Return result
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('STRING-UTILS: ret=%s - EXIT!', $ret));
                return $ret;
        }
 
index aa43e48585b115868a5e80f5efb6ad428c4c9de5..c6686aa62a0ed641958c8b54d54c47116315de10 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Visitor\BaseVisitor;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 71205b8a9cc319e5c6ccc732d7f5d3ec1ba614cc..205b7213dd90ad1c90a31d51701a622c5b3b5edb 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b0876cdc0a8960c9117edf8a604f10daa68d5c81..4b85db121347e29e0b8666c4b0da69fa040f9c22 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2eda02c06c5c43fc376553dcb8d94621f3db4132..d100b6e079d60ae87a375cee3eab8a0f05c67cd2 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0f4f435c6c75e80f8ecbec995b49ccdc945d539b..44c75c9affc0623be9c541200e6520718058c31a 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 3856c81fdbefd227fea7964fd556b4221bdfa9f2..3806e0ce83b9ab611e9ff40616089dc4a8396882 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index f797d43bba81cf07346c2033b9bd8a80f08d9e52..ec3232e1932d5cb54db05795ee49c47fe7425562 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 27a4f0d3b60dd86ddc587607b818186699644516..c08687a23ec5665a14bf48e82c54a8a3b8f3ca8b 100644 (file)
@@ -12,7 +12,7 @@ use \ReflectionException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8aa3e1b0a63d0271fea405b7792d4941ce211b0e..0f6709e3ac45e74cf573767c9b857edcdf62f6e2 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Rename to CompressorMismatchException
index 678275bda560ef635c7346e0521e65140c7fb9df..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 100644 (file)
@@ -1,54 +1,2 @@
 <?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Configuration;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * Thrown when the value variable type is NULL, an array, an object or a
- * resource as these values shall not be set as configuration values. Please use
- * FrameworkArrayObject instead!
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- * @todo               These are invalid argument exceptions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class ConfigValueTypeUnsupportedException extends FrameworkException {
-       /**
-        * The super constructor for all exceptions
-        *
-        * @param       $message        Message data array
-        * @param       $code           Error code
-        * @return      void
-        */
-       public function __construct (array $messageArray, int $code) {
-               // Construct message
-               $message = sprintf('[%s:%d] Configuration key %s has unspported value type %s.',
-                       $messageArray[0]->__toString(),
-                       $this->getLine(),
-                       $messageArray[1],
-                       gettype($messageArray[2])
-               );
-
-               // Call parent exception constructor
-               parent::__construct($message, $code);
-       }
-
-}
+// @DEPRECATED
index 606f2255b305796cd1d4c2ebb3fb0a054098ddce..42dda7b7d81928c363b54799cb145494516da081 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Rename this class to NoFoundEntryException
index 945f1da14fc30fb87e976682da3289c12a8a8bc9..fda665f9575a2cfdaa531d89d022dbdb8fd17723 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f66a9f91bb3dbe902b7da0208dd1daac382d2c7d..608c77c0e03be2a000850e0e1bff8189e470c925 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index dfd2a54f26b4007513923d009cd05863e0160733..2610e5a5db91aa45643c3832b195b69a84435c18 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d1091a01454fec0084f8c9be2379090f9f2b4bf7..7b7c3c3369cfec1ff198b0bcf9b1917f0ff37afb 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 3cfde98400544a076d6017ee7f9e4d2585b255ed..a3f43a9127f2197b86a1449d49ec3857a952fa62 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 7e663cb7ef87692499ee8e88b8452888fb78d0f3..78998345bf8d630d23177d6d55ece18f0c8bc707 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * 
index a0d2afdc4ef0b2a38eb5be976c533deeecf3b433..e03a53dd513ef31997d0da0be44f4a823351f076 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index f889c1c76a764bc870fc34217db05d3868518527..59954b240be379a314881354c3704e486ced4e6f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Database\DatabaseException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index ad0fae5b8d1bc04f73b4419587fb735b1739855a..3c3f9cbd01b99e1315bfd5a64ab078426d9ab249 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Database\DatabaseException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this
index 94618242ec686fe315d002f7b73a8ebce11e759e..145d71586d6e2e49d01646e040930774530662fa 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Database\DatabaseException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Please don't use this
index 814141fc8fff978ac5c0ace29ef6b592cb40aa72..207b555edfbee7903fdf276a68f747e6d8a6a20e 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Database\DatabaseException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Please don't use this
index 8b5d6a1b5491af4cd1323f51b1c08f2775863145..48876df99ef7e4c7c13b37368b9d82b3b4cc93db 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 65008bbc39b4633bf60001e71b722dfddf7c00d3..29f39bffe4814c861936a16d2d4b6916637285ba 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 789fa6801cf8aada1fc2753e90b1fec4815d0de5..eb5c6ed7c3b0a80699bbd0676a1b2eb58d509248 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index 0cca6d34a69a02f038acf016ce04ae406b3cd08f..1d3a5477ec94bec670bc916e4ce3e80780b0b1cb 100644 (file)
@@ -14,7 +14,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index 4c6ad606cbaa179dc14b45e885c33437e48e5ccc..868b0518ead98fc9eea4e714eacfc121bc61b78e 100644 (file)
@@ -13,7 +13,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index 1c25ac57c28a38f03df20e724a740bc6d99b2efc..6739e519c5f9d5efa12340a0ddf77635b071f4db 100644 (file)
@@ -13,7 +13,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index 538a35f852692c4b4ba0f9c73911246f40dfc44c..7e40202035cdcaaa3c23d671f7702febee985dd8 100644 (file)
@@ -13,7 +13,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 27db56c48aae9b4f322e376220122818070c434d..f1dba9958cc2326e752327319e1ddca43651d098 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index c044176f3a9d14e26f6b100320a667bf63dfc489..799b8af77ed1b7dc0124689a775cef940ea6f4cf 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 69b6caed6ad2d7d7d9696e9131b1d9da9e3f35d6..9e720b224aae8bcd98457a443d4f597f7c74517e 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index f1432e39de8813658974308dbcd1e7dab9406ced..0efe33efbd2cd2959ff3bb0390895a4247d8bc17 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 321042ed83d262eaa0468dea1e8987ffd898c972..9a622479eb25c4c4d78d62a885c277e40356cc16 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 69e23960f7fe5bf2f2f6285a068f68350b703b51..a412cb2586f8701f401b92e0d6cc24f219163593 100644 (file)
@@ -14,7 +14,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index ad3a6e3e231632e697a9da870b13bdf264e89773..c27df2bbe4e8b649cb037c3f4947462063d5cf00 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index fe6a96eadc43427ec591f6d01e48f969bc06ab93..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 100644 (file)
@@ -1,51 +1,2 @@
 <?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Chain\Filter;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown in a filter chain to stop processing further filters
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @deprecated Don't use this anymore
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class InvalidFilterChainException extends FrameworkException {
-       /**
-        * The super constructor for all exceptions
-        *
-        * @param       $filterInstance         Instance of a filter class
-        * @param       $code                           Exception code for better debugging
-        * @return      void
-        */
-       public function __construct (array $filterArray, int $code) {
-               // Construct the message
-               $message = sprintf('[%s:%d] Filter chain %s is not initialized.',
-                       $filterArray[0]->__toString(),
-                       $this->getLine(),
-                       $filterArray[1]
-               );
-
-               // Call the parent exception
-               parent::__construct($message, $code);
-       }
-
-}
+// @DEPRECATED
index 0ce1b0db6fa96e0f1a5229dfc552716015997ee9..221ed4931e60b6d83460aa99a6760dc69fc5ecc9 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 5e0aa133c7bb19e9459e7197dad23cc6b4c5d971..8a7af6ba79cdb4699ecf3e8e8b5b4e67fcd5a69a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 9aaddd75448a11524f5cf8add418cf9122ff217b..a0332a57a7144a9147dc14230d055e29652a1535 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Helper\BaseHelper;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 56463368d8edad5836a8b7a6ed4526b6033a656d..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 100644 (file)
@@ -1,51 +1,2 @@
 <?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Deprecated;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when a group was added twice
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @deprecated Don't use this anymore
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class HelperGroupAlreadyCreatedException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param       $messageArray   Array containing exception data
-        * @param       $code           Code number for the exception
-        * @return      void
-        */
-       public function __construct (array $messageArray, int $code) {
-               // Add a message around the missing class
-               $message = sprintf('[%s:%d] Group %s already opened before.',
-                       $messageArray[0]->__toString(),
-                       $this->getLine(),
-                       $messageArray[1]
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-
-}
+// @DEPRECATED
index e3b26fb0756cefad8b0a451d860428f1d346f6f0..2063b772c8a5cc771bc4dfd9e28d01352ce50015 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index c3e3b6c155351315db3cf8e65000a77499bb7c82..5363efc270e826b1532054f21ac383d517076eb3 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 54694d66bbe343eab8de56a8a50e8a34c6558194..ec0eba946ca9a9796513f8760d89f66bf06c5a25 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Helper\BaseHelper;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 6a96ed3da2e1e84fa551df104aa3d1eb54f2791c..f8606c79eeea37b5db772476c07821791777b07f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 341b1d6ee461e25304d043350f6b80f63eae9a23..dceaae8a4689cb5130e2c9aa693ef2fee84aa952 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 31d08eb257dc6fd5285bb5b175ef98c7b94400f5..bc089adaff8ee862f7413b703cc349cbea08366a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3b7988697dba0d52c2ec5ad7e2eeac9c6a75d104..36f2c1dd1b101000fb2074aaa5dfd7f4a5e54204 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index 7e924c9b49283d301265d48dafde14c4e32fdfb8..318ad168ccce276c8eaebc4082e135d490e612b2 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Please don't use this anymore
index 6b65eaa04747b4f29651389c8ec966dd1aa9fbd9..e88999fd8b137e80491eca5b206c09e11cca53b1 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3e14f3e20759ee1903538d0fbb86341542239f8b..c6359ad6447f64eea2b8c99ad37b7647458509b0 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 39f2e8d83de5409d785a3b8833d5e032ccad18d0..cae9030e2daf3cf5e1418c3d1b397b69170a450e 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index c96d12b8cf2ed8dfe54f9aabafeb850ca11c5b9a..ba7e536d9d52f9ea62ffdd1e113904e4586b5237 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b434e93f4e3f71fb85c354a635fa1ec041d1247e..1f46e0f2771f508afa555846e835df98a76b0af1 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index a456a1dba3a827376cea94d176d414a5c27c498e..f78ebfda9a09d086b74403acb79fd962e2a306af 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c92ace83cc6a5f2a535a99a62a33b0f328700cd8..7d456a877abd07bb04fd14f419f5dc50629586f9 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index 9aacc47e33341e224588a8fc0bdb64ebddd6452d..06995ae328a52137462033405a0ac1b935fe0a5c 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index bcf9e116cc235b6baa5cf5455c8d248c9bbdd472..8b8f3d37b4b7ac614b41b4cdae99cf7d84be144b 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8804171f2e3a4a83015313a08501540ed8e02333..914ed1c160f984a2ed1bc75d23be163175f2974b 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 6256676b2689c1e7d96a0d2bda0154f71e391f7f..6d46f322af3cc5ce847a5d487d136b6de00047dd 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e847c4148b7c81689b4303868f734e3add3fbc2e..361e22e0bd6293df7cadc0e5d8e5ea4a7d9cfc61 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Result\Update\UpdateableResult;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index feee054006b82d1466e7db4291a87f5d2e01e84f..99d34da4b8fc18d63e521528190e40522736c1f3 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 34d8111566413ad46d35ade0804addd92dd89b26..a8e2f8c8eb3d6299dea6586e11b099a3bdd42e03 100644 (file)
@@ -7,7 +7,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5718d07e94930f2899cf78a7c8a3fbd1a9c0c6ed..4d23fe9aca9f1e3072818511d84b8448336d5005 100644 (file)
@@ -8,7 +8,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7568bfda8c445bda6449f862cc39c757b9333945..bdb9fd1dfe76fa0ab4b250b8f509f94c2dbf816e 100644 (file)
@@ -9,7 +9,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Those are logic exceptions and should be rewritten
index b30e0cf09d5bd840f5632803bf28def1e9bf8fd5..e815457023e4b9dd50590f9c52c006efe428be28 100644 (file)
@@ -8,7 +8,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8aa5c29dc559606f90a61d6abaab685fc30d25a0..9945fa9e7985835c35b2d11fcefdbd92d72478e9 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4943c6163f45d3cf3ef750c0b5a278743d291577..ad10c00894821f82f606a6ea7ff964041c607f35 100644 (file)
@@ -9,7 +9,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 827006cbc1c53c280eb8e45b093bd67565a23e4e..0e888e7a35768056494597a5d9aa8439ea9b7040 100644 (file)
@@ -9,7 +9,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 86859b69606e4675b171f30e298d083eb54d8148..f7c24b65ae256ed5c712d6064b2876cd5be5f397 100644 (file)
@@ -7,7 +7,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a91cdb04d4d1993223249abc1d9218299e29e6ea..ed59fa2bcffa0d56dab5ec17028a247928ac4bc8 100644 (file)
@@ -9,7 +9,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index cbb6ea45f1e1dbe09ae4bff202025fbf2ba13b1e..88bb191f6a800a1040080535a557558d286afa9f 100644 (file)
@@ -8,7 +8,7 @@ namespace Org\Mxchange\CoreFramework\Socket;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e7ad13cc2ae042d766d688911d0f1dd4cf5e1a80..bad74bf20f1f5572e08b047ddcd5e20a57d2c6c2 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7047c869242b0ae5664fdc1f6ac1b909d685a659..45364b399967dbbf912d2b268663c1a6d28c8ac3 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Stack\File\StackableFile;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 57f711f764bcccbdf4835450a605720907ab5af9..09abb12428e28de7957861b2eefdfc34fc1dd4da 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b841960031ecc1ee32c3294fc3d754b6ce69e271..b420d9fe7bca62690ca4878055493b94554a570e 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\State\Stateable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8f8bb79f2468d85d2907511dadf0996454b3cae8..409cda27188024ee9c329a525ea1724ec172d285 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 38dd3cf8cec4ad834aa55a16bb433e045b74bef4..be84b6e9dc5ace3f4ae6fcba34e538091632cac5 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 43fda41f1dca07af3ef7f75168ca7acd9e4e5a18..646e3c7544487185658fd4005bebe1f2fc80df01 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index ce5f890ec3043ddc9abdeb2e11314a81bc7a4e6b..896bfdcdd18344a6aba0fd50b6e505dac98ab29a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index 23f44e36b009dea8569172cf0c63ed9445fe0d8f..2dac61cb430d466855f9c331354ff33797f15816 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated Don't use this anymore
index c2ec4a7d1b39decc3b9b366314aa939009efdeef..70dd8441972323b44380f233d7b4dd9607831d5c 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 229d4aa1f1803bd1cb694ef02b23cd4fb13ba118..890ef6577698b12d2da0959fd23f8c670fee38f6 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7db98027640455e4f7963431c3d50e0e4891fcbb..3341ba563e53a606b7a93bbc2145bfdedab54c8d 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c52da689e1f2416d9d15f4798225589847addca2..f8549dc3a0ab6c9682a004b4a262a9fecc42fa30 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5622d1b8e42b9ace98e6941cae576a21223da7fd..a2d84c8cec111235f90d70fe87c8b6c49f103cca 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Better rename this
index 990acc3e03da6cc3e51e2447d05a128d892e53e9..fa497fe717f0c3a8b51cc8cae74ad47140592c48 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index dd3eaa846bc0181e469be88d37b7e18ff943e0e3..370f7752d7396a4366242f5a6d9796b782cf4ff0 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e25115f3438a041cf4e877075996d9f6f34cd3b7..4479c9666a5d7a9531104e2c3e0730cbc50b858a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5e74cabbe11af19fef13337b4296a2a51fb3f6e7..4070e8d408f1a12b99dd63419f31adebcc6f929c 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 47c88a7382ad85e49b806005b5923f920b81b1fc..b809a2d761e22817a63132e599724deb97a49101 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 874bd43c7450cdd67153235b83ad77f3024eba47..0795006f890440820e143b2daace6fec3d4213bf 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a064777f7d8312aef27398e1c8291763ec51041a..bb8ddfe189a53ba9e03d5ba38d8072c6ec73b71c 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2159f9ff42dc2845ec943696b4d0e4006c08727b..3dc60b45cf82b26265e1ee1a15b05ab52572c0d2 100644 (file)
@@ -10,13 +10,12 @@ use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
  * An interface for managing applications. This can be a lot. E.g.:
  *
  * - Un-/locking applications
- * - Creating selectors for the selector-mode
  * - Usage statistics
  * - And many more...
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 190998c1ff170c338779c08bc086e1293a2d9a26..00f291f0564fea6914a25468ea43fd8817c05631 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
 >>>>>>> Some updates::inc/main/interfaces/auth/class_Authorizeable.php
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
index 97596e6152ca64adefc65197e3c61e433403fe52..026b8d24f93831a56c4094d5905334a8ad465ac1 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Filesystem\Block;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6cca82ce45ac9c173bb25d51a351a7db3987cf76..8c43458e9dbcf6b390307ebb9c85ffeabe24598b 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 136dc9d872ace6d623e3f8a02ef5a00004090af6..51a628789e175ef174da2ef69750138bcc8afa03 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 17c6362449bf0cc90ccc4085648532350f583cb3..7e5a8a96d3e913b8500daf39fa929548975ba776 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Helper\Helper;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 68a6889f7e8233f619d2c0dc8e1eb5fab61745ed..f91f4f44729343922aa1b44f0dd2d54bfcbc013e 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a4eca6b3c53e536315a946cd194e7e10af506277..8c1003d51581b1297578dd9c3092bd8e8ddbefac 100644 (file)
@@ -8,7 +8,7 @@ namespace Org\Mxchange\CoreFramework\Generic;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               Find a better name for this interface
@@ -27,6 +27,16 @@ namespace Org\Mxchange\CoreFramework\Generic;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface FrameworkInterface {
+       // Exception constants
+       const EXCEPTION_INVALID_ARGUMENT     = 0x200;
+       const EXCEPTION_LOGIC_EXCEPTION      = 0x201;
+       const EXCEPTION_UNSPPORTED_OPERATION = 0x202;
+       const EXCEPTION_UNEXPECTED_VALUE     = 0x203;
+       const EXCEPTION_CLASS_NOT_FOUND      = 0x204;
+       const EXCEPTION_BAD_METHOD_CALL      = 0x205;
+       const EXCEPTION_OUT_OF_BOUNDS        = 0x206;
+       const EXCEPTION_IS_NULL_POINTER      = 0x207;
+
        /**
         * Getter for field name
         *
index c67e1887227aa1b2f03395ae24c2fb0686398c17..0e21d22c3cd801969e500754d9e46fc735b39c8c 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a8aa359d592320f57abe295ffbca854f8e4596e4..fa289b894bde4896a6b388775566e3e872df3b0a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3be2f18ca8ade15b67cb64d1d3463c902dc101fb..9a65a650da08dc5cc93fbb3fcba0bc66e3a42867 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 16eef5a7f953a86f288f124c4192b0eb334996dc..d95eafb756d75118d1166cd5eeaaaa7730aa5151 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5ca1498e4bd721f2d402c7a03bbb60c462f6ae89..0ff16acb4947eb43348377c789293525e4b5c36b 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -28,6 +28,11 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface Criteria extends FrameworkInterface {
+       // Criteria types
+       const CRITERIA_TYPE_DEFAULT  = 'default';
+       const CRITERIA_TYPE_CHOICE   = 'choice';
+       const CRITERIA_TYPE_EXCLUDE  = 'exclude';
+
        /**
         * Setter for frontend class name
         *
index 158e5b28e96121d623799fc7043effce8db5509a..d6c571c5e16f1afd4aa6cb15b28717067f04b6c5 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Criteria\Criteria;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 23cf625a9117144fdf897cb3e87a5a0c174bc04d..872b8b816bd10be0f8ef2261174ec4814457ea17 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e5d24aaca7c609f8ef66af204520bea4d1642c38..9b3eb199f6426a3d196c25d2044a1c5c8a7232d1 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2834db90c5d210cfd3a8373bfa45dd74f236d3a6..d0cbc2b5f14f621e78459a8eda34b0c91f18214a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 07a611d8672feefdb83ba898592fa32e259f8225..8b8ddf24c1f8cfcae8857b2f0b470b018efaaa2b 100644 (file)
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Database\FrameworkDatabase;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a6a9683f002f3053098e36be2e2e4344b04ebfb5..30b4ef3704c38eee6920047f2a7f8672a79bba2a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1eec5b3d1119c7351e2d3f98f4be0bb253d9dd41..0a9de305fd0c6efd9c9109c51fa91c75d8d77a19 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7e31c084342b5da5f0ba86527bf94d827f086b3a..5afc77fbd414dc75087473f114c041cd949e1fdb 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Result\Update\UpdateableResult;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index aa3a625ea84ca6269ba5af6bf4bb8c36b62be86b..4b9f3749a53a4184056543da2d8a91a7b333dbd0 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -63,11 +63,11 @@ interface DatabaseFrontend extends FrameworkInterface {
        function doSelectCountByCriteria (Criteria $criteriaInstance, array $onlyKeys = []);
 
        /**
-        * Getter for primary key used in wrapped table
+        * Generates primary key for this database frontend
         *
         * @return      $primaryKey             Primary key used in wrapped table
         */
-       function getPrimaryKeyValue ();
+       function generatePrimaryKey ();
 
        /**
         * Counts total rows of this table
index 3db5d5c96a18d2cef352dae1b057ddc9901a420f..f0e4917a263f3161413a3c54ff0189fe4145a49a 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Result\Update\UpdateableResult;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d1ea22bd4a138814fd07d1ee6ea7b7548390d2e0..ee45bb0add2da45a922e7b3416be1b8cb086c75e 100644 (file)
@@ -5,7 +5,6 @@ namespace Org\Mxchange\CoreFramework\Connector\Database;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Criteria\Criteria;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
-use Org\Mxchange\CoreFramework\Database\Backend\DatabaseBackend;
 use Org\Mxchange\CoreFramework\Database\FrameworkDatabase;
 
 /**
@@ -13,7 +12,7 @@ use Org\Mxchange\CoreFramework\Database\FrameworkDatabase;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -56,13 +55,6 @@ interface DatabaseConnector extends FrameworkDatabase {
         */
        function getConnectionData ();
 
-       /**
-        * Setter for the real database layer
-        * @param       $dbLayer        An instance of the real database layer
-        * @return      void
-        */
-       function setDatabaseLayer (DatabaseBackend $dbLayer);
-
        /**
         * Getter for index key
         *
index 17014fe3fc5370fa666e6c9d7c36b6cb95a9e446..9d820ce468b18dc3f21281d9554d981b6a311980 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Database\FrameworkDatabase;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c95f5194dc03fa9f6884e15355864243a62aeaea..a08b80e592180af79eb30a242a2829b357e064db 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Migration\Database\MigrateableDatabase;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7fbeacdd40ee1b5f5d744eb1b728b1cd7b0a788e..d9525855bda57eeaa68ae52bd7dd2f91f021a3a7 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6c47ec29a0b0a26bf58aa2cba7d974a5f1552eb9..072cffdd2674b9571ee234b297311ea9740c71b9 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 86353dadccaa5929ecf522bbfa558300b777395b..50f9f932af408682a43aa0cf9166237070475b51 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\State\Stateable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c12731a6cddba2ee3aaf20b8c37be25ba256c2d3..da2dd2192aa799174a8fab7a6cda87544a34aebd 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8414f7f11a94b857390819b46af6df620da57031..e84bd183eb0edff4c926bff60491244b272de81f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Filesystem\Filesystem;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 74f0aa4d80d83280f43328ac6a3bfec1688f6d56..6a9d47005b7cf4ff7a80ebbe824fce8d744d8d83 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 6c16cd5d1495e171c8fb0a41a82d67c0087f023f..1f427be7d1bd77d279a7b30b536b0a000365da02 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Filesystem\File\BinaryFile;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 8957b5ca25cabface86d27edf1f2bff8aa4d42ec..23374bab94ab641de14ce344befabb27010d97c4 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Filesystem\File\BinaryFile;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index b0d20e353b4fad02447cc4589bfc704311356038..f33dc433d086bb0365a6e8ceb16c4463aca0e3ab 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 12a85ff440840d321612a788111fdd692adb9b0d..8e95249188216d32b40b092c67d9d5b4e4489d83 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2e47b5e3ffaba4187f9252ed2d75c1097265f4bb..42be03fba6c897ecc975db25d7d8fc5dc6b5a8c2 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Handler\Handleable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7586921c0e93e4f0a3d6473e0adccc32d6f02f50..c7ace208d456b190401279e8f9365d70724c1262 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @todo               HandleableDataSet looks strange here
index d56562b47cf1f3e23ccfadc979412ec63170ffed..f8acd601f8a3b3ce74a18434cbd1c5bc256fade5 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 62db81c684c156b820c91563e0e227ae6f255cba..d3b1382b5a92a74a58f095aca8ad637c095a2b0a 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1164b0cca1a4d7d05d79c03ea12e509c37779484..ec2897b841cd96a4ac1f1773524c238edfc7a0d8 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Helper\Helper;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 72640ed817a5c33ee61453570c8d20e1c519a1cd..24d68e88a25f93005c24a2662048aa09c559c3da 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Index\Indexable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index a4dbd3f5d0a2a81f1c58f4d729220a9fae198ae7..f5da8e4f45b394e830a6de363d54c709c0a17ccc 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 70cb15304f29351eebe2caa60abb71a5d53d3b22..e2d85910510b5f628bfae869cba1d01c7a01f1bf 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Index\Indexable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 96f0962e9c3f0b1e147c234d5e50000b23bd7a43..1b8ce0bb3045842c6e0fbdcb2b0ae69c9d6a493b 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Index\File\FileIndexer;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 0a08c207d1f5cceb6a0d0bb448a061bb0c3e133b..dc98cb21dbdb07e20fddd9bf2029bc03d33f50dd 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3514a97b9fffcd749e002b32c02e59fbf13b4d95..5d2f2e7923cfcfb03fb2ad17d63306fba2e3e3b2 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5cf5887875787a6f6ad9a548579e321d5b958002..867f935eb8d9c559f8301464bdc1092d7b37f20a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1d0f047b3d632449829cd257f8bedc0e6da3ba77..f38f6400515f0265db5158a16dfe1e07642caa08 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Streamable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d3415a51caa1e521ce9175e135432a0e337f901c..e6a20ddb410c8000e9c5afdf7486a3257a56b166 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Streamable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 29e79268e36b27016b25ee7dd307d37e768863db..7c50bea77fdbc9d9dcf2868d222d9720ce4b722c 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 041818dc89cc2d0fadcc6c55c461d9fd4f1a4a4c..3c4bac1821bcc34d3543b80155eec76f2c981cd3 100644 (file)
@@ -13,7 +13,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7b35ebe4c18a81a1c682b368adf2b1cc01728935..837bbaf4a04bb6701befdcf2fb9b4df36f56e588 100644 (file)
@@ -13,7 +13,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 72b5b94382d3b9fda9039e4715f79e6a2743b6fc..40317d378c09ddfcc7945abae033206f8e7ae23b 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Filesystem\FileInputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 1f30f4a6cbc49fd5ee5a1665d1891f31638c8c4d..4e3817b3df885a5d617df0d3d2e5132c1e81645b 100644 (file)
@@ -15,7 +15,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 51de1a38eeb7111f87220bf78bdf9f731448370b..eb4fd1100f4095b67cac74557af7fe04010b30c7 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\StreamableOutput;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index c85cb143b629c1c1290cc2bf7c12669a6a94f6dc..d0e355d07613f2da9d7bf00bbee21e22a218e88f 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Stream\Input\StreamableInput;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index ffb3aaf5e326b109c1b4ddebbc61c1ba6ab732da..039d1757022dc54e28afcd75379f416ecd4c8546 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\StreamableOutput;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7281204e642f84c4a56cbab434e9c91bba8ee92a..23b1dbca9d71b53616fc5420b54628cc99e591b8 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Filesystem\Pointer\OutputPointer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 614eed42cc5a651bb3369577f41ba1bdecce4d51..b3155197b456763dc36f1db6f3136432321183e3 100644 (file)
@@ -13,7 +13,7 @@ use \Iterator;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e871936073fa428c4fc9cbe64d79355534d8264c..06677c4be228c6de9592525d025c7582514e3386 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 241437b2b0c39e32d980104c85e3d7dfe07b0c47..ce6087e4f34ca1448352cc6511adf9c686bd35a9 100644 (file)
@@ -14,7 +14,7 @@ use \IteratorAggregate;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/framework/main/interfaces/logging/class_Logger.php b/framework/main/interfaces/logging/class_Logger.php
new file mode 100644 (file)
index 0000000..2e7a2cf
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Logging;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+
+/**
+ * A Logger interface
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Logger extends FrameworkInterface {
+
+       // Logger levels
+       const LOGGER_LEVEL_DEBUG      = 'DEBUG';
+       const LOGGER_LEVEL_DEPRECATED = 'DEPRECATED';
+       const LOGGER_LEVEL_INFO       = 'INFO';
+       const LOGGER_LEVEL_TRACE      = 'TRACE';
+       const LOGGER_LEVEL_WARNING    = 'WARNING';
+
+       /**
+        * Outputs a trace message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function traceMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Outputs a debug message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function debugMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Outputs an informational message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function infoMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Outputs a warning message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function warningMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+
+       /**
+        * Output a partial stub message for the caller method
+        *
+        * @param       $message        An optional message to display
+        * @return      void
+        */
+       public function partialStub (string $message = '');
+
+       /**
+        * Outputs a deprecated message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        * @todo        When all old method invocations are fixed, renamed this do deprecatedMessage
+        */
+       public function debugOutput (string $message, bool $doPrint = true, bool $stripTags = false);
+
+}
index f16d77ce2ddc5be7d95bd0ca8668fe43bb3bd60c..8baeff5dea6e9ff0989df1c7edccd96ed28d34aa 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 10ee097bd3f45bf1eacf39dcd1b2199ffbb537c4..cf8b28ec9d7058d3e5d21369685a47528fc43483 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Manager\Login\ManageableMember;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0114621260a01704d328645d513fc32de887c069..8af81f78e0096cd02eb9bbd5fb818bd7cf85a460 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d35bdd7a15606e380a649069cc31b4a93a3e53a8..9e97b72344baa76de6e7f6481254d8df2caac70f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Criteria\Add\AddableCriteria;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3987486e20d7d590b7ed4ceb9f8ff66de6254fe8..a0ec486c62497d2026feb6abf67c25b3ce36c52e 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d2c05b2d89ed0890feed2c14a1f61ad32bc86ca9..11418fc6a75092f70ae6a765d9ea47e57b700e27 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Criteria\Add\AddableCriteria;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 0b8d66945c6e1735cf3010c7586bea0532c66240..bfda3c3bb7a4dfad9cdb70a33debcb31570f8757 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -28,22 +28,6 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface Register extends FrameworkInterface {
-       /**
-        * Checks whether an instance key was found
-        *
-        * @param       $instanceKey    The key holding an instance in registry
-        * @return      $exists                 Whether the key exists in registry
-        */
-       function instanceExists (string $instanceKey);
-
-       /**
-        * Adds/overwrites a new instance to the registry at the given key
-        *
-        * @param       $instanceKey            The key to identify the instance
-        * @param       $objectInstance         An instance we shall store
-        * @return      void
-        */
-       function addInstance (string $instanceKey, Registerable $objectInstance);
 
        /**
         * Getter for whole generic registry
@@ -52,13 +36,6 @@ interface Register extends FrameworkInterface {
         */
        function getGenericRegistry ();
 
-       /**
-        * Getter for whole instance registry
-        *
-        * @return      $instanceRegistry       The whole instance registry array
-        */
-       function getInstanceRegistry ();
-
        /**
         * Adds a new entry to the given list name. If you want to add objects
         * please use addInstance() and getInstance() instead.
@@ -85,13 +62,4 @@ interface Register extends FrameworkInterface {
         */
        function getArrayFromKey (string $arrayKey, string $lookFor);
 
-       /**
-        * Gets a registered instance or null if not found
-        *
-        * @param       $instanceKey            The key to identify the instance
-        * @return      $objectInstance         An instance we shall store
-        * @throws      NullPointerException    If the requested key is not found
-        */
-       function getInstance (string $instanceKey);
-
 }
index d8ee81361041535922b6bcb684f9c567a115c46f..672e8500de828245e6d5a58c7668975512293b39 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7f6105026a61acdd9fd1bd49cf9704bcd5c62415..6d217a353ba2455959a8b368b4242a9202f6bb8a 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Upgrade\Format\Database\UpgradeableDatabaseFormat
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
diff --git a/framework/main/interfaces/registry/object/class_ObjectRegister.php b/framework/main/interfaces/registry/object/class_ObjectRegister.php
new file mode 100644 (file)
index 0000000..cdc9b8c
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Registry\Object;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Registry\Register;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+
+/**
+ * An interface for registries
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ObjectRegister extends Register {
+       /**
+        * Checks whether an instance key was found
+        *
+        * @param       $instanceKey    The key holding an instance in registry
+        * @return      $exists                 Whether the key exists in registry
+        */
+       function instanceExists (string $instanceKey);
+
+       /**
+        * Adds/overwrites a new instance to the registry at the given key
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @param       $objectInstance         An instance we shall store
+        * @return      void
+        */
+       function addInstance (string $instanceKey, Registerable $objectInstance);
+
+       /**
+        * Getter for whole instance registry
+        *
+        * @return      $instanceRegistry       The whole instance registry array
+        */
+       function getInstanceRegistry ();
+
+       /**
+        * Gets a registered instance or null if not found
+        *
+        * @param       $instanceKey            The key to identify the instance
+        * @return      $objectInstance         An instance we shall store
+        * @throws      NullPointerException    If the requested key is not found
+        */
+       function getInstance (string $instanceKey);
+
+}
index 9d0146642a9b09bd1dfcc1af44f431a33c8d6773..13b8c3641e8c771409f1d28962293ff93b7ff097 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -70,17 +70,17 @@ interface Requestable extends FrameworkInterface {
        function getParameterNames ();
 
        /**
-        * Sets whether the request was valid (default: true)
+        * Sets whether the request was valid
         *
         * @param       $isValid        Whether the request is valid
         * @return      void
         */
-       function requestIsValid (bool $isValid = true);
+       function setIsRequestValid (bool $isValid);
 
        /**
         * Returns whether this request is valid
         *
-        * @return      $requestIsValid         Whether this request is valid
+        * @return      $isRequestValid         Whether this request is valid
         */
        function isRequestValid ();
 
index ccabf64fc1e782359ee41f93c3c20784dfce573b..9760a642dd09814968e41ca1df513770fbef9077 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Resolver\Resolver;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 13d1c700f9ee8978769544d0149d97ac4511b966..fc48c666214981a08061c143fd2e9894a69f01e3 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index bed7de6b2b5b7e9c476e1fa8ff8c52f610985ac4..0d1e1c5ae64e2a82eda33af08390a2cd0c44c149 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Resolver\Resolver;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 24b057f34199f60f97f5048837953283e9b1ed09..353edaed86f98ecbe63027c442709dfabf249554 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Resolver\Resolver;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index fe20df81ad9c1a708a4dfa15cc66e75c4cfd51f6..6c0290b7ff1f7a0440f9a73dc187fdf1e4943bf4 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 15c271d5697df670a4766a3fa3cc8d810cb7c2c7..5eaf6dbeb794b6a2ce337d1e374a5072c3e6cc1e 100644 (file)
@@ -12,7 +12,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index dd6d350481caea9329c3c7e644b0d03ef1d75dad..a07e3af84e30d07ba0ee530e9aa13d45a7cae899 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Criteria\Local\LocalUpdateCriteria;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7e61eb42cf9e212d6272b08e2ce4f9aba0a45c2c..4881c6f6d9565641d2ba15be6e2f9d317ecae34f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -34,7 +34,7 @@ interface Stackable extends FrameworkInterface {
         * @param       $stackerName    Name of the stacker
         * @param       $value                  Value to push on it
         * @return      void
-        * @throws      StackerFullException    If the stacker is full
+        * @throws      BadMethodCallException  If the stacker is full
         */
        function pushNamed (string $stackerName, $value);
 
index 4d94fe5ca57ac948de663be6f0de545298b9c3ec..2a08b75efca8db06042b913eaf488103916ab640 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stack\Stackable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 465af1cbd8dbca087872de761398dd445d673ab2..9f2d5e135f129f87db2104f3165a95694171c45b 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 58527c2ea7ce9e01fbf004209652ef6ce5f40a2b..8b45ce02d03fa126eb0571c952b03581510828d8 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 5c5888dd878c2eff32f4487caac315c61ca7aca3..6632071949a02556076479a5313b358e7da7e15a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Stream;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 99af745cc9964a463dc0762dcf077277b6131ad6..2e1df834b7442e166af7ff3ca55783b3001fb1c2 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Stream;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d6bd95e0aa81fdbd2ad36f1d3a0e80559d3a3be2..e2664a7bab8a67cba766d197956711f8ebcc6cb1 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Stream;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index b9c37f41bcdf00887dd0c7040f52097f8554acaa..6efe8f683bb20bd2c5b93a0ae8534abf4efbfdc9 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7bb192cffbe7d36e51f21de687a545a89aa4bc2a..eae7325888ec368a617c7af66900afc9cb103fe5 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 455bbd4c29479fb78bc9f4992bc11e910c8d4476..a01e1d22619690efe4e32e99974cd849ee1eb8e3 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 528cefb3b2408d3e2db693ec56e824ac55bd157b..9e9dbb180cf832e581eb823a8feaa382d654a454 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f5d90f90335330d67e689a6abd5f9ba9c4921ca8..77eef26b9ea205fae00c9da2d430dff5fc11d3ba 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index a20ae8474f95d4300565ad3c7367c0671aa68c9e..e353d394f928864735ea9dd6244aeaf90bb2cc78 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\User\ManageableAccount;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 28df9e911ae6a0e7f6de92b6bca541e96dfec45e..47cb86ff0210b654d2704a188cb099229b3b4476 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\User\ManageableAccount;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 90a7a2f34c4c30cf2904aebacec44c83a06760fb..314a3a43bc847e55b9c6e2cbb9f9fec6e6dfc3ae 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6683e6db026f9cc45f5ba5c9606c0eaa42eb6d7d..e9ff2f335305ddafb0215cd4fc85176fce597a53 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4dc4b363dae13d632a0618a21e3007f8e0e2abcb..c7cdab58dff74a44d98c1b66a173c41ae4242c3a 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4a6b13615756ecf4d367d9a3091facf4c53c9fd6..a63e57e7ddd473cef48d18c15e45f1857a92fdff 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 472fa65e4f088a791a8e1f8c120787b534f6122f..9e773709a28c84818a76033fb9e23dacd8e94862 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Traits\Streamer\Output\OutputStreamerTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * 
index 353cfc5b44eae09a351e7bb155e78f346d85a121..a78bb6e82786d2d662e4e4db8d78da9cf14b6823 100644 (file)
@@ -14,7 +14,7 @@ use Org\Mxchange\CoreFramework\Registry\Registerable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -71,10 +71,8 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
 
                        // Read all directories but no sub directories, .htaccess files and NullCompressor class
                        while ($directoryEntry = $directoryInstance->readDirectoryExcept(array('class_NullCompressor.php'))) {
-                               // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COMPRESSOR: directoryEntry=' . $directoryEntry);
-
                                // Is this a class file?
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('COMPRESSOR: directoryEntry=' . $directoryEntry);
                                if ((substr($directoryEntry, 0, 6) == 'class_') && (substr($directoryEntry, -4, 4) == '.php')) {
                                        /* Get the compressor's name. That's why you must name
                                         * your files like your classes and also that's why you
index 020d13d2156fa819bc3cd32e641364f3c98d4699..b64d518926b7b0114747e2bd8ad26901e0143575 100644 (file)
@@ -7,19 +7,22 @@ use Org\Mxchange\CoreFramework\Connector\Database\DatabaseConnector;
 use Org\Mxchange\CoreFramework\Criteria\Criteria;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
 use Org\Mxchange\CoreFramework\Database\Backend\DatabaseBackend;
-use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Middleware\BaseMiddleware;
-use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Result\Database\BaseDatabaseResult;
 
 // Import SPL stuff
 use \InvalidArgumentException;
+use \OutOfBoundsException;
+use \UnexpectedValueException;
 
 /**
- * Database selector class
+ * Database connectivity class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -40,12 +43,12 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        /**
         * Array for connection data
         */
-       private $connectData = array(
+       private $connectData = [
                'login' => '',
                'pass'  => '',
                'dbase' => '',
-               'host'  => ''
-       );
+               'host'  => '',
+       ];
 
        /**
         * The real database layer
@@ -68,21 +71,22 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        /**
         * Creates a new database connection layer
         *
-        * @param       $debugInstance          An instance of a DebugMiddleware class
         * @param       $backendInstance        An instance of a DatabaseBackend class
         * @todo        $debugInstance is currently not used
         */
-       public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseBackend $backendInstance) {
+       public static final function createDatabaseConnection (DatabaseBackend $backendInstance) {
                // Get instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: backendInstance=%s - CALLED!', $backendInstance->__toString()));
                $databaseInstance = new DatabaseConnection();
 
                // Set database layer
-               $databaseInstance->setDatabaseLayer($backendInstance);
+               $databaseInstance->setBackendInstance($backendInstance);
 
                // Set db instance
                self::$selfInstance = $databaseInstance;
 
                // Return instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: databaseInstance=%s - EXIT!', $databaseInstance->__toString()));
                return $databaseInstance;
        }
 
@@ -95,6 +99,15 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                return self::$selfInstance;
        }
 
+       /**
+        * Setter for the real database layer
+        * @param       $backendInstance        An instance of a DatabaseBackend class
+        * @return      void
+        */
+       private final function setBackendInstance (DatabaseBackend $backendInstance) {
+               $this->backendInstance = $backendInstance;
+       }
+
        /**
         * Setter for all database connection data. All these parameters may be
         * supported by the underlaying backend.
@@ -104,13 +117,31 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         * @param       $dbase  Name of used database
         * @param       $host   Host to connect to (default: 127.0.0.1)
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter is empty
         */
-       public final function setConnectionData (string $login, string $pass, string $dbase, string $host = '127.0.0.1') {
+       public final function setConnectionData (string $login, string $pass, string $dbase, string $host = 'localhost') {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: login=%s,pass=%s,dbase=%s,host=%s CALLED!', $login, $pass, $dbase, $host));
+               if (empty($login)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "login" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($dbase)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "dbase" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($host)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "host" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Transfer connection data
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('DATABASE-CONNECTION: Setting data ...');
                $this->connectData['login'] = $login;
                $this->connectData['pass']  = $pass;
                $this->connectData['dbase'] = $dbase;
                $this->connectData['host']  = $host;
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: EXIT!');
        }
 
        /**
@@ -122,15 +153,6 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                return $this->connectData;
        }
 
-       /**
-        * Setter for the real database layer
-        * @param       $backendInstance        An instance of a DatabaseBackend class
-        * @return      void
-        */
-       public final function setDatabaseLayer (DatabaseBackend $backendInstance) {
-               $this->backendInstance = $backendInstance;
-       }
-
        /**
         * Getter for index key
         *
@@ -148,21 +170,42 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         * @param       $criteriaInstance       An instance of a Criteria class
         * @return      $result                         The result as an array
         * @throws      InvalidArgumentException        If a parameter is empty
+        * @throws      OutOfBoundsException    If important array elements are not present
+        * @throws      UnexpectedValueException        If $result['status'] is not 'ok'
         */
        public function doSelectByTableCriteria (string $tableName, Criteria $criteriaInstance) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: tableName=%s,criteriaInstance=%s - CALLED!', $tableName, $criteriaInstance->__toString()));
                if (empty($tableName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "tableName" is empty');
+                       throw new InvalidArgumentException('Parameter "tableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Connect to the database
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: Invoking this->backendInstance->connectToDatabase() ...');
                $this->backendInstance->connectToDatabase();
 
                // Get result from query
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: Invoking this->backendInstance->querySelect(%s,%s) ...', $tableName, $criteriaInstance->__toString()));
                $result = $this->backendInstance->querySelect($tableName, $criteriaInstance);
 
+               // Is a valid array returned?
+               if (!isset($result[BaseDatabaseResult::RESULT_NAME_STATUS])) {
+                       // Missing element
+                       throw new OutOfBoundsException(sprintf('result()=%d does not have element "%s"', count($result), BaseDatabaseResult::RESULT_NAME_STATUS), FrameworkInterface::EXCEPTION_OUT_OF_BOUNDS);
+               } elseif ($result[BaseDatabaseResult::RESULT_NAME_STATUS] != 'ok') {
+                       // Is exception given?
+                       if (isset($result[BaseDatabaseResult::RESULT_NAME_EXCEPTION])) {
+                               // Attach it
+                               throw new UnexpectedValueException(sprintf('result[%s]=%s is not "ok" with cause', BaseDatabaseResult::RESULT_NAME_STATUS), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT, BaseDatabaseResult::RESULT_NAME_EXCEPTION);
+                       } else {
+                               // No exception attached
+                               throw new UnexpectedValueException(sprintf('result[%s]=%s is not "ok"', BaseDatabaseResult::RESULT_NAME_STATUS, $result[BaseDatabaseResult::RESULT_NAME_STATUS]), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+                       }
+               }
+
                // Return the result
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: result[]=%s - EXIT!', gettype($result)));
                return $result;
        }
 
@@ -172,7 +215,12 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         * @return      $exceptionInstance      Last thrown exception
         */
        public final function getLastException () {
+               // Get instance
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: CALLED!');
                $exceptionInstance = $this->backendInstance->getLastException();
+
+               // Return it
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: exceptionInstance=%s - EXIT!', $exceptionInstance->__toString()));
                return $exceptionInstance;
        }
 
@@ -184,10 +232,15 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         */
        public function queryInsertDataSet (StoreableCriteria $dataSetInstance) {
                // Connect to the database
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                $this->backendInstance->connectToDatabase();
 
                // Ask the database layer
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: Invoking this->backendInstance->queryInsertDataSet(%s) ...', $dataSetInstance->__toString()));
                $this->backendInstance->queryInsertDataSet($dataSetInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: EXIT!');
        }
 
        /**
@@ -198,10 +251,15 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         */
        public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
                // Connect to the database
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                $this->backendInstance->connectToDatabase();
 
                // Ask the database layer
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: Invoking this->backendInstance->queryUpdateDataSet(%s) ...', $dataSetInstance->__toString()));
                $this->backendInstance->queryUpdateDataSet($dataSetInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: EXIT!');
        }
 
        /**
@@ -213,18 +271,22 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         */
        public function getPrimaryKeyOfTable (string $tableName) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: tableName=%s - CALLED!', $tableName));
                if (empty($tableName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "tableName" is empty');
+                       throw new InvalidArgumentException('Parameter "tableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Connect to the database
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: Invoking this->backendInstance->connectToDatabase() ...');
                $this->backendInstance->connectToDatabase();
 
                // Ask the database layer
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: Invoking this->backendInstance->getPrimaryKeyOfTable(%s) ...', $tableName));
                $primaryKey = $this->backendInstance->getPrimaryKeyOfTable($tableName);
 
                // Return the value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: primaryKey=%s - CALLED!', $primaryKey));
                return $primaryKey;
        }
 
@@ -233,16 +295,26 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         *
         * @param       $data   An array with possible non-public data that needs to be removed.
         * @return      $data   A cleaned up array with only public data.
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function removeNonPublicDataFromArray (array $data) {
+               // Check parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: data()=%d - CALLED!', count($data)));
+               if (count($data) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "data" is an empty array', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Connect to the database
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: Invoking this->backendInstance->connectToDatabase() ...');
                $this->backendInstance->connectToDatabase();
 
                // Call database backend
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: Calling this->backendInstance->removeNonPublicDataFromArray(data) ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: Invoking this->backendInstance->removeNonPublicDataFromArray(data()=%d) ...', count($data)));
                $data = $this->backendInstance->removeNonPublicDataFromArray($data);
 
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: data[]=' . gettype($data));
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: data()=%d - EXIT!', count($data)));
                return $data;
        }
 
@@ -255,18 +327,21 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         */
        public function countTotalRows (string $tableName) {
                // Validate parameter
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: tableName=%s - CALLED!', $tableName));
                if (empty($tableName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "tableName" is empty');
+                       throw new InvalidArgumentException('Parameter "tableName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Connect to the database
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('DATABASE-CONNECTION: Invoking this->backendInstance->connectToDatabase() ...');
                $this->backendInstance->connectToDatabase();
 
                // Ask the database layer
                $count = $this->backendInstance->countTotalRows($tableName);
 
                // Return the value
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DATABASE-CONNECTION: count=%d - CALLED!', $count));
                return $count;
        }
 
index 7460b86bf119fbb2d46585c0181628b45df3ecac..d5ec854dd67496e41f2f1d68843657eee72a63e0 100644 (file)
@@ -4,11 +4,16 @@ namespace Org\Mxchange\CoreFramework\Middleware\Debug;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Logging\Logger;
 use Org\Mxchange\CoreFramework\Middleware\BaseMiddleware;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * The middlware debug output system. A *real* or concrete output class shall
  * become registered with this middleware because the back-fall class will
@@ -16,7 +21,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  * @deprecated See LoggerFactory for a more flexible approach
@@ -34,7 +39,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class DebugMiddleware extends BaseMiddleware implements Registerable {
+class DebugMiddleware extends BaseMiddleware implements Registerable, Logger {
        /**
         * An instance of this class
         */
@@ -47,10 +52,11 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
         */
        private function __construct () {
                // Call parent constructor
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CONSTRUCTED!' . PHP_EOL, __METHOD__, __LINE__);
                parent::__construct(__CLASS__);
 
-               // Set own instance
-               self::$selfInstance = $this;
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -63,36 +69,103 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
         * @param       $className              Class where a output should be created and
         *                                                      configured for
         * @return      $debugInstance  An instance of this middleware class
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public static final function createDebugMiddleware (string $outputClass, string $className) {
-               //* DEBUG-DIE: */ die(__METHOD__.': outputClass=' . $outputClass . ',className=' . $className);
-
-               // Create an instance if this middleware
-               $debugInstance = new DebugMiddleware();
+               // Check parameter
+               //* NOISY-DEBUG: */ printf('[%s:%d]: outputClass=%s,className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $outputClass, $className);
+               if (empty($outputClass)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "outputClass" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (empty($className)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "className" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
 
-               // Default is that $outputClass may be invalid
-               $isInitialized = false;
+               // Is a static instance there?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::selfInstance[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype(self::$selfInstance));
+               if (is_null(self::$selfInstance)) {
+                       // Create an instance if this middleware
+                       self::$selfInstance = new DebugMiddleware();
+               }
 
                // Is there a valid output instance provided?
-               if (class_exists($outputClass)) {
+               //* NOISY-DEBUG: */ printf('[%s:%d]: outputClass=%s' . PHP_EOL, __METHOD__, __LINE__, $outputClass);
+               if (class_exists($outputClass) && is_null(self::$selfInstance->getOutputInstance())) {
                        // A name for a debug output class has been provided so we try to get it
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Initializing outputClass=%s ...' . PHP_EOL, __METHOD__, __LINE__, $outputClass);
                        $outputInstance = ObjectFactory::createObjectByName($outputClass);
 
                        // Set this as output class
-                       $debugInstance->setOutputInstance($outputInstance);
-
-                       // All fine
-                       $isInitialized = true;
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: outputInstance=%s' . PHP_EOL, __METHOD__, __LINE__, $outputInstance->__toString());
+                       self::$selfInstance->setOutputInstance($outputInstance);
                }
 
-               // Is the output class initialized?
-               if ($isInitialized === true) {
+               // Is the output class loadable and an output instance is set?
+               if (class_exists($outputClass) && !is_null(self::$selfInstance->getOutputInstance())) {
                        // Then set class name
-                       $debugInstance->getOutputInstance()->setLoggerClassName($className);
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Setting className=%s as logger class ...' . PHP_EOL, __METHOD__, __LINE__, $className);
+                       self::$selfInstance->getOutputInstance()->setLoggerClassName($className);
                }
 
                // Return instance
-               return $debugInstance;
+               //* NOISY-DEBUG: */ printf('[%s:%d]: debugInstance=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, self::$selfInstance->__toString());
+               return self::$selfInstance;
+       }
+
+       /**
+        * This method shall send debug output which can be HTML code for the
+        * browser or debug lines for a log file, etc. to the registered debug
+        * output instance.
+        *
+        * @param       $message        Data we shall 'stream' out to the world
+        * @param       $stripTags      Whether HTML tags shall be stripped out
+        * @return      void
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        */
+       private function outputMessage (string $logLevel, string $message, bool $stripTags = false) {
+               // Get backtrace
+               //* NOISY-DEBUG: */ printf('[%s:%d]: logLevel=%s,message=%s,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $logLevel, $message, intval($stripTags));
+               $backtrace = debug_backtrace(!DEBUG_BACKTRACE_PROVIDE_OBJECT);
+
+               // Is the deprecated debugOutput() or partialStub() invoked before?
+               if (isset($backtrace[4]) && $backtrace[3]['function'] == 'partialStub') {
+                       // Prepend class::function:line from 2nd element
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: partialStub() was invoked ...' . PHP_EOL, __METHOD__, __LINE__);
+                       $message = sprintf('[%s] [%s::%s:%d]: %s',
+                               $logLevel,
+                               $backtrace[4]['class'],
+                               $backtrace[4]['function'],
+                               (isset($backtrace[4]['line']) ? $backtrace[4]['line'] : '0'),
+                               $message
+                       );
+               } elseif (isset($backtrace[3]) && $backtrace[2]['function'] == 'debugOutput') {
+                       // Prepend class::function:line from 2nd element
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: debugOutput() was invoked ...' . PHP_EOL, __METHOD__, __LINE__);
+                       $message = sprintf('[%s] [%s::%s:%d]: %s',
+                               $logLevel,
+                               $backtrace[3]['class'],
+                               $backtrace[3]['function'],
+                               (isset($backtrace[3]['line']) ? $backtrace[3]['line'] : '0'),
+                               $message
+                       );
+               } else {
+                       // Prepend class::function:line from 2nd element
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Ordinary invocation ...' . PHP_EOL, __METHOD__, __LINE__);
+                       $message = sprintf('[%s] [%s::%s:%d]: %s',
+                               $logLevel,
+                               $backtrace[2]['class'],
+                               $backtrace[2]['function'],
+                               (isset($backtrace[2]['line']) ? $backtrace[2]['line'] : '0'),
+                               $message
+                       );
+               }
+
+               // Use the output instance
+               $this->getOutputInstance()->outputStream($message, $stripTags);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -105,26 +178,189 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
        }
 
        /**
-        * This method shall send debug output which can be HTML code for the
-        * browser or debug lines for a log file, etc. to the registered debug
-        * output instance.
+        * Outputs a trace message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
         *
-        * @param       $outStream      Data we shall 'stream' out to the world
-        * @param       $stripTags      Whether HTML tags shall be stripped out
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
         */
-       public final function output (string $outStream, bool $stripTags = false) {
-               // Is the output stream set
-               if (empty($outStream)) {
-                       // @TODO Initialization phase
-                       return;
+       public function traceMessage (string $message, bool $doPrint = true, bool $stripTags = false) {
+               // Check parameter
+               //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,doPrint=%d,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, intval($doPrint), intval($stripTags));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (is_null($this->getOutputInstance())) {
                        // Should not be NULL
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                }
 
-               // Use the output instance
-               $this->getOutputInstance()->outputStream($outStream, $stripTags);
+               // Use debug output handler
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking this->outputMessage(%s,%s,%d) ...' . PHP_EOL, __METHOD__, __LINE__, Logger::LOGGER_LEVEL_TRACE, $message, intval($stripTags));
+               $this->outputMessage(Logger::LOGGER_LEVEL_TRACE, $message, $stripTags);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Outputs a debug message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function debugMessage (string $message, bool $doPrint = true, bool $stripTags = false) {
+               // Check parameter
+               //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,doPrint=%d,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, intval($doPrint), intval($stripTags));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (is_null($this->getOutputInstance())) {
+                       // Should not be NULL
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
+               }
+
+               // Use debug output handler
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking this->outputMessage(%s,%s,%d) ...' . PHP_EOL, __METHOD__, __LINE__, $message, intval($stripTags));
+               $this->outputMessage(Logger::LOGGER_LEVEL_DEBUG, $message, $stripTags);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Outputs an informational message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function infoMessage (string $message, bool $doPrint = true, bool $stripTags = false) {
+               // Check parameter
+               //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,doPrint=%d,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, intval($doPrint), intval($stripTags));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (is_null($this->getOutputInstance())) {
+                       // Should not be NULL
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
+               }
+
+               // Use debug output handler
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking this->outputMessage(%s,%s,%d) ...' . PHP_EOL, __METHOD__, __LINE__, Logger::LOGGER_LEVEL_INFO, $message, intval($stripTags));
+               $this->outputMessage(Logger::LOGGER_LEVEL_INFO, $message, $stripTags);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Outputs a warning message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        */
+       public function warningMessage (string $message, bool $doPrint = true, bool $stripTags = false) {
+               // Check parameter
+               //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,doPrint=%d,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, intval($doPrint), intval($stripTags));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (is_null($this->getOutputInstance())) {
+                       // Should not be NULL
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
+               }
+
+               // Use debug output handler
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking this->outputMessage(%s,%s,%d) ...' . PHP_EOL, __METHOD__, __LINE__, Logger::LOGGER_LEVEL_WARNING, $message, intval($stripTags));
+               $this->outputMessage(Logger::LOGGER_LEVEL_WARNING, $message, $stripTags);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Output a partial stub message for the caller method
+        *
+        * @param       $message        An optional message to display
+        * @return      void
+        */
+       public function partialStub (string $message = '') {
+               // Init variable
+               //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message);
+               $stubMessage = 'Partial stub!';
+
+               // Is an extra message given?
+               if (!empty($message)) {
+                       // Then add it as well
+                       $stubMessage .= ' Message: ' . $message;
+               }
+
+               // Output stub message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking this->outputMessage(%s,%s) ...' . PHP_EOL, __METHOD__, __LINE__, Logger::LOGGER_LEVEL_WARNING, $subMessage);
+               $this->outputMessage(Logger::LOGGER_LEVEL_WARNING, $stubMessage);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Outputs a deprecated message whether to debug instance (should be set!) or
+        * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to
+        * ApplicationEntryPoint::app_exit(), this would cause an endless loop.
+        *
+        * @param       $message        Message we shall send out...
+        * @param       $doPrint        Whether print or die here (default: print)
+        * @paran       $stripTags      Whether to strip tags (default: false)
+        * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
+        * @throws      NullPointerException    If this->outputInstance is NULL
+        * @todo        Remove $doPrint parameter
+        * @todo        When all old method invocations are fixed, renamed this do deprecatedMessage
+        */
+       public function debugOutput (string $message, bool $doPrint = true, bool $stripTags = false) {
+               // Check parameter
+               //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,doPrint=%d,stripTags=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, intval($doPrint), intval($stripTags));
+               if (empty($message)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "message" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (is_null($this->getOutputInstance())) {
+                       // Should not be NULL
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
+               }
+
+               // Invoke Inner method
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking this->outputMessage(%s,%s) ...' . PHP_EOL, __METHOD__, __LINE__, Logger::LOGGER_LEVEL_DEPRECATED, $subMessage);
+               $this->outputMessage(Logger::LOGGER_LEVEL_DEPRECATED, $message, $doPrint, $stripTags);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
 }
index a36e3547a67aec374bbab5459c8ddea4e796b405..f6c649d0da9eda2a470d3ca4443fe14812739094 100644 (file)
@@ -8,10 +8,12 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Handler\Stream\IoHandler;
 use Org\Mxchange\CoreFramework\Middleware\BaseMiddleware;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Traits\Streamer\File\Input\FileInputStreamerTrait;
 use Org\Mxchange\CoreFramework\Traits\Streamer\File\Output\FileOutputStreamerTrait;
 
 // Import SPL stuff
+use \InvalidArgumentException;
 use \SplFileInfo;
 
 /**
@@ -20,7 +22,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -54,28 +56,34 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         */
        private function __construct () {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CONSTRUCTED!');
                parent::__construct(__CLASS__);
 
                // Set own instance
                self::$selfInstance = $this;
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: EXIT!');
        }
 
        /**
         * Creates an instance of this class and prepares the IO system. This is
         * being done by setting the default file IO class
         *
-        * @return      $ioInstance             A prepared instance of FilIOHandler
+        * @return      $ioHandlerInstance      A prepared instance of FilIoHandler
         */
        public static final function createFileIoHandler () {
                // Get instance
-               $ioHandler = new FileIoHandler();
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CALLED!');
+               $ioHandlerInstance = new FileIoHandler();
 
                // Set the *real* file IO instances (both the same)
-               $ioHandler->setInputStreamerInstance(ObjectFactory::createObjectByConfiguredName('file_input_class'));
-               $ioHandler->setOutputStreamerInstance(ObjectFactory::createObjectByConfiguredName('file_output_class'));
+               $ioHandlerInstance->setInputStreamerInstance(ObjectFactory::createObjectByConfiguredName('file_input_class'));
+               $ioHandlerInstance->setOutputStreamerInstance(ObjectFactory::createObjectByConfiguredName('file_output_class'));
 
                // Return instance
-               return $ioHandler;
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: ioHandlerInstance=%s - EXIT!', $ioHandlerInstance->__toString()));
+               return $ioHandlerInstance;
        }
 
        /**
@@ -84,6 +92,8 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @return      $selfInstance   An instance of this class
         */
        public static final function getSelfInstance () {
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: Returning self::selfInstance[]=%s - EXIT!', gettype(self::$selfInstance)));
                return self::$selfInstance;
        }
 
@@ -97,8 +107,9 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function saveFile (SplFileInfo $infoInstance, array $dataArray) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('infoInstance.pathname=' . $infoInstance->getPathname() . ',dataArray()=' . count($dataArray));
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+               // Trace message for logging parameters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: infoInstance.pathname=%s,dataArray()=%d - CALLED!', $infoInstance->getPathname(), count($dataArray)));
+               throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -108,25 +119,35 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @param       $dataStream                     File data stream
         * @param       $objectInstance         An instance of a FrameworkInterface class (default: NULL)
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function saveStreamToFile (SplFileInfo $infoInstance, string $dataStream, FrameworkInterface $objectInstance = NULL) {
+               // Check parameters
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: infoInstance=%s,dataStream()=%d,objectInstance[]=%s - CALLED!', $infoInstance->__toString(), strlen($dataStream), gettype($objectInstance)));
+               if (empty($dataStream)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
                // Default is this array
                $className = $this->__toString();
 
                // Is the object instance set?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-HANDLER: className=%s - BEFORE!', $className));
                if ($objectInstance instanceof FrameworkInterface) {
                        // Then use this
                        $className = $objectInstance->__toString();
                }
 
-               // Prepare output array
-               $dataArray = array(
+               // Send the infoInstance and data array to the output handler
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-IO-HANDLER: className=%s - AFTER!', $className));
+               $this->getOutputStreamerInstance()->saveFile($infoInstance, [
                        0 => $className,
                        1 => $dataStream
-               );
+               ]);
 
-               // Send the infoInstance and dataArray to the output handler
-               $this->getOutputStreamerInstance()->saveFile($infoInstance, $dataArray);
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: EXIT!');
        }
 
        /** Loads data from a file over the input handler
@@ -136,6 +157,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         */
        public function loadFileContents (SplFileInfo $infoInstance) {
                // Read from the input handler
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: infoInstance=%s - CALLED!', $infoInstance->__toString()));
                return $this->getInputStreamerInstance()->loadFileContents($infoInstance);
        }
 
@@ -146,7 +168,12 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @todo        0% done
         */
        public function determineSeekPosition () {
-               $this->partialStub();
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CALLED!');
+               DebugMiddleware::getSelfInstance()->partialStub();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: EXIT!');
        }
 
        /**
@@ -155,18 +182,36 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @param       $offset         Offset to seek to (or used as "base" for other seeks)
         * @param       $whence         Added to offset (default: only use offset to seek to)
         * @return      void
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function seek (int $offset, int $whence = SEEK_SET) {
-               $this->partialStub('offset=' . $offset . ',whence=' . $whence);
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: offset=%d,whence=%d - CALLED!', $offset, $whence));
+               if ($offset < 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "offset" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // @TODO Unfinished work
+               DebugMiddleware::getSelfInstance()->partialStub('offset=' . $offset . ',whence=' . $whence);
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: EXIT!');
        }
 
        /**
         * Size of file stack
         *
         * @return      $size   Size (in bytes) of file
+        * @todo        0% done
         */
        public function size () {
-               $this->partialStub();
+               // @TODO: Unfinished method:
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CALLED!');
+               DebugMiddleware::getSelfInstance()->partialStub();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: EXIT!');
        }
 
        /**
@@ -176,7 +221,12 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @todo        0% done
         */
        public function getPosition () {
-               $this->partialStub();
+               // @TODO: Unfinished method:
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CALLED!');
+               DebugMiddleware::getSelfInstance()->partialStub();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: EXIT!');
        }
 
 }
diff --git a/framework/main/tests/commands/console/class_TestsConsoleMainCommand.php b/framework/main/tests/commands/console/class_TestsConsoleMainCommand.php
deleted file mode 100644 (file)
index a390fd6..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Command;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Command\BaseCommand;
-use Org\Mxchange\CoreFramework\Command\Commandable;
-use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
-use Org\Mxchange\CoreFramework\Request\Requestable;
-use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
-use Org\Mxchange\CoreFramework\Response\Responseable;
-
-/**
- * A command for the 'main' routine
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class TestsConsoleMainCommand extends BaseCommand implements Commandable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this class
-        *
-        * @param       $resolverInstance       An instance of a command resolver class
-        * @return      $commandInstance        An instance a prepared command class
-        */
-       public static final function createTestsConsoleMainCommand (CommandResolver $resolverInstance) {
-               // Get new instance
-               $commandInstance = new TestsConsoleMainCommand();
-
-               // 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) {
-               // Debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Starting tests ... ---');
-
-               // Get controller
-               $controllerInstance = GenericRegistry::getRegistry()->getInstance('controller');
-
-               // Run all tests
-               $controllerInstance->executeTestsFilters($requestInstance, $responseInstance);
-
-               // Debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Leaving main ... ---');
-       }
-
-       /**
-        * Adds extra filters to the given controller instance
-        *
-        * @param       $controllerInstance             A controller instance
-        * @param       $requestInstance                An instance of a class with an Requestable interface
-        * @return      void
-        */
-       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
-               // Add pre filters (e.g. for requirements checks)
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('tests_php_requirements_filter_class'));
-
-               // Add 'tests' filters which will run the actual tests
-               $controllerInstance->addTestsFilter(ObjectFactory::createObjectByConfiguredName('tests_configuration_classes_loadable_test_filter_class'));
-       }
-
-}
diff --git a/framework/main/tests/controller/console/class_TestsConsoleDefaultNewsController.php b/framework/main/tests/controller/console/class_TestsConsoleDefaultNewsController.php
deleted file mode 100644 (file)
index 8ed89f9..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Controller;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Controller\BaseController;
-use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Request\Requestable;
-use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
-use Org\Mxchange\CoreFramework\Response\Responseable;
-
-/**
- * The default controller with news for e.g. home or news page
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class TestsConsoleDefaultNewsController extends BaseController implements Controller {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Init additional filter chains
-               foreach (array('bootstrap', 'tests', 'shutdown') as $filterChain) {
-                       $this->initFilterChain($filterChain);
-               }
-       }
-
-       /**
-        * Creates an instance of this class
-        *
-        * @param       $resolverInstance               An instance of a command resolver class
-        * @return      $controllerInstance             A prepared instance of this class
-        */
-       public static final function createTestsConsoleDefaultNewsController (CommandResolver $resolverInstance) {
-               // Create the instance
-               $controllerInstance = new TestsConsoleDefaultNewsController();
-
-               // Set the command resolver
-               $controllerInstance->setResolverInstance($resolverInstance);
-
-               // Add news filters to this controller
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter_class'));
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter_class'));
-
-               // Return the prepared instance
-               return $controllerInstance;
-       }
-
-       /**
-        * Handles the given request and response
-        *
-        * @param       $requestInstance        An instance of a request class
-        * @param       $responseInstance       An instance of a response class
-        * @return      void
-        */
-       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get the command instance from the resolver by sending a request instance to the resolver
-               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
-
-               // Add more filters by the command
-               $commandInstance->addExtraFilters($this, $requestInstance);
-
-               // Run the pre filters
-               $this->executePreFilters($requestInstance, $responseInstance);
-
-               // This request was valid! :-D
-               $requestInstance->requestIsValid();
-
-               // Execute the command
-               $commandInstance->execute($requestInstance, $responseInstance);
-
-               // Run the post filters
-               $this->executePostFilters($requestInstance, $responseInstance);
-
-               // Flush the response out
-               $responseInstance->flushBuffer();
-       }
-
-       /**
-        * Add a bootstrap filter
-        *
-        * @param       $filterInstance         A Filterable class
-        * @return      void
-        */
-       public function addBootstrapFilter (Filterable $filterInstance) {
-               $this->addFilter('bootstrap', $filterInstance);
-       }
-
-       /**
-        * Add a tests filter
-        *
-        * @param       $filterInstance         A Filterable class
-        * @return      void
-        */
-       public function addTestsFilter (Filterable $filterInstance) {
-               $this->addFilter('tests', $filterInstance);
-       }
-
-       /**
-        * Executes all bootstrap filters
-        *
-        * @param       $requestInstance        A Requestable class
-        * @param       $responseInstance       A Responseable class
-        * @return      void
-        */
-       public function executeBootstrapFilters (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->executeFilters('bootstrap', $requestInstance, $responseInstance);
-       }
-
-       /**
-        * Executes all tests filters
-        *
-        * @param       $requestInstance        A Requestable class
-        * @param       $responseInstance       A Responseable class
-        * @return      void
-        */
-       public function executeTestsFilters (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->executeFilters('tests', $requestInstance, $responseInstance);
-       }
-
-}
diff --git a/framework/main/tests/filter/class_BaseTestsFilter.php b/framework/main/tests/filter/class_BaseTestsFilter.php
deleted file mode 100644 (file)
index c6b5242..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Filter;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Filter\BaseFilter;
-
-/**
- * A generic filter for tests
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-abstract class BaseTestsFilter extends BaseFilter {
-       /**
-        * Protected constructor
-        *
-        * @param       $className      Real name of class
-        * @return      void
-        */
-       protected function __construct (string $className) {
-               // Call parent constructor
-               parent::__construct($className);
-       }
-
-}
diff --git a/framework/main/tests/filter/tests/class_Tests b/framework/main/tests/filter/tests/class_Tests
deleted file mode 100644 (file)
index 86a09e2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Filter\!!!;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Request\Requestable;
-use Org\Mxchange\CoreFramework\Response\Responseable;
-use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
-
-/**
- * A ??? filter for tests
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class Tests???Filter extends BaseTestsFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public final static function createTests???Filter () {
-               // Get a new instance
-               $filterInstance = new Tests???Filter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @todo        0% done
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Implement this!
-               $this->partialStub('Please implement this method.');
-       }
-
-}
diff --git a/framework/main/tests/filter/tests/configuration/class_TestConfiguration b/framework/main/tests/filter/tests/configuration/class_TestConfiguration
deleted file mode 100644 (file)
index 7d26820..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Filter\Configuration\!!!;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Request\Requestable;
-use Org\Mxchange\CoreFramework\Response\Responseable;
-use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
-
-/**
- * A ??? filter for tests
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class TestConfiguration???Filter extends BaseTestsFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public final static function createTestConfiguration???Filter () {
-               // Get a new instance
-               $filterInstance = new TestConfiguration???Filter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @todo        0% done
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Implement this!
-               $this->partialStub('Please implement this method.');
-       }
-
-}
diff --git a/framework/main/tests/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php b/framework/main/tests/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php
deleted file mode 100644 (file)
index d2b92e2..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Filter\Configuration\Classes;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
-use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Request\Requestable;
-use Org\Mxchange\CoreFramework\Response\Responseable;
-use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
-
-// Import SPL stuff
-use \InvalidArgumentException;
-
-/**
- * A LoadableClasses filter for tests
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class TestConfigurationLoadableClassesFilter extends BaseTestsFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public final static function createTestConfigurationLoadableClassesFilter () {
-               // Get a new instance
-               $filterInstance = new TestConfigurationLoadableClassesFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @todo        0% done
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Init counter
-               $passed = 0;
-               $failed = 0;
-
-               // Loop through all configuration keys
-               foreach (FrameworkBootstrap::getConfigurationInstance()->getConfigurationArray() as $configKey => $configValue) {
-                       // Key must end with _class
-                       if (substr($configKey, -6, 6) != '_class') {
-                               // Skip this
-                               continue;
-                       }
-
-                       // Output message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Testing configKey[%s]=%s,configValue[%s]=%s', gettype($configKey), $configKey, gettype($configValue), $configValue));
-
-                       // This may throw exceptions
-                       try {
-                               // Is the config entry valid and class is there?
-                               if (!is_string($configValue)) {
-                                       // Is not a string
-                                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('configValue=%s has unexpected type "%s". FAILED', $configValue, gettype($configValue)));
-
-                                       // Skip further tests
-                                       $failed++;
-                                       continue;
-                               } elseif (!class_exists($configValue)) {
-                                       // Class not found
-                                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" not found. FAILED', $configValue));
-
-                                       // Skip further tests
-                                       $failed++;
-                                       continue;
-                               }
-                       } catch (InvalidArgumentException $e) {
-                               // Maybe not conform?
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" failed to load. Message: "%s"', $configValue, $e->getMessage()));
-
-                               // Skip further tests
-                               $failed++;
-                               continue;
-                       }
-
-                       // class_exists() didn't fail
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" loaded successfully. OKAY', $configValue));
-                       $passed++;
-               }
-
-               // Output result
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Test result: %d okay, %d failed (%0.02f%% passed)', $passed, $failed, ($passed / ($passed + $failed) * 100)));
-       }
-
-}
diff --git a/framework/main/tests/filter/tests/requirements/class_TestsPhpRequirementsFilter.php b/framework/main/tests/filter/tests/requirements/class_TestsPhpRequirementsFilter.php
deleted file mode 100644 (file)
index 2c434df..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Filter\Requirements;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Request\Requestable;
-use Org\Mxchange\CoreFramework\Response\Responseable;
-use Org\Mxchange\CoreFramework\Tests\Filter\BaseTestsFilter;
-
-/**
- * A PhpRequirements filter for tests
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class TestsPhpRequirementsFilter extends BaseTestsFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public final static function createTestsPhpRequirementsFilter () {
-               // Get a new instance
-               $filterInstance = new TestsPhpRequirementsFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @todo        0% done
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Implement this!
-               $this->partialStub('Please implement this method.');
-       }
-
-}
diff --git a/framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php b/framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php
deleted file mode 100644 (file)
index 256b11c..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Resolver\Command;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
-use Org\Mxchange\CoreFramework\Resolver\Command\BaseCommandResolver;
-use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
-
-// Import SPL stuff
-use \InvalidArgumentException;
-
-/**
- * A command resolver for console commands
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class TestsConsoleCommandResolver extends BaseCommandResolver implements CommandResolver {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set prefix to "TestsConsole"
-               $this->setClassPrefix('tests_console');
-       }
-
-       /**
-        * Creates an instance of a TestsConsole command resolver with a given default command
-        *
-        * @param       $commandName                            The default command we shall execute
-        * @return      $resolverInstance                       The prepared command resolver instance
-        * @throws      InvalidArgumentException                Thrown if default command is not set
-        * @throws      InvalidCommandException         Thrown if default command is invalid
-        */
-       public static final function createTestsConsoleCommandResolver (string $commandName) {
-               // Create the new instance
-               $resolverInstance = new TestsConsoleCommandResolver();
-
-               // Is the variable $commandName set and the command is valid?
-               if (empty($commandName)) {
-                       // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "commandName" is empty');
-               } elseif ($resolverInstance->isCommandValid('Org\Mxchange\CoreFramework\Tests\Command', $commandName) === false) {
-                       // Invalid command found
-                       throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               }
-
-               // Set namespace for command
-               $resolverInstance->setNamespace('Org\Mxchange\CoreFramework\Tests\Command');
-               $resolverInstance->setCommandName($commandName);
-
-               // Return the prepared instance
-               return $resolverInstance;
-       }
-
-}
diff --git a/framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php b/framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php
deleted file mode 100644 (file)
index 2076757..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Tests\Resolver\Controller;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Controller\BaseController;
-use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
-use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
-use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
-
-// Import SPL stuff
-use \InvalidArgumentException;
-
-/**
- * A resolver for resolving controllers locally
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class TestsConsoleControllerResolver extends BaseControllerResolver implements ControllerResolver {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       private function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set prefix to "TestsConsole"
-               $this->setClassPrefix('tests_console');
-       }
-
-       /**
-        * Creates an instance of a resolver class with a given command
-        *
-        * @param       $controllerName                         The controller we shall resolve
-        * @return      $resolverInstance                       The prepared controller resolver instance
-        * @throws      InvalidArgumentException                Thrown if default command is not set
-        * @throws      InvalidControllerException      Thrown if default controller is invalid
-        */
-       public static final function createTestsConsoleControllerResolver (string $controllerName) {
-               // Create the new instance
-               $resolverInstance = new TestsConsoleControllerResolver();
-
-               // Is the variable $controllerName set and the command is valid?
-               if (empty($controllerName)) {
-                       // Then thrown an exception here
-                       throw new InvalidArgumentException('Parameter "controllerName" is empty');
-               } elseif ($resolverInstance->isControllerValid('Org\Mxchange\CoreFramework\Tests\Controller', $controllerName) === false) {
-                       // Invalid command found
-                       throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
-               }
-
-               // Set namespace and controller name
-               $resolverInstance->setNamespace('Org\Mxchange\CoreFramework\Tests\Controller');
-               $resolverInstance->setControllerName($controllerName);
-
-               // Return the prepared instance
-               return $resolverInstance;
-       }
-
-}
diff --git a/framework/main/third_party/akismet/akismet.class.php b/framework/main/third_party/akismet/akismet.class.php
deleted file mode 100644 (file)
index 021447e..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-<?php
-/**
- * 01.07.2008 22:32:28est
- * 
- * Akismet PHP4 class
- * 
- * <b>Usage</b>
- * <code>
- *    $comment = array(
- *           'author'    => 'viagra-test-123',
- *           'email'     => 'test@example.com',
- *           'website'   => 'http://www.example.com/',
- *           'body'      => 'This is a test comment',
- *           'permalink' => 'http://yourdomain.com/yourblogpost.url',
- *        );
- *
- *    $akismet = new Akismet('http://www.yourdomain.com/', 'YOUR_WORDPRESS_API_KEY', $comment);
- *
- *    if($akismet->errorsExist()) {
- *        echo"Couldn't connected to Akismet server!";
- *    } else {
- *        if($akismet->isSpam()) {
- *            echo"Spam detected";
- *        } else {
- *            echo"yay, no spam!";
- *        }
- *    }
- * </code>
- * 
- * @author Bret Kuhns {@link www.miphp.net}
- * @link http://www.miphp.net/blog/view/new_akismet_class/
- * @version 0.3.4
- * @license http://www.opensource.org/licenses/mit-license.php MIT License
- */
-
-
-
-// Error constants
-define("AKISMET_SERVER_NOT_FOUND",     0);
-define("AKISMET_RESPONSE_FAILED",      1);
-define("AKISMET_INVALID_KEY",          2);
-
-
-
-// Base class to assist in error handling between Akismet classes
-class AkismetObject {
-       var $errors = array();
-       
-       
-       /**
-        * Add a new error to the errors array in the object
-        *
-        * @param       String  $name   A name (array key) for the error
-        * @param       String  $string The error message
-        * @return void
-        */ 
-       // Set an error in the object
-       function setError($name, $message) {
-               $this->errors[$name] = $message;
-       }
-       
-
-       /**
-        * Return a specific error message from the errors array
-        *
-        * @param       String  $name   The name of the error you want
-        * @return mixed        Returns a String if the error exists, a false boolean if it does not exist
-        */
-       function getError($name) {
-               if($this->isError($name)) {
-                       return $this->errors[$name];
-               } else {
-                       return false;
-               }
-       }
-       
-       
-       /**
-        * Return all errors in the object
-        *
-        * @return String[]
-        */ 
-       function getErrors() {
-               return (array)$this->errors;
-       }
-       
-       
-       /**
-        * Check if a certain error exists
-        *
-        * @param       String  $name   The name of the error you want
-        * @return boolean
-        */ 
-       function isError($name) {
-               return isset($this->errors[$name]);
-       }
-       
-       
-       /**
-        * Check if any errors exist
-        *
-        * @return boolean
-        */
-       function errorsExist() {
-               return (count($this->errors) > 0);
-       }
-       
-       
-}
-
-
-
-
-
-// Used by the Akismet class to communicate with the Akismet service
-class AkismetHttpClient extends AkismetObject {
-       var $akismetVersion = '1.1';
-       var $con;
-       var $host;
-       var $port;
-       var $apiKey;
-       var $blogUrl;
-       var $errors = array();
-       
-       
-       // Constructor
-       function AkismetHttpClient($host, $blogUrl, $apiKey, $port = 80) {
-               $this->host = $host;
-               $this->port = $port;
-               $this->blogUrl = $blogUrl;
-               $this->apiKey = $apiKey;
-       }
-       
-       
-       // Use the connection active in $con to get a response from the server and return that response
-       function getResponse($request, $path, $type = "post", $responseLength = 1160) {
-               $this->_connect();
-               
-               if($this->con && !$this->isError(AKISMET_SERVER_NOT_FOUND)) {
-                       $request  = 
-                                       strToUpper($type)." /{$this->akismetVersion}/$path HTTP/1.1\r\n" .
-                                       "Host: ".((!empty($this->apiKey)) ? $this->apiKey."." : null)."{$this->host}\r\n" .
-                                       "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" .
-                                       "Content-Length: ".strlen($request)."\r\n" .
-                                       "User-Agent: Akismet PHP4 Class\r\n" .
-                                       "\r\n" .
-                                       $request
-                               ;
-                       $response = "";
-
-                       @fwrite($this->con, $request);
-
-                       while(!feof($this->con)) {
-                               $response .= @fgets($this->con, $responseLength);
-                       }
-
-                       $response = explode("\r\n\r\n", $response, 2);
-                       return $response[1];
-               } else {
-                       $this->setError(AKISMET_RESPONSE_FAILED, "The response could not be retrieved.");
-               }
-               
-               $this->_disconnect();
-       }
-       
-       
-       // Connect to the Akismet server and store that connection in the instance variable $con
-       function _connect() {
-               if(!($this->con = @fsockopen($this->host, $this->port))) {
-                       $this->setError(AKISMET_SERVER_NOT_FOUND, "Could not connect to akismet server.");
-               }
-       }
-       
-       
-       // Close the connection to the Akismet server
-       function _disconnect() {
-               @fclose($this->con);
-       }
-       
-       
-}
-
-
-
-
-
-// The controlling class. This is the ONLY class the user should instantiate in
-// order to use the Akismet service!
-class Akismet extends AkismetObject {
-       var $apiPort = 80;
-       var $akismetServer = 'rest.akismet.com';
-       var $akismetVersion = '1.1';
-       var $http;
-       
-       var $ignore = array(
-                       'HTTP_COOKIE',
-                       'HTTP_X_FORWARDED_FOR',
-                       'HTTP_X_FORWARDED_HOST',
-                       'HTTP_MAX_FORWARDS',
-                       'HTTP_X_FORWARDED_SERVER',
-                       'REDIRECT_STATUS',
-                       'SERVER_PORT',
-                       'PATH',
-                       'DOCUMENT_ROOT',
-                       'SERVER_ADMIN',
-                       'QUERY_STRING',
-                       'PHP_SELF',
-                       'argv'
-               );
-       
-       var $blogUrl = "";
-       var $apiKey  = "";
-       var $comment = array();
-       
-       
-       /**
-        * Constructor
-        * 
-        * Set instance variables, connect to Akismet, and check API key
-        * 
-        * @param       String  $blogUrl        The URL to your own blog
-        * @param       String  $apiKey         Your wordpress API key
-        * @param       String[]        $comment        A formatted comment array to be examined by the Akismet service
-        * @return      Akismet
-        */
-       function Akismet($blogUrl, $apiKey, $comment = array()) {
-               $this->blogUrl = $blogUrl;
-               $this->apiKey  = $apiKey;
-               $this->setComment($comment);
-               
-               // Connect to the Akismet server and populate errors if they exist
-               $this->http = new AkismetHttpClient($this->akismetServer, $blogUrl, $apiKey);
-               if($this->http->errorsExist()) {
-                       $this->errors = array_merge($this->errors, $this->http->getErrors());
-               }
-               
-               // Check if the API key is valid
-               if(!$this->_isValidApiKey($apiKey)) {
-                       $this->setError(AKISMET_INVALID_KEY, "Your Akismet API key is not valid.");
-               }
-       }
-       
-       
-       /**
-        * Query the Akismet and determine if the comment is spam or not
-        * 
-        * @return      boolean
-        */
-       function isSpam() {
-               $response = $this->http->getResponse($this->_getQueryString(), 'comment-check');
-               
-               return ($response == "true");
-       }
-       
-       
-       /**
-        * Submit this comment as an unchecked spam to the Akismet server
-        * 
-        * @return      void
-        */
-       function submitSpam() {
-               $this->http->getResponse($this->_getQueryString(), 'submit-spam');
-       }
-       
-       
-       /**
-        * Submit a false-positive comment as "ham" to the Akismet server
-        *
-        * @return      void
-        */
-       function submitHam() {
-               $this->http->getResponse($this->_getQueryString(), 'submit-ham');
-       }
-       
-       
-       /**
-        * Manually set the comment value of the instantiated object.
-        *
-        * @param       Array   $comment
-        * @return      void
-        */
-       function setComment($comment) {
-               $this->comment = $comment;
-               if(!empty($comment)) {
-                       $this->_formatCommentArray();
-                       $this->_fillCommentValues();
-               }
-       }
-       
-       
-       /**
-        * Returns the current value of the object's comment array.
-        *
-        * @return      Array
-        */
-       function getComment() {
-               return $this->comment;
-       }
-       
-       
-       /**
-        * Check with the Akismet server to determine if the API key is valid
-        *
-        * @access      Protected
-        * @param       String  $key    The Wordpress API key passed from the constructor argument
-        * @return      boolean
-        */
-       function _isValidApiKey($key) {
-               $keyCheck = $this->http->getResponse("key=".$this->apiKey."&blog=".$this->blogUrl, 'verify-key');
-                       
-               return ($keyCheck == "valid");
-       }
-       
-       
-       /**
-        * Format the comment array in accordance to the Akismet API
-        *
-        * @access      Protected
-        * @return      void
-        */
-       function _formatCommentArray() {
-               $format = array(
-                               'type' => 'comment_type',
-                               'author' => 'comment_author',
-                               'email' => 'comment_author_email',
-                               'website' => 'comment_author_url',
-                               'body' => 'comment_content'
-                       );
-               
-               foreach($format as $short => $long) {
-                       if(isset($this->comment[$short])) {
-                               $this->comment[$long] = $this->comment[$short];
-                               unset($this->comment[$short]);
-                       }
-               }
-       }
-       
-       
-       /**
-        * Fill any values not provided by the developer with available values.
-        *
-        * @return      void
-        */
-       function _fillCommentValues() {
-               if(!isset($this->comment['user_ip'])) {
-                       $this->comment['user_ip'] = ($_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR')) ? $_SERVER['REMOTE_ADDR'] : getenv('HTTP_X_FORWARDED_FOR');
-               }
-               if(!isset($this->comment['user_agent'])) {
-                       $this->comment['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
-               }
-               if(!isset($this->comment['referrer'])) {
-                       $this->comment['referrer'] = $_SERVER['HTTP_REFERER'];
-               }
-               if(!isset($this->comment['blog'])) {
-                       $this->comment['blog'] = $this->blogUrl;
-               }
-       }
-       
-       
-       /**
-        * Build a query string for use with HTTP requests
-        *
-        * @access      Protected
-        * @return      String
-        */
-       function _getQueryString() {
-               foreach($_SERVER as $key => $value) {
-                       if(!in_array($key, $this->ignore)) {
-                               if($key == 'REMOTE_ADDR') {
-                                       $this->comment[$key] = $this->comment['user_ip'];
-                               } else {
-                                       $this->comment[$key] = $value;
-                               }
-                       }
-               }
-
-               $query_string = '';
-
-               foreach($this->comment as $key => $data) {
-                       $query_string .= $key . '=' . urlencode(stripslashes($data)) . '&';
-               }
-
-               return $query_string;
-       }
-       
-       
-}
-?>
\ No newline at end of file
diff --git a/framework/main/third_party/scrypt/CREDITS b/framework/main/third_party/scrypt/CREDITS
deleted file mode 100644 (file)
index 79c72e5..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-scrypt
-Dominic Black
\ No newline at end of file
diff --git a/framework/main/third_party/scrypt/LICENSE b/framework/main/third_party/scrypt/LICENSE
deleted file mode 100644 (file)
index 381d3af..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Original Scrypt Implementation;
-  Copyright (c) 2009 Colin Percival
-
-PHP Module;
-  Copyright (c) 2012, Dominic Black
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/framework/main/third_party/scrypt/README.md b/framework/main/third_party/scrypt/README.md
deleted file mode 100644 (file)
index fef282b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-PHP scrypt module
-=================
-
-[![Build Status](https://travis-ci.org/DomBlack/php-scrypt.svg?branch=master)](https://travis-ci.org/DomBlack/php-scrypt)
-
-This is a PHP library providing a wrapper to [Colin Percival's scrypt implementation](http://www.tarsnap.com/scrypt.html). Scrypt is a key derivation function designed to be far more secure against hardware brute-force attacks than alternative functions such as PBKDF2 or bcrypt.
-
-Details of the scrypt key derivation function are given in a paper by Colin Percival, Stronger Key Derivation via Sequential Memory-Hard Functions: [PDF](http://www.tarsnap.com/scrypt/scrypt-slides.pdf).
-
-An example class using this module can be found in; scrypt.php
-
-Join in!
---------
-
-We are happy to receive bug reports, fixes, documentation enhancements, and other improvements.
-
-Please report bugs via the [github issue tracker](http://github.com/DomBlack/php-scrypt/issues).
-
-Master [git repository](https://github.com/DomBlack/php-scrypt):
-
-    git clone git://github.com/DomBlack/php-scrypt.git
-
-Authors
--------
-
-This library is written and maintained by Dominic Black, <thephenix@gmail.com>.
-
-----
-
-PECL Install
-============
-
-This extension is now avaible through PECL.
-
-```
-pecl install scrypt
-```
-
-Build From Source
-=================
-
-Unix/OSX
---------
-
-1. `phpize`
-2. If on OSX; `export CFLAGS='-arch i386 -arch x86_64'`
-3. `./configure --enable-scrypt`
-4. `make`
-5. `make install`
-6. Add the extension to your php.ini
-
-````
-    ; Enable scrypt extension module
-    extension=scrypt.so
-````
-
-Windows
--------
-
-Using Visual Studio 2008 (or Visual C++ Express 2008) open up the attached project
-inside the VS2008 folder. This project assumes you have the PHP thread safe source at;
-`C:\phpsrcts\`, a PHP install at `C:\php\` and this source code extracted to
-`C:\php-scrypt\`.
-
-1. Build the project.
-2. Copy the resultant `scrypt.dll` to your ext directory in PHP.
-3. Add the extension to your php.ini
-
-````
-    ; Enable scrypt extension module
-    extension=scrypt.dll
-````
-
-Legal Stuff
-===========
-This works is licensed under the BSD 2-Clause license.
-
-Original Scrypt Implementation;
- Copyright (c) 2009 Colin Percival
-
-PHP Module;
- Copyright (c) 2012, Dominic Black
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
index 3a1581c6c23380ca9cbb868cda4409ce2139f878..deaa10f4e932e156224399001dd1f2b39a09ffa7 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Cache\Cacheable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index e2bd1373898c35dcc4fad90233282053ee4e93a8..1c33606564e59741432f19b3c576e382f647ddc1 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Middleware\Compressor\CompressorChannel;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8d8c89ad0f5c650a9383c06ce6492c4ea1eb8524..1fe82416bda87ef2bb0657dfa36bfc1eeac63e10 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Crypto\Cryptable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8e868214d1730cdd09a42090d61d25cfa755082e..ad876fdaee686ae2d57a070aa4df8a49ede08ec0 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\DatabaseFrontend;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 7cddf35ec079574fd0306beae343f7076a962bd8..b8087ae47c6a976656132e0fb3fb473a1b5229c0 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Filesystem\File\BinaryFile;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index 7f80b635a8fd8f7cbd489b4aacf476eb865fc76f..feda63405f4b130353828ae9ae3797c9324b952f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Handler\Stream\IoHandler;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 29e6e3f2f3f723ce211637a09bda4045891defd1..f49ae2231dc8c338778a8dde6418dd5b75fa2b8f 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Helper\Helper;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f8829d211fa30436b9d963e31cb5312ce8b67eb3..55f3fb29f1a7a53f5785d7030ed82c7f84245f3a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Index\Indexable;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index ded4abb6e0c3be640a9824b5db7b14aa0988e70e..dadd98464310e074682bedd6e8e05a8da96d80a8 100644 (file)
@@ -10,7 +10,7 @@ use \Iterator;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 19521f6d04bf4b7feab7410b02067700278a0bd9..1b74cb6de1672bf6e3afb97782116e5b17eacdc6 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Lists\Listable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 960477c7d80e1bed97ad9b6a47e4a19958435692..3348ef44646ad95a4590554d62241c49c74dd05e 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\User\ManageableAccount;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3d216ebabd3751ee4c34f5f23f06f66039f7aaf2..0471319da9214ec2261a11aada640abc9315b24a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Registry\Register;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
index e16698b377aa211d95fba115ea4c795c1db52d73..b579f91fac1abe9afc0d64576492ab036c43d77c 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Resolver\Resolver;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f00608eb8270792c2ce37050949365c3cf68c75f..31cb13d69ce13e4faba3f34d9d16745d9c54d513 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index d596ce45566988f778bd1912506895509efbe536..3d962e670d957dda582def9eb2a341b471f82b57 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stack\Stackable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 6bd0e01f32538b9484505c66615551c3b7e82552..79b67fddcfa5fafbc2fa21d547ad131643d85c51 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\State\Stateable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index bf11217ea2fe74129a4d8b3f2b8145b0b7a6490b..27295149b7fe598d5fe5967666dc085f61e331c5 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Input\InputStream;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 4c9bd2dc7b6080410106031de9065fdbb8b63cbd..bdabafacd7cfdb82b521d2d660c5ee28a1d1b242 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStream;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 3a3f37df5dadba21f75b84234c128b6fd3162e99..d08e884af78a82580ad82273df0167afc9894f23 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Filesystem\FileInputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 8f624b7bc46ea8a6a5fafc39c8191a05a9bc361d..8f8dd67fcc0646198ccb62bd1d6d543be3cdd098 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Filesystem\FileOutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 569cbe8ac59b6df8d87a66ed4896956ff59673f5..916dce52d0e3aa79d2abc70319fcc067594dca05 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index f5aec31b1070a71af7b290e4f4a76db2d8528027..ad1f2d521d2a2c19088719e61864544d1164634d 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 2ac2ed26677e3a3b0aba34a26e72e56aac625215..ab5798b11a1339d904b19caa0d26544eff9f8d40 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
index 51a9f4758ec3a2fbdf28195223f7046ea98c1062..37fa261279410afe592905650fe6afaa2af5454c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -60,9 +60,11 @@ final class ApplicationEntryPoint {
         */
        public static final function exitApplication (string $message = '', int $code = -1, string $extraData = '', bool $silentMode = false) {
                // Is this method already called?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: message=%s,code=%d,extraData=%s,silentMode=%d - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $message, $code, $extraData, intval($silentMode));
                if (isset($GLOBALS['app_die_called'])) {
                        // Then output the text directly
-                       exit($message);
+                       print $message . PHP_EOL;
+                       exit(255);
                }
 
                // This method shall not be called twice
@@ -80,7 +82,8 @@ final class ApplicationEntryPoint {
                // Do we have debug installation?
                if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === true)) {
                        // Abort here
-                       exit;
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: product_install_mode=%d,silentMode=%d - EXIT!' . PHP_EOL, __METHOD__, __LINE__, $configInstance->getConfigEntry('product_install_mode'), intval($silentMode));
+                       exit(255);
                }
 
                // Get some instances
@@ -173,17 +176,20 @@ final class ApplicationEntryPoint {
                                $responseInstance->flushBuffer();
                        } catch (FileNotFoundException $e) {
                                // Even the template 'emergency_exit' wasn't found so output both message
-                               exit($message . ', exception: ' . $e->getMessage());
+                               print ($message . ', exception: ' . $e->getMessage() . PHP_EOL);
+                               exit($e->getCode());
                        }
 
                        // Good bye...
-                       exit;
+                       exit(255);
                } else {
                        // Output message and die
-                       die(sprintf('[Main:] Emergency exit reached: <span class="emergency_span">%s</span>',
-                               $message
-                       ));
+                       printf('[Main:] Emergency exit reached: <span class="emergency_span">%s</span>', $message);
+                       exit(255);
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -196,16 +202,19 @@ final class ApplicationEntryPoint {
         */
        public static final function detectFrameworkPath () {
                // Is it not set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::frameworkPath=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, self::$frameworkPath);
                if (empty(self::$frameworkPath)) {
                        // Auto-detect core path (first application-common)
-                       foreach (array('core', __DIR__, '/usr/local/share/php/core', '/usr/share/php/core') as $possiblePath) {
+                       foreach (['core', self::getRootPath(), '/usr/local/share/php/core', '/usr/share/php/core'] as $possiblePath) {
                                // Create full path for testing
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: possiblePath=%s' . PHP_EOL, __METHOD__, __LINE__, $possiblePath);
                                $realPath = realpath($possiblePath);
 
                                // Is it false?
                                //* NOISY-DEBUG: */ printf('[%s:%d]: realPath[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($realPath), $realPath);
                                if ($realPath === false) {
                                        // Then, not found.
+                                       //* NOISY-DEBUG: */ printf('[%s:%d]: possiblePath=%s was not found. - SKIPPED!' . PHP_EOL, __METHOD__, __LINE__, $possiblePath);
                                        continue;
                                }
 
@@ -213,6 +222,7 @@ final class ApplicationEntryPoint {
                                $frameworkPath = sprintf('%s%sframework%s', $realPath, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
 
                                // First create full-qualified file name (FQFN) to framework/config-global.php
+                               //* NOISY-DEBUG: */ printf('[%s:%d]: frameworkPath=%s' . PHP_EOL, __METHOD__, __LINE__, $frameworkPath);
                                $configFile = $frameworkPath . 'config-global.php';
 
                                // Is it readable?
@@ -222,11 +232,13 @@ final class ApplicationEntryPoint {
                                        self::$frameworkPath = $frameworkPath;
 
                                        // Abort here
+                                       //* NOISY-DEBUG: */ printf('[%s:%d]: Setting self::frameworkPath=%s - BREAK!' . PHP_EOL, __METHOD__, __LINE__, $frameworkPath);
                                        break;
                                }
                        }
 
                        // Able to find?
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: self::frameworkPath=%s - Checking ...' . PHP_EOL, __METHOD__, __LINE__, self::$frameworkPath);
                        if (!is_dir(self::$frameworkPath)) {
                                // Is no directory
                                throw new Exception('Cannot find framework.');
@@ -234,6 +246,7 @@ final class ApplicationEntryPoint {
                }
 
                // Return it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::frameworkPath=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, self::$frameworkPath);
                return self::$frameworkPath;
        }
 
@@ -257,6 +270,7 @@ final class ApplicationEntryPoint {
         */
        public static final function main () {
                // Load bootstrap file
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                require sprintf('%sbootstrap%sbootstrap.inc.php', self::detectFrameworkPath(), DIRECTORY_SEPARATOR);
 
                /*
@@ -273,13 +287,14 @@ final class ApplicationEntryPoint {
                 * register the application instance in registry.
                 */
                FrameworkBootstrap::startApplication();
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 }
 
 // Log all exceptions (only debug! This option can create large error logs)
 //define('LOG_EXCEPTIONS', true);
 
-//xdebug_start_trace();
-
 // Call above main() method
 ApplicationEntryPoint::main();
index 9e12404c9e6d614a00f90eb289df6fb9e5a42e77..ad7bc9f43f9a5ce492c5758da9cbd7c27ae3b6e1 100644 (file)
@@ -3,7 +3,7 @@
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 
 /*
- * Copyright (C) 2017 - 2022 Core Developer Team
+ * Copyright (C) 2017 - 2023 Core Developer Team
  *
  * 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
@@ -44,4 +44,4 @@ if (extension_loaded('xdebug')) {
 require dirname(__DIR__) . '/vendor/autoload.php';
 
 // Quiet DNS resolver as this is not wanted here
-FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('quiet_dns_resolver', TRUE);
+FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('is_quiet_dns_resolver_enabled', TRUE);
index 061d713d01f81bf1db2431d6efa0e496c04f2b1c..9d3645bfc35bc1e2c90a5c0ade3d65cdad2cfa75 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Bootstrap;
 use Org\Mxchange\CoreFramework\Console\Tools\ConsoleTools;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
+use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 
 // Import PHPUnit stuff
 use PHPUnit\Framework\Error\Notice;
@@ -13,9 +14,10 @@ use PHPUnit\Framework\TestCase;
 
 // Import SPL stuff
 use \InvalidArgumentException;
+use \SplFileInfo;
 
 /*
- * Copyright (C) 2017 - 2022 Core Developer Team
+ * Copyright (C) 2017 - 2023 Core Developer Team
  *
  * 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
@@ -35,7 +37,12 @@ class FrameworkBootstrapTest extends TestCase {
        /**
         * Own IP address
         */
-       private static $ipAddress = FALSE;
+       private static $ipAddress = '0.0.0.0';
+
+       /**
+        * Own host name
+        */
+       private static $hostname = 'host.invalid';
 
        /**
         * Setup test case
@@ -49,24 +56,24 @@ class FrameworkBootstrapTest extends TestCase {
 
                // Trace message
                //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
-
        }
 
        /**
         * Setup test case
         */
        public static function setUpBeforeClass() {
-               // Trace message
-               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
-
                // Call parent method
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                parent::setUpBeforeClass();
 
+               // Lookup own hostname
+               self::$hostname = ConsoleTools::acquireHostname();
+
                // Lookup own IP address
                self::$ipAddress = ConsoleTools::acquireSelfIpAddress();
 
                // Trace message
-               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::ipAddress[%s]=%s,self::hostname=%s - EXIT!' . PHP_EOL, __METHOD__, __LINE__, gettype(self::$ipAddress), self::$ipAddress, self::$hostname);
        }
 
        /**
@@ -103,7 +110,7 @@ class FrameworkBootstrapTest extends TestCase {
         * Tests if detectServerAddress() is returning what it should for tests.
         * This will always be 127.0.0.1.
         */
-       public function testConfigDetectServerAddress () {
+       public function testBootstrapDetectServerAddress () {
                // Call it
                $serverAddress = FrameworkBootstrap::detectServerAddress();
 
@@ -116,12 +123,113 @@ class FrameworkBootstrapTest extends TestCase {
         * This will always be 127.0.0.1. This method should not invoke
         * ConsoleTools's method as the configuration entry is already cached.
         */
-       public function testConfigDetectServerAddressCached () {
+       public function testBootstrapDetectServerAddressCached () {
                // Call it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
                $serverAddress = FrameworkBootstrap::detectServerAddress();
 
                // Should be the same
+               //* NOISY-DEBUG: */ printf('[%s:%d]: self::ipAddress=%s,serverAddress=%s' . PHP_EOL, __METHOD__, __LINE__, self::$ipAddress, $serverAddress);
                $this->assertEquals(self::$ipAddress, $serverAddress);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Tests method BootstrapFramework::isReachableFilePath() with a
+        * non-existing path. $isReachable should always return TRUE as nothing is
+        * restricting PHP.
+        */
+       public function testBootstrapIsReachableFilePathUnrestrictedNotExisting () {
+               // Init SPL file info instance
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+               $infoInstance = new SplFileInfo('/does/not/exist/');
+
+               // Invoke method
+               //* NOISY-DEBUG: */ printf('[%s:%d]: infoInstance=%s' . PHP_EOL, __METHOD__, __LINE__, get_class($infoInstance));
+               $isReachable = FrameworkBootstrap::isReachableFilePath($infoInstance);
+
+               // Test if it is not reachable
+               //* NOISY-DEBUG: */ printf('[%s:%d]: isReachable=%d' . PHP_EOL, __METHOD__, __LINE__, intval($isReachable));
+               $this->assertTrue($isReachable, 'Returned true on a non-existing path');
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Tests method BootstrapFramework::isReachableFilePath() with a
+        * non-existing path. $isReachable should be FALSE here as it is always
+        * outside the scope of open_basedir.
+        */
+       public function testBootstrapIsReachableFilePathRestrictedNotExisting () {
+               // Init SPL file info instance
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+               $infoInstance = new SplFileInfo('/does/not/exist/');
+
+               // "Detect" root path
+               //* NOISY-DEBUG: */ printf('[%s:%d]: infoInstance=%s' . PHP_EOL, __METHOD__, __LINE__, get_class($infoInstance));
+               $rootScriptPath = realpath(dirname(dirname(FrameworkBootstrap::detectScriptPath())));
+
+               // Set it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: open_basedir=%s,rootScriptPath[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, ini_get('open_basedir'), gettype($rootScriptPath), $rootScriptPath);
+               $result = ini_set('open_basedir', $rootScriptPath . ':/etc/');
+
+               // Was it set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: result[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($result));
+               if ($result === FALSE) {
+                       // Didn't work
+                       $this->failed(sprintf('Cannot set open_basepath=%s', $rootScriptPath));
+               }
+
+               // Invoke method
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Testing method FrameworkBootstrap::isReachableFilePath(%s) ...' . PHP_EOL, __METHOD__, __LINE__, get_class($infoInstance));
+               $isReachable = FrameworkBootstrap::isReachableFilePath($infoInstance);
+
+               // Test if 
+               //* NOISY-DEBUG: */ printf('[%s:%d]: isReachable=%d - Testing method ...' . PHP_EOL, __METHOD__, __LINE__, intval($isReachable));
+               $this->assertTrue(!$isReachable, 'Returned true on a non-existing path');
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
+        * Tests method BootstrapFramework::isReachableFilePath() with an
+        * existing path. $isReachable should be TRUE here as it is within the scope
+        * of open_basedir.
+        */
+       public function testBootstrapIsReachableFilePathRestrictedExisting () {
+               // Init SPL file info instance
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+               $infoInstance = new SplFileInfo(__DIR__);
+
+               // "Detect" root path
+               //* NOISY-DEBUG: */ printf('[%s:%d]: infoInstance=%s' . PHP_EOL, __METHOD__, __LINE__, get_class($infoInstance));
+               $rootScriptPath = realpath(dirname(dirname(FrameworkBootstrap::detectScriptPath())));
+
+               // Set it
+               //* NOISY-DEBUG: */ printf('[%s:%d]: rootScriptPath[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($rootScriptPath), $rootScriptPath);
+               $result = ini_set('open_basedir', $rootScriptPath . ':/etc/');
+
+               // Was it set?
+               //* NOISY-DEBUG: */ printf('[%s:%d]: result[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($result));
+               if ($result === FALSE) {
+                       // Didn't work
+                       $this->failed(sprintf('Cannot set open_basepath=%s', $rootScriptPath));
+               }
+
+               // Invoke method
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Testing method FrameworkBootstrap::isReachableFilePath(%s) ...' . PHP_EOL, __METHOD__, __LINE__, get_class($infoInstance));
+               $isReachable = FrameworkBootstrap::isReachableFilePath($infoInstance);
+
+               // Test if 
+               //* NOISY-DEBUG: */ printf('[%s:%d]: isReachable=%d - Testing method ...' . PHP_EOL, __METHOD__, __LINE__, intval($isReachable));
+               $this->assertTrue($isReachable, 'Returned true on a non-existing path');
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
 }
index fb65b3f8dee3cb4f06580fab74dc33c7286dd3ad..2bc7b0fb5597df0d5e1de428f08a0a83ce7fc1de 100644 (file)
@@ -14,6 +14,7 @@ use PHPUnit\Framework\TestCase;
 
 // Import SPL stuff
 use \InvalidArgumentException;
+use \UnexpectedValueException;
 
 /*
  * Copyright (C) 2017 - 2020 - Core Developer Team
@@ -349,4 +350,72 @@ class FrameworkConfigurationTest extends TestCase {
                $dummy = self::$configInstance->isFieldSet('foo');
        }
 
+       /**
+        * Tests isEnabled() method being called with empty parameter
+        */
+       public function testConfigIsEnabledEmptyString () {
+               // Expect IAE
+               $this->expectException(InvalidArgumentException::class);
+
+               // Just invoke it
+               $dummy = self::$configInstance->isEnabled('');
+       }
+
+       /**
+        * Tests isEnabled() method being called with missing configuration key
+        */
+       public function testConfigIsEnabledMissingConfigKey () {
+               // Expect NoConfig
+               $this->expectException(NoConfigEntryException::class);
+
+               // Just invoke it
+               $dummy = self::$configInstance->isEnabled('does_not_exist');
+       }
+
+       /**
+        * Tests isEnabled() method being called with non-boolean configuration key
+        */
+       public function testConfigIsEnabledNonBooleanConfigKey () {
+               // Expect UVE
+               $this->expectException(UnexpectedValueException::class);
+
+               // Set it temporary
+               self::$configInstance->setConfigEntry('is_non_boolean_enabled', 'Y');
+
+               // Just invoke it
+               $dummy = self::$configInstance->isEnabled('non_boolean');
+       }
+
+       /**
+        * Tests isEnabled() method being called with 'single_server'
+        */
+       public function testConfigIsEnabledSingleServerConfigKey () {
+               // Check it on known boolean value
+               $this->assertTrue(is_bool(self::$configInstance->isEnabled('single_server')));
+       }
+
+       /**
+        * Tests if sorting the configuration array is always returning the same
+        * array (but sorted) back.
+        */
+       public function testConfigSortConfigurationArray () {
+               // First get configuration array
+               //* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+               $config = self::$configInstance->getConfigurationArray();
+
+               // Run sort method
+               //* NOISY-DEBUG: */ printf('[%s:%d]: config()=%d' . PHP_EOL, __METHOD__, __LINE__, count($config));
+               self::$configInstance->sortConfigurationArray();
+
+               // This should be an empty array
+               $diff = array_diff($config, self::$configInstance->getConfigurationArray());
+
+               // Check condition
+               //* NOISY-DEBUG: */ printf('[%s:%d]: diff()=%d' . PHP_EOL, __METHOD__, __LINE__, count($diff));
+               $this->assertTrue(count($diff) === 0);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
 }