use \stdClass;
use \Iterator;
use \ReflectionClass;
+use \SplFileInfo;
/**
* The simulator system class is the super class of all other classes. This
*/
private $stateInstance = NULL;
+ /**
+ * Registry instance (implementing Register)
+ */
+ private $registryInstance = NULL;
+
+ /**
+ * Call-back instance
+ */
+ private $callbackInstance = NULL;
+
/**
* Thousands separator
*/
return $this->outputInstance;
}
+ /**
+ * Setter for registry instance
+ *
+ * @param $registryInstance An instance of a Register class
+ * @return void
+ */
+ protected final function setRegistryInstance (Register $registryInstance) {
+ $this->registryInstance = $registryInstance;
+ }
+
+ /**
+ * Getter for registry instance
+ *
+ * @return $registryInstance The debug registry instance
+ */
+ public final function getRegistryInstance () {
+ return $this->registryInstance;
+ }
+
+ /**
+ * Setter for call-back instance
+ *
+ * @param $callbackInstance An instance of a FrameworkInterface class
+ * @return void
+ */
+ public final function setCallbackInstance (FrameworkInterface $callbackInstance) {
+ $this->callbackInstance = $callbackInstance;
+ }
+
+ /**
+ * Getter for call-back instance
+ *
+ * @return $callbackInstance An instance of a FrameworkInterface class
+ */
+ protected final function getCallbackInstance () {
+ return $this->callbackInstance;
+ }
+
/**
* Setter for command name
*
);
// Output it
- ApplicationEntryPoint::app_exit(sprintf('<div class="debug_header">
+ ApplicationEntryPoint::exitApplication(sprintf('<div class="debug_header">
%s debug output:
</div>
<div class="debug_content">
* Creates a full-qualified file name (FQFN) for given file name by adding
* a configured temporary file path to it.
*
- * @param $fileName Name for temporary file
- * @return $fqfn Full-qualified file name
+ * @param $infoInstance An instance of a SplFileInfo class
+ * @return $tempInstance An instance of a SplFileInfo class (temporary file)
* @throw PathWriteProtectedException If the path in 'temp_file_path' is write-protected
* @throws FileIoException If the file cannot be written
*/
- protected static function createTempPathForFile ($fileName) {
+ protected static function createTempPathForFile (SplFileInfo $infoInstance) {
// Get config entry
$basePath = FrameworkConfiguration::getSelfInstance()->getConfigEntry('temp_file_path');
// Is the path writeable?
if (!is_writable($basePath)) {
// Path is write-protected
- throw new PathWriteProtectedException($fileName, self::EXCEPTION_PATH_CANNOT_BE_WRITTEN);
+ throw new PathWriteProtectedException($infoInstance, self::EXCEPTION_PATH_CANNOT_BE_WRITTEN);
} // END - if
// Add it
- $fqfn = $basePath . DIRECTORY_SEPARATOR . $fileName;
+ $tempInstance = new SplFileInfo($basePath . DIRECTORY_SEPARATOR . $infoInstance->getBasename());
// Is it reachable?
- if (!FrameworkBootstrap::isReachableFilePath($fqfn)) {
+ if (!FrameworkBootstrap::isReachableFilePath($tempInstance)) {
// Not reachable
- throw new FileIoException($fqfn, self::EXCEPTION_FILE_NOT_REACHABLE);
+ throw new FileIoException($tempInstance, self::EXCEPTION_FILE_NOT_REACHABLE);
} // END - if
// Return it
- return $fqfn;
+ return $tempInstance;
}
/**