]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/class_BaseFrameworkSystem.php
imported Helper
[core.git] / framework / main / classes / class_BaseFrameworkSystem.php
index 41e3a23347f6bfd73a062d244ffaa917a1685bbf..756b3fe86833866bc9ea2d3485e12a3ba2fcb156 100644 (file)
@@ -14,6 +14,7 @@ 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;
@@ -23,7 +24,9 @@ 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\Lists\Listable;
 use CoreFramework\Loader\ClassLoader;
@@ -38,7 +41,9 @@ 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;
@@ -167,11 +172,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $parserInstance = NULL;
 
-       /**
-        * A HandleableProtocol instance
-        */
-       private $protocolInstance = NULL;
-
        /**
         * A database wrapper instance
         */
@@ -212,11 +212,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $visitorInstance = NULL;
 
-       /**
-        * DHT instance
-        */
-       private $dhtInstance = NULL;
-
        /**
         * An instance of a database wrapper class
         */
@@ -302,11 +297,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
@@ -493,8 +483,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 <span class="object_name">%s</span> is already destroyed.',
-                               __CLASS__,
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('The object <span class="object_name">%s</span> is already destroyed.',
                                $this->__toString()
                        ));
                } else {
@@ -586,7 +575,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
                ));
@@ -1137,25 +1126,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
         *
@@ -1350,25 +1320,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
         *
@@ -1614,25 +1565,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
@@ -1754,7 +1686,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Is a message set?
                if (!empty($message)) {
                        // Construct message
-                       $content = sprintf('<div class="debug_message">Message: %s</div>' . PHP_EOL, $message);
+                       $content = sprintf('<div class="debug_message">
+       Message: %s
+</div>' . PHP_EOL, $message);
                } // END - if
 
                // Generate the output
@@ -1767,7 +1701,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                );
 
                // Output it
-               ApplicationEntryPoint::app_exit(sprintf('<div class="debug_header">%s debug output:</div><div class="debug_content">%s</div>Loaded includes: <div class="debug_include_list">%s</div>',
+               ApplicationEntryPoint::app_exit(sprintf('<div class="debug_header">
+       %s debug output:
+</div>
+<div class="debug_content">
+       %s
+</div>
+Loaded includes:
+<div class="debug_include_list">
+       %s
+</div>',
                        $this->__toString(),
                        $content,
                        ClassLoader::getSelfInstance()->getPrintableIncludeList()
@@ -1810,7 +1753,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Construct the full message
-               $stubMessage = sprintf('[%s:] Partial stub!',
+               $stubMessage = sprintf('[%s]: Partial stub!',
                        $methodName
                );
 
@@ -3291,7 +3234,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Add it
-               $fqfn = $basePath . '/' . $fileName;
+               $fqfn = $basePath . DIRECTORY_SEPARATOR . $fileName;
 
                // Is it reachable?
                if (!FrameworkBootstrap::isReachableFilePath($fqfn)) {