Created
August 28, 2015 07:56
-
-
Save mneuhaus/48a990703d44e0816a6d to your computer and use it in GitHub Desktop.
function to remove process variants of an fal image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function clearProcessedImages($fileUid) { | |
$processedFiles = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_file_processedfile', 'original = ' . $fileUid, 'identifier'); | |
foreach ($processedFiles as $processedFile) { | |
$storage = $this->storageRepository->findByUid($processedFile['storage']); | |
$configuration = $storage->getConfiguration(); | |
$path = realpath($configuration['basePath'] . $processedFile['identifier']); | |
unlink($path); | |
} | |
$GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_file_processedfile', 'original = ' . $image['uid']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment