const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x039;
const EXCEPTION_FILTER_CHAIN_INTERCEPTED = 0x040;
- /**
- * In the super constructor these system classes shall be ignored or else
- * we would get an endless calling loop.
- *
- *---------------------------------------------------------------------*
- * ATTENTION: IF YOU REMOVE ONE OF THEM YOU WILL RUN YOUR SERVER IN AN *
- * ENDLESS LOOP !!! *
- *---------------------------------------------------------------------*
- */
- private $systemClasses = array(
- 'DebugMiddleware', // Debug middleware output sub-system
- 'Registry', // Object registry
- 'ObjectFactory', // Object factory
- 'DebugWebOutput', // Debug web output sub-system
- 'WebOutput', // Web output sub-system
- 'CompressorChannel', // Compressor sub-system
- 'DebugConsoleOutput', // Debug console output sub-system
- 'DebugErrorLogOutput', // Debug error_log() output sub-system
- 'FrameworkDirectoryPointer', // Directory handler sub-system
- 'NullCompressor', // Null compressor
- 'Bzip2Compressor', // BZIP2 compressor
- 'GzipCompressor', // GZIP compressor
- );
/**
* Protected super constructor
*
* @return void
*/
private final function initInstance () {
- // Is this a system class?
- if (!in_array($this->__toString(), $this->systemClasses)) {
- // Set configuration instance
- $this->setConfigInstance(FrameworkConfiguration::getInstance());
-
- // Add application helper to our class
- $this->systemclasses[] = $this->getConfigInstance()->getConfigEntry('app_helper_class');
-
- // Set debug instance
- $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->getConfigEntry('debug_class')));
-
- // Get output instance and set it
- $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($this->getConfigInstance()->getConfigEntry('web_content_type')));
- $this->setWebOutputInstance($outputInstance);
-
- // Set the compressor channel
- $this->setCompressorChannel(CompressorChannel::createCompressorChannel(
- $this->getConfigInstance()->getConfigEntry('base_path').
- $this->getConfigInstance()->getConfigEntry('compressor_base_path')
- ));
-
- // Initialization done! :D
- Registry::isInitialized('OK');
- } elseif ($this->__toString() == 'DebugMiddleware') {
- // Set configuration instance
- $this->setConfigInstance(FrameworkConfiguration::getInstance());
- }
+ // Set configuration instance
+ $this->setConfigInstance(FrameworkConfiguration::getInstance());
}
/**
}
/**
- * Compare class name of this and given class name
+ * Checks wether an object equals this object. You should overwrite this
+ * method to implement own equality checks
*
- * @param $className The class name as string from the other class
- * @return boolean The result of comparing both class names
+ * @param $objectInstance An instance of a FrameworkInterface object
+ * @return $equals Wether both objects equals
*/
- public final function isClass ($className) {
- return ($this->__toString() == $className);
+ public function equals (FrameworkInterface $objectInstance) {
+ // Now test it
+ $equals = ((
+ $this->__toString() == $objectInstance->__toString()
+ ) && (
+ $this->hashCode() == $objectInstance->hashCode()
+ ));
+
+ // Return the result
+ return $result;
}
/**
return $price;
}
- /**
- * Removes number formating characters
- *
- * @return void
- */
- public final function removeNumberFormaters () {
- unset($this->thousands);
- unset($this->decimals);
- }
-
/**
* Private getter for language instance
*
Registry::getRegistry()->addInstance('language', $langInstance);
}
- /**
- * Remove the $systemClasses array from memory
- *
- * @return void
- */
- public final function removeSystemArray () {
- unset($this->systemClasses);
- }
-
/**
* Appends a trailing slash to a string
*
* @throws NullPointerException If the discovered application
* instance is still null
*/
- protected function prepareTemplateInstance (BaseFrameworkSystem $appInstance=null) {
+ protected function prepareTemplateInstance (FrameworkInterface $appInstance=null) {
// Is the application instance set?
if (is_null($appInstance)) {
// Get the current instance