118 $this->originalFileSha1 = $this->originalFile->
getSha1();
122 if (is_array($databaseRow)) {
125 $this->taskTypeRegistry = GeneralUtility::makeInstance(Processing\TaskTypeRegistry::class);
135 $this->taskType = $this->taskType ?: $databaseRow[
'task_type'];
136 $this->processingConfiguration = $this->processingConfiguration ?: unserialize($databaseRow[
'configuration']);
138 $this->originalFileSha1 = $databaseRow[
'originalfilesha1'];
139 $this->identifier = $databaseRow[
'identifier'];
140 $this->name = $databaseRow[
'name'];
141 $this->properties = $databaseRow;
143 if (!empty($databaseRow[
'storage']) && (
int)$this->storage->getUid() !== (
int)$databaseRow[
'storage']) {
160 return $this->
getTask()->getConfigurationChecksum();
174 throw new \BadMethodCallException(
'Setting contents not possible for processed file.', 1305438528);
185 if (empty($this->identifier)) {
186 throw new \RuntimeException(
'Cannot update original file!', 1350582054);
188 $processingFolder = $this->originalFile->getStorage()->getProcessingFolder($this->originalFile);
189 $addedFile = $this->storage->updateProcessedFile($filePath, $this, $processingFolder);
192 $this->identifier = $addedFile->getIdentifier();
193 $this->originalFileSha1 = $this->originalFile->getSha1();
197 $this->deleted =
false;
198 $this->updated =
true;
222 return is_array($this->properties) && array_key_exists(
'uid', $this->properties) && $this->properties[
'uid'] > 0;
254 if (!empty($this->name) && $this->name !==
$name && $this->
exists()) {
260 $this->identifier = $this->storage->getProcessingFolder($this->originalFile)->getIdentifier() .
$this->name;
262 $this->updated =
true;
275 return $this->originalFile->exists();
278 return parent::exists();
331 return $this->originalFile->getName();
344 if (!is_array($this->properties)) {
345 $this->properties = [];
353 $this->properties = array_merge($this->properties,
$properties);
357 $this->properties = array_merge($this->properties, $this->storage->getFileInfo($this));
384 $properties[
'configuration'] = serialize($this->processingConfiguration);
389 'task_type' => $this->taskType,
390 'configurationsha1' => sha1(
$properties[
'configuration']),
391 'original' => $this->originalFile->getUid(),
392 'originalfilesha1' => $this->originalFileSha1
412 $this->identifier = $this->originalFile->getIdentifier();
413 $this->updated =
true;
414 $this->originalFileSha1 = $this->originalFile->getSha1();
422 return empty($this->identifier) || $this->identifier === $this->originalFile->getIdentifier();
441 public function delete($force =
false)
448 return parent::delete();
464 return $this->originalFile->getProperty($key);
466 return $this->properties[$key];
476 return $this->properties[
'uid'];
486 $fileMustBeRecreated =
false;
489 if ($this->originalFile->isMissing()) {
495 $fileMustBeRecreated =
true;
499 if (array_key_exists(
'checksum', $this->properties) && $this->
calculateChecksum() !== $this->properties[
'checksum']) {
500 $fileMustBeRecreated =
true;
504 if ($this->originalFile->getSha1() !== $this->originalFileSha1) {
505 $fileMustBeRecreated =
true;
508 if (!array_key_exists(
'uid', $this->properties)) {
509 $fileMustBeRecreated =
true;
513 if ($fileMustBeRecreated && $this->
exists()) {
516 return $fileMustBeRecreated;
547 if ($this->task ==
null) {
548 $this->task = $this->taskTypeRegistry->getTaskForType($this->taskType, $this, $this->processingConfiguration);
561 $name = $this->originalFile->getNameWithoutExtension();
562 $name .=
'_' . $this->originalFile->getUid();
574 public function getPublicUrl($relativeToCurrentScript =
false)
576 if ($this->deleted) {