X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fclass_BaseFrameworkSystem.php;h=cc2a0d4498982baf8c96835228947e3ae33e4f82;hp=ab2e5540a5d5bb7fc0136fe42afdc04225127bdc;hb=b9bfbe86c031c9d83c3670602906df191a33ba2a;hpb=54a56ed3c7cef5e7989100d2c5a7de8647d545de;ds=sidebyside diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index ab2e5540..cc2a0d44 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -14,16 +14,20 @@ use CoreFramework\Criteria\Local\LocalUpdateCriteria; use CoreFramework\Crypto\Cryptable; use CoreFramework\Crypto\RandomNumber\RandomNumberGenerator; use CoreFramework\Database\Frontend\DatabaseWrapper; +use CoreFramework\EntryPoint\ApplicationEntryPoint; use CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Filesystem\Block; use CoreFramework\Filesystem\FilePointer; use CoreFramework\Filesystem\FrameworkDirectory; +use CoreFramework\Filesystem\PathWriteProtectedException; use CoreFramework\Generic\FrameworkInterface; use CoreFramework\Generic\NullPointerException; +use CoreFramework\Generic\UnsupportedOperationException; +use CoreFramework\Handler\Handleable; use CoreFramework\Handler\Stream\IoHandler; +use CoreFramework\Helper\Helper; use CoreFramework\Index\Indexable; -use CoreFramework\Listener\Listenable; use CoreFramework\Lists\Listable; use CoreFramework\Loader\ClassLoader; use CoreFramework\Manager\ManageableApplication; @@ -36,7 +40,10 @@ use CoreFramework\Resolver\Resolver; use CoreFramework\Result\Database\CachedDatabaseResult; use CoreFramework\Result\Search\SearchableResult; use CoreFramework\Stacker\Stackable; +use CoreFramework\State\Stateable; +use CoreFramework\Stream\Input\InputStream; use CoreFramework\Stream\Output\OutputStreamer; +use CoreFramework\Stream\Output\OutputStream; use CoreFramework\Template\CompileableTemplate; use CoreFramework\User\ManageableAccount; use CoreFramework\Visitor\Visitor; @@ -45,6 +52,7 @@ use CoreFramework\Visitor\Visitor; use \stdClass; use \Iterator; use \ReflectionClass; +use \SplFileInfo; /** * The simulator system class is the super class of all other classes. This @@ -165,11 +173,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $parserInstance = NULL; - /** - * A HandleableProtocol instance - */ - private $protocolInstance = NULL; - /** * A database wrapper instance */ @@ -201,7 +204,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { private $outputStreamInstance = NULL; /** - * Networkable handler instance + * Handler instance */ private $handlerInstance = NULL; @@ -210,11 +213,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $visitorInstance = NULL; - /** - * DHT instance - */ - private $dhtInstance = NULL; - /** * An instance of a database wrapper class */ @@ -245,11 +243,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $directoryInstance = NULL; - /** - * Listener instance - */ - private $listenerInstance = NULL; - /** * An instance of a communicator */ @@ -265,6 +258,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $stateInstance = NULL; + /** + * Registry instance (implementing Register) + */ + private $registryInstance = NULL; + + /** + * Call-back instance + */ + private $callbackInstance = NULL; + /** * Thousands separator */ @@ -305,11 +308,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $controllerName = ''; - /** - * Name of used protocol - */ - private $protocolName = 'invalid'; - /** * Array with bitmasks and such for pack/unpack methods to support both * 32-bit and 64-bit systems @@ -404,6 +402,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { const EXCEPTION_PATH_CANNOT_BE_WRITTEN = 0x03b; const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x03c; const EXCEPTION_FILTER_CHAIN_INTERCEPTED = 0x03d; + const EXCEPTION_INVALID_SOCKET = 0x03e; /** * Hexadecimal->Decimal translation array @@ -495,8 +494,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->setRealClass('DestructedObject'); } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) { // Already destructed object - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] The object %s is already destroyed.', - __CLASS__, + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('The object %s is already destroyed.', $this->__toString() )); } else { @@ -588,7 +586,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Output stub message // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[unknown::%s:] Stub! Args: %s', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[unknown::%s]: Stub! Args: %s', $methodName, $argsString )); @@ -1139,25 +1137,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->parserInstance; } - /** - * Setter for HandleableProtocol instance - * - * @param $protocolInstance An instance of an HandleableProtocol - * @return void - */ - public final function setProtocolInstance (HandleableProtocol $protocolInstance) { - $this->protocolInstance = $protocolInstance; - } - - /** - * Getter for HandleableProtocol instance - * - * @return $protocolInstance An instance of an HandleableProtocol - */ - public final function getProtocolInstance () { - return $this->protocolInstance; - } - /** * Setter for DatabaseWrapper instance * @@ -1327,7 +1306,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { /** * Getter for handler instance * - * @return $handlerInstance A Networkable instance + * @return $handlerInstance A Handleable instance */ protected final function getHandlerInstance () { return $this->handlerInstance; @@ -1352,25 +1331,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->visitorInstance; } - /** - * Setter for DHT instance - * - * @param $dhtInstance A Distributable instance - * @return void - */ - protected final function setDhtInstance (Distributable $dhtInstance) { - $this->dhtInstance = $dhtInstance; - } - - /** - * Getter for DHT instance - * - * @return $dhtInstance A Distributable instance - */ - protected final function getDhtInstance () { - return $this->dhtInstance; - } - /** * Setter for raw package Data * @@ -1521,25 +1481,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->directoryInstance; } - /** - * Setter for listener instance - * - * @param $listenerInstance A Listenable instance - * @return void - */ - protected final function setListenerInstance (Listenable $listenerInstance) { - $this->listenerInstance = $listenerInstance; - } - - /** - * Getter for listener instance - * - * @return $listenerInstance A Listenable instance - */ - protected final function getListenerInstance () { - return $this->listenerInstance; - } - /** * Getter for communicator instance * @@ -1597,6 +1538,44 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { 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 * @@ -1635,25 +1614,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->controllerName; } - /** - * Getter for protocol name - * - * @return $protocolName Name of used protocol - */ - public final function getProtocolName () { - return $this->protocolName; - } - - /** - * Setter for protocol name - * - * @param $protocolName Name of used protocol - * @return void - */ - protected final function setProtocolName ($protocolName) { - $this->protocolName = $protocolName; - } - /** * Checks whether an object equals this object. You should overwrite this * method to implement own equality checks @@ -1775,7 +1735,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Is a message set? if (!empty($message)) { // Construct message - $content = sprintf('
' . PHP_EOL, $message); + $content = sprintf(' ' . PHP_EOL, $message); } // END - if // Generate the output @@ -1788,7 +1750,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { ); // Output it - ApplicationEntryPoint::app_exit(sprintf('