From: Roland Häder Date: Mon, 1 Jan 2018 03:30:14 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b9373eb6c1b134fdef22bda0f97a3e8ca34f3def;p=city.git Continued: - "imported" classes/interfaces - created new namespaces - updated core to latest commit Signed-off-by: Roland Häder --- 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 @@