projects
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2f45e26
)
Rewrite of all static instances to Registry class
author
Roland Häder
<roland@mxchange.org>
Wed, 11 Mar 2009 02:26:03 +0000
(
02:26
+0000)
committer
Roland Häder
<roland@mxchange.org>
Wed, 11 Mar 2009 02:26:03 +0000
(
02:26
+0000)
inc/classes/main/class_BaseFrameworkSystem.php
patch
|
blob
|
history
diff --git
a/inc/classes/main/class_BaseFrameworkSystem.php
b/inc/classes/main/class_BaseFrameworkSystem.php
index 4160867e87c8d3a0a71ba3a3bd73d3e44db5dcf3..5cc9d8119df991d6803ba38a42f5dbc79fdc9ed9 100644
(file)
--- a/
inc/classes/main/class_BaseFrameworkSystem.php
+++ b/
inc/classes/main/class_BaseFrameworkSystem.php
@@
-23,21
+23,6
@@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
- /**
- * Instance to an application helper class
- */
- private static $applicationInstance = null;
-
- /**
- * The language instance for the template loader
- */
- private static $langInstance = null;
-
- /**
- * Debug instance
- */
- private static $debugInstance = null;
-
/**
* Instance of a request class
*/
/**
* Instance of a request class
*/
@@
-189,9
+174,6
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
"GzipCompressor", // GZIP compressor
);
"GzipCompressor", // GZIP compressor
);
- /* No longer used:
- */
-
/**
* Private super constructor
*
/**
* Private super constructor
*
@@
-434,7
+416,7
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* @return void
*/
public final function setDebugInstance (DebugMiddleware $debugInstance) {
* @return void
*/
public final function setDebugInstance (DebugMiddleware $debugInstance) {
-
self::$debugInstance = $debugInstance
;
+
Registry::getRegistry()->addInstance('debug', $debugInstance)
;
}
/**
}
/**
@@
-443,7
+425,8
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* @return $debugInstance Instance to class DebugConsoleOutput or DebugWebOutput
*/
public final function getDebugInstance () {
* @return $debugInstance Instance to class DebugConsoleOutput or DebugWebOutput
*/
public final function getDebugInstance () {
- return self::$debugInstance;
+ $debugInstance = Registry::getRegistry()->getInstance('debug');
+ return $debugInstance;
}
/**
}
/**
@@
-459,10
+442,11
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
/**
* Getter for web output instance
*
/**
* Getter for web output instance
*
- * @return $webOutput - Instance to class WebOutput
+ * @return $webOutput
Instance
- Instance to class WebOutput
*/
public final function getWebOutputInstance () {
*/
public final function getWebOutputInstance () {
- return Registry::getRegistry()->getInstance('web_output');
+ $webOutputInstance = Registry::getRegistry()->getInstance('web_output');
+ return $webOutputInstance;
}
/**
}
/**
@@
-473,7
+457,7
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* @return void
*/
public final function setDatabaseInstance (DatabaseConnection $dbInstance) {
* @return void
*/
public final function setDatabaseInstance (DatabaseConnection $dbInstance) {
- Registry::getRegistry()->addInstance('db
I
nstance', $dbInstance);
+ Registry::getRegistry()->addInstance('db
_i
nstance', $dbInstance);
}
/**
}
/**
@@
-487,7
+471,7
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
// Is the registry there and initialized?
if ((class_exists('Registry')) && (Registry::isInitialized() === true)) {
// Is the registry there and initialized?
if ((class_exists('Registry')) && (Registry::isInitialized() === true)) {
- $dbInstance = Registry::getRegistry()->getInstance('db
I
nstance');
+ $dbInstance = Registry::getRegistry()->getInstance('db
_i
nstance');
} // END - if
// Return instance
} // END - if
// Return instance
@@
-497,20
+481,21
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
/**
* Setter for compressor channel
*
/**
* Setter for compressor channel
*
- * @param $compressor
Channel
An instance of CompressorChannel
+ * @param $compressor
Instance
An instance of CompressorChannel
* @return void
*/
* @return void
*/
- public final function setCompressorChannel (CompressorChannel $compressor
Channel
) {
- Registry::getRegistry()->addInstance('compressor', $compressor
Channel
);
+ public final function setCompressorChannel (CompressorChannel $compressor
Instance
) {
+ Registry::getRegistry()->addInstance('compressor', $compressor
Instance
);
}
/**
* Getter for compressor channel
*
}
/**
* Getter for compressor channel
*
- * @return $compressor The compressor channel
+ * @return $compressor
Instance
The compressor channel
*/
public final function getCompressorChannel () {
*/
public final function getCompressorChannel () {
- return Registry::getRegistry()->getInstance('compressor');
+ $compressorInstance = Registry::getRegistry()->getInstance('compressor');
+ return $compressorInstance;
}
/**
}
/**
@@
-519,7
+504,8
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* @return $applicationInstance An instance of a manageable application helper class
*/
protected final function getApplicationInstance () {
* @return $applicationInstance An instance of a manageable application helper class
*/
protected final function getApplicationInstance () {
- return self::$applicationInstance;
+ $applicationInstance = Registry::getRegistry()->getInstance('application');
+ return $applicationInstance;
}
/**
}
/**
@@
-529,7
+515,7
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* @return void
*/
public final function setApplicationInstance (ManageableApplication $applicationInstance) {
* @return void
*/
public final function setApplicationInstance (ManageableApplication $applicationInstance) {
-
self::$applicationInstance = $applicationInstance
;
+
Registry::getRegistry()->addInstance('application', $applicationInstance)
;
}
/**
}
/**
@@
-672,7
+658,8
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* @return $langInstance An instance to the language sub-system
*/
protected final function getLanguageInstance () {
* @return $langInstance An instance to the language sub-system
*/
protected final function getLanguageInstance () {
- return self::$langInstance;
+ $langInstance = Registry::getRegistry()->getInstance('language');
+ return $langInstance;
}
/**
}
/**
@@
-683,7
+670,7
@@
class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
* @see LanguageSystem
*/
public final function setLanguageInstance (ManageableLanguage $langInstance) {
* @see LanguageSystem
*/
public final function setLanguageInstance (ManageableLanguage $langInstance) {
-
self::$langInstance = $langInstance
;
+
Registry::getRegistry()->addInstance('language', $langInstance)
;
}
/**
}
/**