*/
private $resolverInstance = null;
+ /**
+ * Template engine instance
+ */
+ private $templateInstance = null;
+
/**
* The real class name
*/
const EXCEPTION_MISSING_FILE_IO_HANDLER = 0x02f;
const EXCEPTION_MISSING_ELEMENT = 0x030;
const EXCEPTION_HEADERS_ALREADY_SENT = 0x031;
- const EXCEPTION_DEFAUL_CONTROLLER_GONE = 0x032;
+ const EXCEPTION_DEFAULT_CONTROLLER_GONE = 0x032;
const EXCEPTION_CLASS_NOT_FOUND = 0x033;
const EXCEPTION_REQUIRED_INTERFACE_MISSING = 0x034;
const EXCEPTION_FATAL_ERROR = 0x035;
const EXCEPTION_FILE_NOT_FOUND = 0x036;
const EXCEPTION_ASSERTION_FAILED = 0x037;
+ const EXCEPTION_FILE_CANNOT_BE_READ = 0x038;
/**
* In the super constructor these system classes shall be ignored or else
*/
public function __destruct() {
// Is this object already destroyed?
- if ($this->__toString() != "DestructedObject") {
- // Debug message
- if ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
- $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt <strong>%s</strong> wird zerstört.",
- __CLASS__, $this->__toString()
- ));
- } // END - if
-
+ if ($this->__toString() != 'DestructedObject') {
// Destroy all informations about this class but keep some text about it alive
- $this->setObjectDescription(sprintf("Entferntes Objekt <em>%s</em>", $this->__toString()));
- $this->setRealClass("DestructedObject");
+ $this->setObjectDescription(sprintf("Removed object <em>%s</em>", $this->__toString()));
+ $this->setRealClass('DestructedObject');
$this->resetUniqueID();
} elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
// Already destructed object
)));
// Initialization done! :D
- Registry::isInitialized("OK");
- } elseif ($this->__toString() == "DebugMiddleware") {
+ Registry::isInitialized('OK');
+ } elseif ($this->__toString() == 'DebugMiddleware') {
// Set configuration instance
$this->setConfigInstance(FrameworkConfiguration::createFrameworkConfiguration());
}
}
+ /**
+ * Setter for template engine instances
+ *
+ * @param $templateInstance An instance of a template engine class
+ * @return void
+ */
+ protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
+ $this->templateInstance = $templateInstance;
+ }
+
+ /**
+ * Getter for template engine instances
+ *
+ * @return $templateInstance An instance of a template engine class
+ */
+ protected final function getTemplateInstance () {
+ return $this->templateInstance;
+ }
+
/**
* Setter for search instance
*
*
* @return $cfgInstance Configuration instance
*/
- protected final function getConfigInstance () {
+ public final function getConfigInstance () {
$cfgInstance = Registry::getRegistry()->getInstance('config');
return $cfgInstance;
}
* The left part of the ID shall always be a valid class name and the
* right part an ID number.
*
- * @return $pfn The file name with a prepended path name
- * @throws NoArrayCreatedException If explode() fails to create an array
+ * @return $pfn The file name with a prepended path name
+ * @throws NoArrayCreatedException If explode() fails to create an array
* @throws InvalidArrayCountException If the array contains less or
- * more than two elements
+ * more than two elements
*/
public final function getPathFileNameFromObject () {
// Get the main object's unique ID. We use this as a path/filename combination
// Are there two elements? Index 0 is the path, 1 the file name + global extension
if (!is_array($pathFile)) {
// No array found
- throw new NoArrayCreatedException(array($this, "pathFile"), self::EXCEPTION_ARRAY_EXPECTED);
+ throw new NoArrayCreatedException(array($this, 'pathFile'), self::EXCEPTION_ARRAY_EXPECTED);
} elseif (count($pathFile) != 2) {
// Invalid ID returned!
- throw new InvalidArrayCountException(array($this, "pathFile", count($pathFile), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
+ throw new InvalidArrayCountException(array($this, 'pathFile', count($pathFile), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
}
// Auto-append missing trailing slash
*
* @return void
*/
- public function debugBacktrace () {
+ public function debugBackTrace () {
// Sorry, there is no other way getting this nice backtrace
print "<pre>\n";
debug_print_backtrace();