* 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
*/
"GzipCompressor", // GZIP compressor
);
- /* No longer used:
- */
-
/**
* Private super constructor
*
* @return void
*/
public final function setDebugInstance (DebugMiddleware $debugInstance) {
- self::$debugInstance = $debugInstance;
+ Registry::getRegistry()->addInstance('debug', $debugInstance);
}
/**
* @return $debugInstance Instance to class DebugConsoleOutput or DebugWebOutput
*/
public final function getDebugInstance () {
- return self::$debugInstance;
+ $debugInstance = Registry::getRegistry()->getInstance('debug');
+ return $debugInstance;
}
/**
/**
* Getter for web output instance
*
- * @return $webOutput - Instance to class WebOutput
+ * @return $webOutputInstance - Instance to class WebOutput
*/
public final function getWebOutputInstance () {
- return Registry::getRegistry()->getInstance('web_output');
+ $webOutputInstance = Registry::getRegistry()->getInstance('web_output');
+ return $webOutputInstance;
}
/**
* @return void
*/
public final function setDatabaseInstance (DatabaseConnection $dbInstance) {
- Registry::getRegistry()->addInstance('dbInstance', $dbInstance);
+ Registry::getRegistry()->addInstance('db_instance', $dbInstance);
}
/**
// Is the registry there and initialized?
if ((class_exists('Registry')) && (Registry::isInitialized() === true)) {
- $dbInstance = Registry::getRegistry()->getInstance('dbInstance');
+ $dbInstance = Registry::getRegistry()->getInstance('db_instance');
} // END - if
// Return instance
/**
* Setter for compressor channel
*
- * @param $compressorChannel An instance of CompressorChannel
+ * @param $compressorInstance An instance of CompressorChannel
* @return void
*/
- public final function setCompressorChannel (CompressorChannel $compressorChannel) {
- Registry::getRegistry()->addInstance('compressor', $compressorChannel);
+ public final function setCompressorChannel (CompressorChannel $compressorInstance) {
+ Registry::getRegistry()->addInstance('compressor', $compressorInstance);
}
/**
* Getter for compressor channel
*
- * @return $compressor The compressor channel
+ * @return $compressorInstance The compressor channel
*/
public final function getCompressorChannel () {
- return Registry::getRegistry()->getInstance('compressor');
+ $compressorInstance = Registry::getRegistry()->getInstance('compressor');
+ return $compressorInstance;
}
/**
* @return $applicationInstance An instance of a manageable application helper class
*/
protected final function getApplicationInstance () {
- return self::$applicationInstance;
+ $applicationInstance = Registry::getRegistry()->getInstance('application');
+ return $applicationInstance;
}
/**
* @return void
*/
public final function setApplicationInstance (ManageableApplication $applicationInstance) {
- self::$applicationInstance = $applicationInstance;
+ Registry::getRegistry()->addInstance('application', $applicationInstance);
}
/**
* @return $langInstance An instance to the language sub-system
*/
protected final function getLanguageInstance () {
- return self::$langInstance;
+ $langInstance = Registry::getRegistry()->getInstance('language');
+ return $langInstance;
}
/**
* @see LanguageSystem
*/
public final function setLanguageInstance (ManageableLanguage $langInstance) {
- self::$langInstance = $langInstance;
+ Registry::getRegistry()->addInstance('language', $langInstance);
}
/**