- public final function setLanguageInstance (ManageableLanguage $langInstance) {
- Registry::getRegistry()->addInstance('language', $langInstance);
- }
-
- /**
- * Private getter for file IO instance
- *
- * @return $fileIoInstance An instance to the file I/O sub-system
- */
- protected final function getFileIoInstance () {
- return $this->fileIoInstance;
- }
-
- /**
- * Setter for file I/O instance
- *
- * @param $fileIoInstance An instance to the file I/O sub-system
- * @return void
- */
- public final function setFileIoInstance (IoHandler $fileIoInstance) {
- $this->fileIoInstance = $fileIoInstance;
- }
-
- /**
- * Protected setter for user instance
- *
- * @param $userInstance An instance of a user class
- * @return void
- */
- protected final function setUserInstance (ManageableAccount $userInstance) {
- $this->userInstance = $userInstance;
- }
-
- /**
- * Getter for user instance
- *
- * @return $userInstance An instance of a user class
- */
- public final function getUserInstance () {
- return $this->userInstance;
- }
-
- /**
- * Setter for controller instance (this surely breaks a bit the MVC patterm)
- *
- * @param $controllerInstance An instance of the controller
- * @return void
- */
- public final function setControllerInstance (Controller $controllerInstance) {
- $this->controllerInstance = $controllerInstance;
- }
-
- /**
- * Getter for controller instance (this surely breaks a bit the MVC patterm)
- *
- * @return $controllerInstance An instance of the controller
- */
- public final function getControllerInstance () {
- return $this->controllerInstance;
- }
-
- /**
- * Setter for RNG instance
- *
- * @param $rngInstance An instance of a random number generator (RNG)
- * @return void
- */
- protected final function setRngInstance (RandomNumberGenerator $rngInstance) {
- $this->rngInstance = $rngInstance;
- }
-
- /**
- * Getter for RNG instance
- *
- * @return $rngInstance An instance of a random number generator (RNG)
- */
- public final function getRngInstance () {
- return $this->rngInstance;
- }
-
- /**
- * Setter for Cryptable instance
- *
- * @param $cryptoInstance An instance of a Cryptable class
- * @return void
- */
- protected final function setCryptoInstance (Cryptable $cryptoInstance) {
- $this->cryptoInstance = $cryptoInstance;
- }
-
- /**
- * Getter for Cryptable instance
- *
- * @return $cryptoInstance An instance of a Cryptable class
- */
- public final function getCryptoInstance () {
- return $this->cryptoInstance;
- }
-
- /**
- * Setter for the list instance
- *
- * @param $listInstance A list of Listable
- * @return void
- */
- protected final function setListInstance (Listable $listInstance) {
- $this->listInstance = $listInstance;
- }
-
- /**
- * Getter for the list instance
- *
- * @return $listInstance A list of Listable
- */
- protected final function getListInstance () {
- return $this->listInstance;
- }
-
- /**
- * Setter for the menu instance
- *
- * @param $menuInstance A RenderableMenu instance
- * @return void
- */
- protected final function setMenuInstance (RenderableMenu $menuInstance) {
- $this->menuInstance = $menuInstance;
- }
-
- /**
- * Getter for the menu instance
- *
- * @return $menuInstance A RenderableMenu instance
- */
- protected final function getMenuInstance () {
- return $this->menuInstance;
- }
-
- /**
- * Setter for image instance
- *
- * @param $imageInstance An instance of an image
- * @return void
- */
- public final function setImageInstance (BaseImage $imageInstance) {
- $this->imageInstance = $imageInstance;
- }
-
- /**
- * Getter for image instance
- *
- * @return $imageInstance An instance of an image
- */
- public final function getImageInstance () {
- return $this->imageInstance;
- }
-
- /**
- * Setter for stacker instance
- *
- * @param $stackInstance An instance of an stacker
- * @return void
- */
- public final function setStackInstance (Stackable $stackInstance) {
- $this->stackInstance = $stackInstance;
- }
-
- /**
- * Getter for stacker instance
- *
- * @return $stackInstance An instance of an stacker
- */
- public final function getStackInstance () {
- return $this->stackInstance;
- }
-
- /**
- * Setter for compressor instance
- *
- * @param $compressorInstance An instance of an compressor
- * @return void
- */
- public final function setCompressorInstance (Compressor $compressorInstance) {
- $this->compressorInstance = $compressorInstance;
- }
-
- /**
- * Getter for compressor instance
- *
- * @return $compressorInstance An instance of an compressor
- */
- public final function getCompressorInstance () {
- return $this->compressorInstance;
- }
-
- /**
- * Setter for Parseable instance
- *
- * @param $parserInstance An instance of an Parseable
- * @return void
- */
- public final function setParserInstance (Parseable $parserInstance) {
- $this->parserInstance = $parserInstance;
- }
-
- /**
- * Getter for Parseable instance
- *
- * @return $parserInstance An instance of an Parseable
- */
- public final function getParserInstance () {
- return $this->parserInstance;
- }
-
- /**
- * Setter for DatabaseWrapper instance
- *
- * @param $wrapperInstance An instance of an DatabaseWrapper
- * @return void
- */
- public final function setWrapperInstance (DatabaseWrapper $wrapperInstance) {
- $this->wrapperInstance = $wrapperInstance;
- }
-
- /**
- * Getter for DatabaseWrapper instance
- *
- * @return $wrapperInstance An instance of an DatabaseWrapper
- */
- public final function getWrapperInstance () {
- return $this->wrapperInstance;
- }
-
- /**
- * Setter for socket resource
- *
- * @param $socketResource A valid socket resource
- * @return void
- */
- public final function setSocketResource ($socketResource) {
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource=' . $socketResource . ',previous[' . gettype($this->socketResource) . ']=' . $this->socketResource);
- $this->socketResource = $socketResource;
- }
-
- /**
- * Getter for socket resource
- *
- * @return $socketResource A valid socket resource
- */
- public final function getSocketResource () {
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource[' . gettype($this->socketResource) . ']=' . $this->socketResource);
- return $this->socketResource;
- }
-
- /**
- * Setter for regular expression
- *
- * @param $regularExpression A valid regular expression
- * @return void
- */
- public final function setRegularExpression ($regularExpression) {
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': regularExpression=' . $regularExpression . ',previous[' . gettype($this->regularExpression) . ']=' . $this->regularExpression);
- $this->regularExpression = $regularExpression;
- }
-
- /**
- * Getter for regular expression
- *
- * @return $regularExpression A valid regular expression
- */
- public final function getRegularExpression () {
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': regularExpression[' . gettype($this->regularExpression) . ']=' . $this->regularExpression);
- return $this->regularExpression;
- }
-
- /**
- * Setter for helper instance
- *
- * @param $helperInstance An instance of a helper class
- * @return void
- */
- protected final function setHelperInstance (Helper $helperInstance) {
- $this->helperInstance = $helperInstance;
- }
-
- /**
- * Getter for helper instance
- *
- * @return $helperInstance An instance of a helper class
- */
- public final function getHelperInstance () {
- return $this->helperInstance;
- }
-
- /**
- * Setter for a Source instance
- *
- * @param $sourceInstance An instance of a Source class
- * @return void
- */
- protected final function setSourceInstance (Source $sourceInstance) {
- $this->sourceInstance = $sourceInstance;
- }
-
- /**
- * Getter for a Source instance
- *
- * @return $sourceInstance An instance of a Source class
- */
- protected final function getSourceInstance () {
- return $this->sourceInstance;
- }
-
- /**
- * Setter for a UrlSource instance
- *
- * @param $sourceInstance An instance of a UrlSource class
- * @return void
- */
- protected final function setUrlSourceInstance (UrlSource $urlSourceInstance) {
- $this->urlSourceInstance = $urlSourceInstance;
- }
-
- /**
- * Getter for a UrlSource instance
- *
- * @return $urlSourceInstance An instance of a UrlSource class
- */
- protected final function getUrlSourceInstance () {
- return $this->urlSourceInstance;
- }
-
- /**
- * Getter for a InputStream instance
- *
- * @param $inputStreamInstance The InputStream instance
- */
- protected final function getInputStreamInstance () {
- return $this->inputStreamInstance;
- }
-
- /**
- * Setter for a InputStream instance
- *
- * @param $inputStreamInstance The InputStream instance
- * @return void
- */
- protected final function setInputStreamInstance (InputStream $inputStreamInstance) {
- $this->inputStreamInstance = $inputStreamInstance;
- }
-
- /**
- * Getter for a OutputStream instance
- *
- * @param $outputStreamInstance The OutputStream instance
- */
- protected final function getOutputStreamInstance () {
- return $this->outputStreamInstance;
- }
-
- /**
- * Setter for a OutputStream instance
- *
- * @param $outputStreamInstance The OutputStream instance
- * @return void
- */
- protected final function setOutputStreamInstance (OutputStream $outputStreamInstance) {
- $this->outputStreamInstance = $outputStreamInstance;
- }
-
- /**
- * Setter for handler instance
- *
- * @param $handlerInstance An instance of a Handleable class
- * @return void
- */
- protected final function setHandlerInstance (Handleable $handlerInstance) {
- $this->handlerInstance = $handlerInstance;
- }
-
- /**
- * Getter for handler instance
- *
- * @return $handlerInstance A Handleable instance
- */
- protected final function getHandlerInstance () {
- return $this->handlerInstance;
- }
-
- /**
- * Setter for visitor instance
- *
- * @param $visitorInstance A Visitor instance
- * @return void
- */
- protected final function setVisitorInstance (Visitor $visitorInstance) {
- $this->visitorInstance = $visitorInstance;
- }
-
- /**
- * Getter for visitor instance
- *
- * @return $visitorInstance A Visitor instance
- */
- protected final function getVisitorInstance () {
- return $this->visitorInstance;
- }
-
- /**
- * Setter for raw package Data
- *
- * @param $packageData Raw package Data
- * @return void
- */
- public final function setPackageData (array $packageData) {
- $this->packageData = $packageData;
- }
-
- /**
- * Getter for raw package Data
- *
- * @return $packageData Raw package Data
- */
- public function getPackageData () {
- return $this->packageData;
- }
-
-
- /**
- * Setter for Iterator instance
- *
- * @param $iteratorInstance An instance of an Iterator
- * @return void
- */
- protected final function setIteratorInstance (Iterator $iteratorInstance) {
- $this->iteratorInstance = $iteratorInstance;
- }
-
- /**
- * Getter for Iterator instance
- *
- * @return $iteratorInstance An instance of an Iterator
- */
- public final function getIteratorInstance () {
- return $this->iteratorInstance;
- }
-
- /**
- * Setter for FilePointer instance
- *
- * @param $pointerInstance An instance of an FilePointer class
- * @return void
- */
- protected final function setPointerInstance (FilePointer $pointerInstance) {
- $this->pointerInstance = $pointerInstance;
- }
-
- /**
- * Getter for FilePointer instance
- *
- * @return $pointerInstance An instance of an FilePointer class
- */
- public final function getPointerInstance () {
- return $this->pointerInstance;
- }
-
- /**
- * Unsets pointer instance which triggers a call of __destruct() if the
- * instance is still there. This is surely not fatal on already "closed"
- * file pointer instances.
- *
- * I don't want to mess around with above setter by giving it a default
- * value NULL as setter should always explicitly only set (existing) object
- * instances and NULL is NULL.
- *
- * @return void
- */
- protected final function unsetPointerInstance () {
- // Simply it to NULL
- $this->pointerInstance = NULL;
- }
-
- /**
- * Setter for Indexable instance
- *
- * @param $indexInstance An instance of an Indexable class
- * @return void
- */
- protected final function setIndexInstance (Indexable $indexInstance) {
- $this->indexInstance = $indexInstance;
- }
-
- /**
- * Getter for Indexable instance
- *
- * @return $indexInstance An instance of an Indexable class
- */
- public final function getIndexInstance () {
- return $this->indexInstance;
- }
-
- /**
- * Setter for Block instance
- *
- * @param $blockInstance An instance of an Block class
- * @return void
- */
- protected final function setBlockInstance (Block $blockInstance) {
- $this->blockInstance = $blockInstance;
- }
-
- /**
- * Getter for Block instance
- *
- * @return $blockInstance An instance of an Block class
- */
- public final function getBlockInstance () {
- return $this->blockInstance;
- }
-
- /**
- * Setter for Minable instance
- *
- * @param $minableInstance A Minable instance
- * @return void
- */
- protected final function setMinableInstance (Minable $minableInstance) {
- $this->minableInstance = $minableInstance;
- }
-
- /**
- * Getter for minable instance
- *
- * @return $minableInstance A Minable instance
- */
- protected final function getMinableInstance () {
- return $this->minableInstance;
- }
-
- /**
- * Setter for FrameworkDirectory instance
- *
- * @param $directoryInstance A FrameworkDirectory instance
- * @return void
- */
- protected final function setDirectoryInstance (FrameworkDirectory $directoryInstance) {
- $this->directoryInstance = $directoryInstance;
- }
-
- /**
- * Getter for FrameworkDirectory instance
- *
- * @return $directoryInstance A FrameworkDirectory instance
- */
- protected final function getDirectoryInstance () {
- return $this->directoryInstance;
- }
-
- /**
- * Getter for communicator instance
- *
- * @return $communicatorInstance An instance of a Communicator class
- */
- public final function getCommunicatorInstance () {
- return $this->communicatorInstance;
- }
-
- /**
- * Setter for communicator instance
- *
- * @param $communicatorInstance An instance of a Communicator class
- * @return void
- */
- protected final function setCommunicatorInstance (Communicator $communicatorInstance) {
- $this->communicatorInstance = $communicatorInstance;
- }
-
- /**
- * Setter for state instance
- *
- * @param $stateInstance A Stateable instance
- * @return void
- */
- public final function setStateInstance (Stateable $stateInstance) {
- $this->stateInstance = $stateInstance;
- }
-
- /**
- * Getter for state instance
- *
- * @return $stateInstance A Stateable instance
- */
- public final function getStateInstance () {
- return $this->stateInstance;
- }
-
- /**
- * Setter for output instance
- *
- * @param $outputInstance The debug output instance
- * @return void
- */
- public final function setOutputInstance (OutputStreamer $outputInstance) {
- $this->outputInstance = $outputInstance;
- }
-
- /**
- * Getter for output instance
- *
- * @return $outputInstance The debug output instance
- */
- public final function getOutputInstance () {
- 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 command name
- *
- * @param $commandName Last validated command name
- * @return void
- */
- protected final function setCommandName ($commandName) {
- $this->commandName = $commandName;
- }
-
- /**
- * Getter for command name
- *
- * @return $commandName Last validated command name
- */
- protected final function getCommandName () {
- return $this->commandName;
- }
-
- /**
- * Setter for controller name
- *
- * @param $controllerName Last validated controller name
- * @return void
- */
- protected final function setControllerName ($controllerName) {
- $this->controllerName = $controllerName;
- }
-
- /**
- * Getter for controller name
- *
- * @return $controllerName Last validated controller name
- */
- protected final function getControllerName () {
- return $this->controllerName;
- }
-
- /**
- * Checks whether an object equals this object. You should overwrite this
- * method to implement own equality checks
- *
- * @param $objectInstance An instance of a FrameworkInterface object
- * @return $equals Whether both objects equals
- */
- public function equals (FrameworkInterface $objectInstance) {
- // Now test it
- $equals = ((
- $this->__toString() == $objectInstance->__toString()
- ) && (
- $this->hashCode() == $objectInstance->hashCode()
- ));
-
- // Return the result
- return $equals;
- }
-
- /**
- * Generates a generic hash code of this class. You should really overwrite
- * this method with your own hash code generator code. But keep KISS in mind.
- *
- * @return $hashCode A generic hash code respresenting this whole class
- */
- public function hashCode () {
- // Simple hash code
- return crc32($this->__toString());
- }
-
- /**
- * Formats computer generated price values into human-understandable formats
- * with thousand and decimal separators.
- *
- * @param $value The in computer format value for a price
- * @param $currency The currency symbol (use HTML-valid characters!)
- * @param $decNum Number of decimals after commata
- * @return $price The for the current language formated price string
- * @throws MissingDecimalsThousandsSeparatorException If decimals or
- * thousands separator
- * is missing
- */
- public function formatCurrency ($value, $currency = '€', $decNum = 2) {
- // Are all required attriutes set?
- if ((!isset($this->decimals)) || (!isset($this->thousands))) {
- // Throw an exception
- throw new MissingDecimalsThousandsSeparatorException($this, self::EXCEPTION_ATTRIBUTES_ARE_MISSING);
- } // END - if
-
- // Cast the number
- $value = (float) $value;
-
- // Reformat the US number
- $price = number_format($value, $decNum, $this->decimals, $this->thousands) . $currency;
-
- // Return as string...
- return $price;
- }
-
- /**
- * Appends a trailing slash to a string
- *
- * @param $str A string (maybe) without trailing slash
- * @return $str A string with an auto-appended trailing slash
- */
- public final function addMissingTrailingSlash ($str) {
- // Is there a trailing slash?
- if (substr($str, -1, 1) != '/') {
- $str .= '/';
- } // END - if
-
- // Return string with trailing slash
- return $str;
- }
-
- /**
- * Prepare the template engine (HtmlTemplateEngine by default) for a given
- * application helper instance (ApplicationHelper by default).
- *
- * @param $applicationInstance An application helper instance or
- * null if we shall use the default
- * @return $templateInstance The template engine instance
- * @throws NullPointerException If the discovered application
- * instance is still null
- */
- protected function prepareTemplateInstance (ManageableApplication $applicationInstance = NULL) {
- // Is the application instance set?
- if (is_null($applicationInstance)) {
- // Get the current instance
- $applicationInstance = Registry::getRegistry()->getInstance('app');
-
- // Still null?
- if (is_null($applicationInstance)) {
- // Thrown an exception
- throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
- } // END - if
- } // END - if
-
- // Initialize the template engine
- $templateInstance = ObjectFactory::createObjectByConfiguredName('html_template_class');
-
- // Return the prepared instance
- return $templateInstance;
- }
-
- /**
- * Debugs this instance by putting out it's full content
- *
- * @param $message Optional message to show in debug output
- * @return void
- */
- public final function debugInstance ($message = '') {
- // Restore the error handler to avoid trouble with missing array elements or undeclared variables
- restore_error_handler();