/** * Clear all remote image caches */ public function deleteRemoteImageCaches() { IOHelper::clearFolder(craft()->path->getRuntimePath() . 'imager/'); }
/** * Remove transforms for a given asset * * @param AssetFileModel $asset */ public function removeTransformsForAsset(AssetFileModel $asset) { $paths = new Imager_ImagePathsModel($asset); if (strpos($paths->targetPath, craft()->imager->getSetting('imagerSystemPath')) !== false) { IOHelper::clearFolder($paths->targetPath); craft()->templateCache->deleteCachesByElementId($asset->id); } }