From bed81d8edc3673951a1ee57f38f5a1a07c417b69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 20 Jan 2018 18:49:03 +0100 Subject: [PATCH] Continued: - created more namespaces - "imported" more classes/interfaces - need to require_once, some strange (?) double-load may happen when phpunit is running - sorted members a bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../bootstrap/class_FrameworkBootstrap.php | 4 +- framework/loader/class_ClassLoader.php | 50 +++++++++---------- .../classes/class_BaseFrameworkSystem.php | 2 +- .../classes/client/http/class_HttpClient.php | 7 +++ .../migration/class_BaseDatabaseMigration.php | 6 +++ .../class_BaseFormatUpgrade.php | 7 +++ ...FileDatabaseFormatVersion01To02Upgrade.php | 7 +++ .../factories/client/class_ClientFactory.php | 3 ++ ...LocalFileDatabaseFormatUpgradeRegistry.php | 21 ++++++-- .../class_BaseControllerResolver.php | 2 +- .../captcha/class_SolveableCaptcha.php | 1 - .../migration/class_MigrateableDatabase.php | 6 +++ .../class_UpgradeableDatabaseFormat.php | 6 +++ .../class_RegisterableFormatUpgrade.php | 4 ++ .../middleware/io/class_FileIoHandler.php | 20 -------- 15 files changed, 93 insertions(+), 53 deletions(-) diff --git a/framework/bootstrap/class_FrameworkBootstrap.php b/framework/bootstrap/class_FrameworkBootstrap.php index ce3da75f..08abad5b 100644 --- a/framework/bootstrap/class_FrameworkBootstrap.php +++ b/framework/bootstrap/class_FrameworkBootstrap.php @@ -235,7 +235,7 @@ final class FrameworkBootstrap { } // END - if // Load it - require $fileInstance->getPathname(); + require_once $fileInstance->getPathname(); // Trace message //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__); @@ -381,7 +381,7 @@ final class FrameworkBootstrap { // Now call all methods in one go foreach (array('setupApplicationData', 'initApplication', 'launchApplication') as $methodName) { // Debug message - //* NOISY-DEBUG: */ printf('[%s:%d]: Calling methodName=%s ...' . PHP_EOL, __METHOD__, __LINE__, $methodName); + //*NOISY-DEBUG: */ printf('[%s:%d]: Calling methodName=%s ...' . PHP_EOL, __METHOD__, __LINE__, $methodName); // Call method call_user_func(array($applicationInstance, $methodName)); diff --git a/framework/loader/class_ClassLoader.php b/framework/loader/class_ClassLoader.php index fab4e559..330cdaa0 100644 --- a/framework/loader/class_ClassLoader.php +++ b/framework/loader/class_ClassLoader.php @@ -484,6 +484,31 @@ class ClassLoader { } // END - while } + /** + * Getter for total include counter + * + * @return $total Total loaded include files + */ + public final function getTotal () { + return $this->total; + } + + /** + * Getter for a printable list of included main/interfaces/exceptions + * + * @param $includeList A printable include list + */ + public function getPrintableIncludeList () { + // Prepare the list + $includeList = ''; + foreach ($this->loadedClasses as $classFile) { + $includeList .= basename($classFile) . '
' . PHP_EOL; + } // END - foreach + + // And return it + return $includeList; + } + /** * Initializes our loader class * @@ -589,29 +614,4 @@ class ClassLoader { } } - /** - * Getter for total include counter - * - * @return $total Total loaded include files - */ - public final function getTotal () { - return $this->total; - } - - /** - * Getter for a printable list of included main/interfaces/exceptions - * - * @param $includeList A printable include list - */ - public function getPrintableIncludeList () { - // Prepare the list - $includeList = ''; - foreach ($this->loadedClasses as $classFile) { - $includeList .= basename($classFile) . '
' . PHP_EOL; - } // END - foreach - - // And return it - return $includeList; - } - } diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 8ba9d8ce..be1c07d8 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -1775,7 +1775,7 @@ Loaded includes: */ public final static function createDebugInstance ($className, $lineNumber = NULL) { // Is the instance set? - if (!Registry::getRegistry()->instanceExists('debug')) { + if (!GenericRegistry::getRegistry()->instanceExists('debug')) { // Init debug instance $debugInstance = NULL; diff --git a/framework/main/classes/client/http/class_HttpClient.php b/framework/main/classes/client/http/class_HttpClient.php index 0ec24318..20c4c787 100644 --- a/framework/main/classes/client/http/class_HttpClient.php +++ b/framework/main/classes/client/http/class_HttpClient.php @@ -1,4 +1,11 @@ + /** + * Registers given format-upgrade class with this registry + * + * @param $upgradeInstance An instance of a UpgradeableDatabaseFormat class + * @return void + * @todo 0% done + */ + public function registerFormatUpgrader (UpgradeableDatabaseFormat $upgradeInstance) { + $this->partialStub(); + } + +} diff --git a/framework/main/classes/resolver/controller/class_BaseControllerResolver.php b/framework/main/classes/resolver/controller/class_BaseControllerResolver.php index 80c81f67..5ff90ba5 100644 --- a/framework/main/classes/resolver/controller/class_BaseControllerResolver.php +++ b/framework/main/classes/resolver/controller/class_BaseControllerResolver.php @@ -113,7 +113,7 @@ abstract class BaseControllerResolver extends BaseResolver { $resolverConfigEntry, array( $controllerName, - Registry::getRegistry()->getInstance('application') + GenericRegistry::getRegistry()->getInstance('application') ) ); $controllerInstance = ObjectFactory::createObjectByName( diff --git a/framework/main/interfaces/captcha/class_SolveableCaptcha.php b/framework/main/interfaces/captcha/class_SolveableCaptcha.php index 5545289c..89cb207a 100644 --- a/framework/main/interfaces/captcha/class_SolveableCaptcha.php +++ b/framework/main/interfaces/captcha/class_SolveableCaptcha.php @@ -3,7 +3,6 @@ namespace Org\Mxchange\CoreFramework\Helper\Captcha; // Import framework stuff -use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; use Org\Mxchange\CoreFramework\Helper\Helper; /** diff --git a/framework/main/interfaces/database/migration/class_MigrateableDatabase.php b/framework/main/interfaces/database/migration/class_MigrateableDatabase.php index cc150424..a5312b49 100644 --- a/framework/main/interfaces/database/migration/class_MigrateableDatabase.php +++ b/framework/main/interfaces/database/migration/class_MigrateableDatabase.php @@ -1,4 +1,10 @@ partialStub(); } - /** - * Seek to given offset (default) or other possibilities as fseek() gives. - * - * @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 $status Status of file seek: 0 = success, -1 = failed - */ - public function seek ($offset, $whence = SEEK_SET) { - $this->partialStub('offset=' . $offset . ',whence=' . $whence); - } - - /** - * Size of file stack - * - * @return $size Size (in bytes) of file - */ - public function size () { - $this->partialStub(); - } - } -- 2.39.2