]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/handler/chunks/class_ChunkHandler.php
Continued:
[hub.git] / application / hub / main / handler / chunks / class_ChunkHandler.php
index 5dd18289253f9f59626c6f18aa83f7230062fdf9..0821f01386b88d8c69d62745d70e9898169ed76a 100644 (file)
@@ -88,17 +88,17 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                $handlerInstance = new ChunkHandler();
 
                // Get a FIFO stacker
-               $stackerInstance = ObjectFactory::createObjectByConfiguredName('chunk_handler_stacker_class');
+               $stackInstance = ObjectFactory::createObjectByConfiguredName('chunk_handler_stacker_class');
 
                // Init all stacker
-               $stackerInstance->initStacks(array(
+               $stackInstance->initStacks(array(
                        self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP,
                        self::STACKER_NAME_CHUNKS_WITHOUT_FINAL,
                        self::STACKER_NAME_ASSEMBLED_RAW_DATA
                ));
 
                // Set the stacker in this handler
-               $handlerInstance->setStackerInstance($stackerInstance);
+               $handlerInstance->setStackInstance($stackInstance);
 
                // Get a crypto instance ...
                $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
@@ -413,15 +413,15 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                }
 
                // Do we have some pending chunks (no final)?
-               while (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITHOUT_FINAL)) {
+               while (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITHOUT_FINAL)) {
                        // Then get it first and add it before the EOP chunks
-                       array_unshift($chunks, $this->getStackerInstance()->popNamed(self::STACKER_NAME_CHUNKS_WITHOUT_FINAL));
+                       array_unshift($chunks, $this->getStackInstance()->popNamed(self::STACKER_NAME_CHUNKS_WITHOUT_FINAL));
                } // END - while
 
                // Add all chunks to the FIFO stacker
                foreach ($chunks as $chunk) {
                        // Add the chunk
-                       $this->getStackerInstance()->pushNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP, $chunk);
+                       $this->getStackInstance()->pushNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP, $chunk);
                } // END - foreach
        }
 
@@ -435,7 +435,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                // Add all chunks to the FIFO stacker
                foreach ($chunks as $chunk) {
                        // Add the chunk
-                       $this->getStackerInstance()->pushNamed(self::STACKER_NAME_CHUNKS_WITHOUT_FINAL, $chunk);
+                       $this->getStackInstance()->pushNamed(self::STACKER_NAME_CHUNKS_WITHOUT_FINAL, $chunk);
                } // END - foreach
        }
 
@@ -446,7 +446,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         */
        public function ifUnhandledChunksWithFinalAvailable () {
                // Simply check if the stacker is not empty
-               $unhandledChunks = $this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP) === FALSE;
+               $unhandledChunks = $this->getStackInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP) === FALSE;
 
                // Return result
                return $unhandledChunks;
@@ -464,7 +464,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                assert($this->ifUnhandledChunksWithFinalAvailable());
 
                // Get an entry from the stacker
-               $chunk = $this->getStackerInstance()->popNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP);
+               $chunk = $this->getStackInstance()->popNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP);
 
                // Split the string with proper separator character
                $chunkSplits = explode(PackageFragmenter::CHUNK_DATA_HASH_SEPARATOR, $chunk);
@@ -512,7 +512,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                $this->addChunkToFinalArray($chunkSplits);
 
                // Is the stack now empty?
-               if ($this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP)) {
+               if ($this->getStackInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP)) {
                        // Then mark the final array as complete
                        $this->markFinalArrayAsCompleted();
                } // END - if
@@ -610,7 +610,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
 
                // Then feed it into the next stacker
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($this->rawPackageData) . ' bytes to stack ' . self::STACKER_NAME_ASSEMBLED_RAW_DATA . ' ...');
-               $this->getStackerInstance()->pushNamed(self::STACKER_NAME_ASSEMBLED_RAW_DATA, $this->rawPackageData);
+               $this->getStackInstance()->pushNamed(self::STACKER_NAME_ASSEMBLED_RAW_DATA, $this->rawPackageData);
 
                // ... and reset it
                $this->rawPackageData = '';