X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fclass_BaseFrameworkSystem.php;h=07e0e601029ac0ee6f8ddb11a8218136ec5238b6;hb=2f930fd62f97e06a6b90afb971cce6343522f9b9;hp=721e4ec52556f44fd7924358be9a83ba200167ee;hpb=63f5632b0c5d2cebf8dd0940fdab561f86470f80;p=core.git diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 721e4ec5..07e0e601 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -1,52 +1,54 @@ . */ -class BaseFrameworkSystem extends stdClass implements FrameworkInterface { +abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterface { /** * Length of output from hash() */ @@ -184,16 +186,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $helperInstance = NULL; - /** - * An instance of a Source class - */ - private $sourceInstance = NULL; - - /** - * An instance of a UrlSource class - */ - private $urlSourceInstance = NULL; - /** * An instance of a InputStream class */ @@ -244,11 +236,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $directoryInstance = NULL; - /** - * An instance of a communicator - */ - private $communicatorInstance = NULL; - /** * The concrete output instance */ @@ -789,7 +776,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setConfigInstance (FrameworkConfiguration $configInstance) { - Registry::getRegistry()->addInstance('config', $configInstance); + GenericRegistry::getRegistry()->addInstance('config', $configInstance); } /** @@ -798,7 +785,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $configInstance Configuration instance */ public final function getConfigInstance () { - $configInstance = Registry::getRegistry()->getInstance('config'); + $configInstance = GenericRegistry::getRegistry()->getInstance('config'); return $configInstance; } @@ -809,7 +796,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setDebugInstance (DebugMiddleware $debugInstance) { - Registry::getRegistry()->addInstance('debug', $debugInstance); + GenericRegistry::getRegistry()->addInstance('debug', $debugInstance); } /** @@ -819,7 +806,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public final function getDebugInstance () { // Get debug instance - $debugInstance = Registry::getRegistry()->getInstance('debug'); + $debugInstance = GenericRegistry::getRegistry()->getInstance('debug'); // Return it return $debugInstance; @@ -832,7 +819,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setWebOutputInstance (OutputStreamer $webInstance) { - Registry::getRegistry()->addInstance('web_output', $webInstance); + GenericRegistry::getRegistry()->addInstance('web_output', $webInstance); } /** @@ -841,7 +828,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $webOutputInstance - Instance to class WebOutput */ public final function getWebOutputInstance () { - $webOutputInstance = Registry::getRegistry()->getInstance('web_output'); + $webOutputInstance = GenericRegistry::getRegistry()->getInstance('web_output'); return $webOutputInstance; } @@ -852,7 +839,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setDatabaseInstance (DatabaseConnection $databaseInstance) { - Registry::getRegistry()->addInstance('db_instance', $databaseInstance); + GenericRegistry::getRegistry()->addInstance('db_instance', $databaseInstance); } /** @@ -862,7 +849,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public final function getDatabaseInstance () { // Get instance - $databaseInstance = Registry::getRegistry()->getInstance('db_instance'); + $databaseInstance = GenericRegistry::getRegistry()->getInstance('db_instance'); // Return instance return $databaseInstance; @@ -875,7 +862,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setCompressorChannel (CompressorChannel $compressorInstance) { - Registry::getRegistry()->addInstance('compressor', $compressorInstance); + GenericRegistry::getRegistry()->addInstance('compressor', $compressorInstance); } /** @@ -884,7 +871,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $compressorInstance The compressor channel */ public final function getCompressorChannel () { - $compressorInstance = Registry::getRegistry()->getInstance('compressor'); + $compressorInstance = GenericRegistry::getRegistry()->getInstance('compressor'); return $compressorInstance; } @@ -894,7 +881,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $applicationInstance An instance of a manageable application helper class */ protected final function getApplicationInstance () { - $applicationInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); return $applicationInstance; } @@ -905,7 +892,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setApplicationInstance (ManageableApplication $applicationInstance) { - Registry::getRegistry()->addInstance('application', $applicationInstance); + GenericRegistry::getRegistry()->addInstance('application', $applicationInstance); } /** @@ -914,7 +901,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $langInstance An instance to the language sub-system */ protected final function getLanguageInstance () { - $langInstance = Registry::getRegistry()->getInstance('language'); + $langInstance = GenericRegistry::getRegistry()->getInstance('language'); return $langInstance; } @@ -926,7 +913,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @see LanguageSystem */ public final function setLanguageInstance (ManageableLanguage $langInstance) { - Registry::getRegistry()->addInstance('language', $langInstance); + GenericRegistry::getRegistry()->addInstance('language', $langInstance); } /** @@ -1218,44 +1205,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->helperInstance; } - /** - * Setter for a Source instance - * - * @param $sourceInstance An instance of a Source class - * @return void - */ - protected final function setSourceInstance (Source $sourceInstance) { - $this->sourceInstance = $sourceInstance; - } - - /** - * Getter for a Source instance - * - * @return $sourceInstance An instance of a Source class - */ - protected final function getSourceInstance () { - return $this->sourceInstance; - } - - /** - * Setter for a UrlSource instance - * - * @param $sourceInstance An instance of a UrlSource class - * @return void - */ - protected final function setUrlSourceInstance (UrlSource $urlSourceInstance) { - $this->urlSourceInstance = $urlSourceInstance; - } - - /** - * Getter for a UrlSource instance - * - * @return $urlSourceInstance An instance of a UrlSource class - */ - protected final function getUrlSourceInstance () { - return $this->urlSourceInstance; - } - /** * Getter for a InputStream instance * @@ -1482,25 +1431,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->directoryInstance; } - /** - * Getter for communicator instance - * - * @return $communicatorInstance An instance of a Communicator class - */ - public final function getCommunicatorInstance () { - return $this->communicatorInstance; - } - - /** - * Setter for communicator instance - * - * @param $communicatorInstance An instance of a Communicator class - * @return void - */ - protected final function setCommunicatorInstance (Communicator $communicatorInstance) { - $this->communicatorInstance = $communicatorInstance; - } - /** * Setter for state instance * @@ -1704,7 +1634,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Is the application instance set? if (is_null($applicationInstance)) { // Get the current instance - $applicationInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); // Still null? if (is_null($applicationInstance)) { @@ -1847,7 +1777,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; @@ -1864,10 +1794,10 @@ Loaded includes: DebugMiddleware::getSelfInstance()->output(''); // Set it in registry - Registry::getRegistry()->addInstance('debug', $debugInstance); + GenericRegistry::getRegistry()->addInstance('debug', $debugInstance); } else { // Get instance from registry - $debugInstance = Registry::getRegistry()->getInstance('debug'); + $debugInstance = GenericRegistry::getRegistry()->getDebugInstance(); } // Return it @@ -3195,7 +3125,7 @@ Loaded includes: */ protected function initWebOutputInstance () { // Get application instance - $applicationInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); // Init web output instance $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($applicationInstance));