/**
* Writes given value to the file and returns a hash and gap position for it
*
- * @param $groupId Group identifier
+ * @param $stackName Group identifier
* @param $value Value to be added to the stack
* @return $data Hash and gap position
* @throws InvalidArgumentException If a parameter is not valid
*/
- public function writeValueToFile (string $groupId, $value) {
+ public function writeValueToFile (string $stackName, $value) {
// Validate parameter
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: groupId=%s,value[]=%s - CALLED!', $groupId, gettype($value)));
- if (empty($groupId)) {
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: stackName=%s,value[]=%s - CALLED!', $stackName, gettype($value)));
+ if (empty($stackName)) {
// Throw IAE
- throw new InvalidArgumentException('Parameter "groupId" is empty');
+ throw new InvalidArgumentException('Parameter "stackName" is empty');
} elseif (is_object($value) || is_resource($value)) {
// Not wanted here
throw new InvalidArgumentException(sprintf('value[]=%s is not stackable in files', gettype($value)));
$hash = self::hash($encoded);
// Then write it to the next free gap
- $data = $this->getStackInstance()->writeDataToFreeGap($groupId, $hash, $encoded);
+ $data = $this->getStackInstance()->writeDataToFreeGap($stackName, $hash, $encoded);
// Return info
return $data;
/**
* Writes given raw data to the file and returns a gap position and length
*
- * @param $groupId Group identifier
+ * @param $stackName Group identifier
* @param $hash Hash from encoded value
* @param $encoded Encoded value to be written to the file
* @return $data Gap position and length of the raw data
* @throws UnsupportedOperationException If this method is called
*/
- public function writeDataToFreeGap (string $groupId, string $hash, string $encoded) {
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: groupId=' . $groupId . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
+ public function writeDataToFreeGap (string $stackName, string $hash, string $encoded) {
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: stackName=' . $stackName . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
}