From b9373eb6c1b134fdef22bda0f97a3e8ca34f3def Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 1 Jan 2018 04:30:14 +0100 Subject: [PATCH] Continued: - "imported" classes/interfaces - created new namespaces - updated core to latest commit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- application/city/class_ApplicationHelper.php | 20 ++++--------------- application/city/classes/actions/class_ | 7 +++++++ .../classes/actions/class_BaseCityAction.php | 7 +++++++ .../city/class_HtmlCityLoginCityMapAction.php | 7 +++++++ .../class_HtmlCityLoginGovernmentAction.php | 7 +++++++ .../html/class_HtmlCityLoginLogoutAction.php | 7 +++++++ .../html/class_HtmlCityLoginProfileAction.php | 7 +++++++ ...class_HtmlCityLoginStatusProblemAction.php | 7 +++++++ .../html/class_HtmlCityLoginWelcomeAction.php | 7 +++++++ application/city/classes/city_daemon/class_ | 6 ++++++ .../city_daemon/class_BaseCityDaemon.php | 7 +++++++ .../class_SimulationDefaultCityDaemon.php | 9 +++++++++ .../class_CityConsoleDaemonCommand.php | 7 +++++++ .../class_CityHtmlCityGuestLoginCommand.php | 7 +++++++ .../html/class_CityHtmlCityMapCommand.php | 7 +++++++ .../class_CityHtmlCityRegisterCommand.php | 7 +++++++ .../class_CityHtmlCityUserLoginCommand.php | 7 +++++++ .../html/class_CityHtmlConfirmCommand.php | 7 +++++++ .../html/class_CityHtmlDoFormCommand.php | 7 +++++++ .../html/class_CityHtmlHomeCommand.php | 7 +++++++ .../html/class_CityHtmlLoginAreaCommand.php | 7 +++++++ .../html/class_CityHtmlLoginCommand.php | 7 +++++++ .../html/class_CityHtmlLoginFailedCommand.php | 7 +++++++ .../html/class_CityHtmlLogoutCommand.php | 7 +++++++ .../html/class_CityHtmlRegisterCommand.php | 7 +++++++ .../html/class_CityHtmlResendLinkCommand.php | 7 +++++++ .../html/class_HtmlLogoutDoneCommand.php | 7 +++++++ ...class_CityConsoleDefaultNewsController.php | 9 +++++++++ .../html/class_CityHtmlConfirmController.php | 9 +++++++++ .../class_CityHtmlDefaultNewsController.php | 9 +++++++++ .../html/class_CityHtmlLoginController.php | 9 +++++++++ .../class_CityHtmlLoginFailedController.php | 9 +++++++++ .../html/class_CityHtmlLogoutController.php | 9 +++++++++ .../class_CityHtmlLogoutDoneController.php | 9 +++++++++ .../html/class_CityHtmlRegisterController.php | 9 +++++++++ .../form/class_CityHtmlDoFormController.php | 9 +++++++++ .../class_CityHtmlLoginAreaController.php | 9 +++++++++ .../class_CityInformationDatabaseWrapper.php | 9 +++++++++ .../city_daemon/class_CityDaemonFactory.php | 7 +++++++ .../city_daemon/class_CityDaemonBootstrap | 7 +++++++ ...aemonBootstrapExtraBootstrappingFilter.php | 7 +++++++ .../bootstrap/class_CityDaemonBootstrap | 7 +++++++ ...ss_CityDaemonBootstrapInitDaemonFilter.php | 7 +++++++ .../filter/city_daemon/class_CityDaemon | 7 +++++++ .../class_CityDaemonInitializationFilter.php | 7 +++++++ .../class_CityDaemonPhpRequirementsFilter.php | 7 +++++++ .../class_CityDaemonWelcomeTeaserFilter.php | 7 +++++++ application/city/classes/filter/class_ | 7 +++++++ .../shutdown/city/class_CityDaemonShutdown | 7 +++++++ .../class_CityDaemonShutdownCityFilter.php | 7 +++++++ ...ss_CityDaemonShutdownTaskHandlerFilter.php | 7 +++++++ ...CityDaemonTaskHandlerInitializerFilter.php | 7 +++++++ .../verifier/class_CityNameVerifierFilter.php | 7 +++++++ .../classes/login/class_CityGuestLogin.php | 7 +++++++ .../classes/login/class_CityUserLogin.php | 7 +++++++ .../login/helper/class_CityLoginHelper.php | 6 ++++++ .../manager/city/class_CityManager.php | 7 +++++++ .../registration/class_CityRegistration.php | 6 ++++++ .../class_CityConsoleCommandResolver.php | 6 ++++++ .../html/class_CityHtmlCommandResolver.php | 6 ++++++ .../class_CityConsoleControllerResolver.php | 10 +++++++++- .../html/class_CityHtmlControllerResolver.php | 10 +++++++++- .../class_CityImageControllerResolver.php | 10 +++++++++- application/city/config.php | 2 +- application/city/exceptions.php | 12 +++++------ .../city/class_CityInformationWrapper.php | 9 +++++++++ .../helper/city/class_CityHelper.php | 7 +++++++ core | 2 +- 68 files changed, 487 insertions(+), 27 deletions(-) diff --git a/application/city/class_ApplicationHelper.php b/application/city/class_ApplicationHelper.php index 78e01ba..688f599 100644 --- a/application/city/class_ApplicationHelper.php +++ b/application/city/class_ApplicationHelper.php @@ -163,9 +163,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica */ public function setupApplicationData () { // Set all application data - $this->setAppName('Unit tests and more'); + $this->setAppName('City Growth Simulation'); $this->setAppVersion('0.0.0'); - $this->setAppShortName('tests'); + $this->setAppShortName('city'); } /** @@ -174,26 +174,14 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica * @return void */ public function initApplication () { - // Get config instance - $cfg = FrameworkBootstrap::getConfigurationInstance(); - // Initialize output system - self::createDebugInstance('ApplicationHelper'); + ApplicationHelper::createDebugInstance('ApplicationHelper'); /* * This application needs a database connection then simply call init * 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(); } /** @@ -220,7 +208,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Get a controller resolver $resolverClass = sprintf( - 'Org\Mxchange\CoreFramework\Tests\Resolver\Controller\%s', + 'Org\Mxchange\City\Resolver\Controller\%s', self::convertToClassName(sprintf( '%s_%s_controller_resolver', $this->getAppShortName(), diff --git a/application/city/classes/actions/class_ b/application/city/classes/actions/class_ index a89fce5..6ac6067 100644 --- a/application/city/classes/actions/class_ +++ b/application/city/classes/actions/class_ @@ -1,4 +1,11 @@ isControllerValid($controllerName) === FALSE) { + } elseif ($resolverInstance->isControllerValid('Org\Mxchange\City\Controller', $controllerName) === FALSE) { // Invalid controller found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); } diff --git a/application/city/classes/resolver/controller/html/class_CityHtmlControllerResolver.php b/application/city/classes/resolver/controller/html/class_CityHtmlControllerResolver.php index 45168d7..cb15a70 100644 --- a/application/city/classes/resolver/controller/html/class_CityHtmlControllerResolver.php +++ b/application/city/classes/resolver/controller/html/class_CityHtmlControllerResolver.php @@ -1,4 +1,12 @@ isControllerValid($controllerName) === FALSE) { + } elseif ($resolverInstance->isControllerValid('Org\Mxchange\City\Controller', $controllerName) === FALSE) { // Invalid controller found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); } diff --git a/application/city/classes/resolver/controller/image/class_CityImageControllerResolver.php b/application/city/classes/resolver/controller/image/class_CityImageControllerResolver.php index de17cf3..d8483b3 100644 --- a/application/city/classes/resolver/controller/image/class_CityImageControllerResolver.php +++ b/application/city/classes/resolver/controller/image/class_CityImageControllerResolver.php @@ -1,4 +1,12 @@ isControllerValid($controllerName) === FALSE) { + } elseif ($resolverInstance->isControllerValid('Org\Mxchange\City\Controller', $controllerName) === FALSE) { // Invalid controller found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); } diff --git a/application/city/config.php b/application/city/config.php index 234f055..6571829 100644 --- a/application/city/config.php +++ b/application/city/config.php @@ -32,7 +32,7 @@ $cfg = FrameworkBootstrap::getConfigurationInstance(); ******************************************************************************/ // CFG: CITY-DEFAULT-MODE (more is coming) -$cfg->setConfigEntry('city_default_mode', BaseCityDaemon::CITY_TYPE_DEFAULT); +$cfg->setConfigEntry('city_default_mode', 'default'); // CFG: NEWS-DOWNLOAD-FILTER $cfg->setConfigEntry('news_download_filter', 'NewsDownloadFilter'); diff --git a/application/city/exceptions.php b/application/city/exceptions.php index 3538bd3..12c5c09 100644 --- a/application/city/exceptions.php +++ b/application/city/exceptions.php @@ -26,7 +26,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; */ // The node's own exception handler -function tests_exception_handler ($exceptionInstance) { +function city_exception_handler ($exceptionInstance) { // Is it an object and a valid instance? if ((is_object($exceptionInstance)) && ($exceptionInstance instanceof Exception)) { // Init variable @@ -101,7 +101,7 @@ Backtrace: } // Error handler -function tests_error_handler ($errno, $errstr, $errfile, $errline, array $errcontext) { +function city_error_handler ($errno, $errstr, $errfile, $errline, array $errcontext) { // Construct the message $message = sprintf('File: %s, Line: %s, Code: %s, Message: %s', basename($errfile), @@ -115,7 +115,7 @@ function tests_error_handler ($errno, $errstr, $errfile, $errline, array $errcon } // END - function // Assertion handler -function tests_assert_handler ($file, $line, $code) { +function city_assert_handler ($file, $line, $code) { // Empty code? if ($code === '') { $code = 'Unknown'; @@ -136,14 +136,14 @@ function tests_assert_handler ($file, $line, $code) { } // END - function // Set error handler -//set_error_handler('tests_error_handler'); +//set_error_handler('city_error_handler'); // Set the new handler -set_exception_handler('tests_exception_handler'); +set_exception_handler('city_exception_handler'); // Init assert handling assert_options(ASSERT_ACTIVE , true); assert_options(ASSERT_WARNING , false); assert_options(ASSERT_BAIL , true); assert_options(ASSERT_QUIET_EVAL, false); -assert_options(ASSERT_CALLBACK , 'tests_assert_handler'); +assert_options(ASSERT_CALLBACK , 'city_assert_handler'); diff --git a/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php b/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php index 75c3d2e..370dc04 100644 --- a/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php +++ b/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php @@ -1,4 +1,13 @@