* "Getter" for hash from given content and helper instance
*
* @param $content Raw package content
- * @param $helperInstance A BaseHubHelper instance
+ * @param $helperInstance An instance of a BaseHubHelper class
+ * @param $nodeInstance An instance of a NodeHelper class
* @return $hash Hash for given package content
*/
- private function getHashFromContent ($content, BaseHubHelper $helperInstance) {
+ private function getHashFromContent ($content, BaseHubHelper $helperInstance, NodeHelper $nodeInstance) {
// Create the hash
// @TODO crc32 is not good, but it needs to be fast
$hash = crc32(
$content .
':' .
- $helperInstance->getNodeInstance()->getSessionId() .
+ $nodeInstance->getSessionId() .
':' .
$this->getCompressorInstance()->getCompressorExtension()
);
* "Enqueues" raw content into this delivery class by reading the raw content
* from given template instance and pushing it on the 'undeclared' stack.
*
- * @param $helperInstance A BaseHubHelper instance
+ * @param $helperInstance An instance of a BaseHubHelper class
+ * @param $nodeInstance An instance of a NodeHelper class
* @return void
*/
- public function enqueueRawDataFromTemplate (BaseHubHelper $helperInstance) {
+ public function enqueueRawDataFromTemplate (BaseHubHelper $helperInstance, NodeHelper $nodeInstance) {
// Get the raw content ...
$content = $helperInstance->getTemplateInstance()->getRawTemplateData();
// 3.) Tags
implode(self::PACKAGE_TAGS_SEPERATOR, $helperInstance->getPackageTags()),
// 4.) Checksum
- $this->getHashFromContent($content, $helperInstance)
+ $this->getHashFromContent($content, $helperInstance, $nodeInstance)
);
// Now prepare the temporary array and push it on the 'undeclared' stack
$this->getStackerInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, array(
- 'sender' => $helperInstance->getNodeInstance()->getSessionId(),
+ 'sender' => $nodeInstance->getSessionId(),
'recipient' => $helperInstance->getRecipientType(),
'content' => $content,
));