function imagecache_external_batch_flush_finished in Imagecache External 8
The batch finish handler.
1 string reference to 'imagecache_external_batch_flush_finished'
- imagecache_external_batch_flush in ./
imagecache_external.module - The batch callback.
File
- ./
imagecache_external.module, line 429 - Allows the usage of Image Styles on external images.
Code
function imagecache_external_batch_flush_finished($success, $files, $operations) {
if ($success) {
$directory = imagecache_external_get_directory_path();
\Drupal::service('file_system')
->deleteRecursive($directory);
}
else {
$error_operation = reset($operations);
$message = t('An error occurred while processing %error_operation with arguments: @arguments', [
'%error_operation' => $error_operation[0],
'@arguments' => print_r($error_operation[1], TRUE),
]);
\Drupal::messenger()
->addMessage($message, MessengerInterface::TYPE_ERROR);
}
}