$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');
}
// 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
}
// 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
}
*/
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;
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);
$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
// 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 = '';