You are here

function _textimage_flush_all in Textimage 7.3

Cleanup Textimage.

This will remove all image files generated via Textimage, flush all the image styles, clear all cache and all store entries on the db.

2 calls to _textimage_flush_all()
textimage_flush_all_form_submit in ./textimage.admin.inc
Textimage cleanup form - submission.
textimage_form_settings_submit in ./textimage.admin.inc
Textimage settings form - submission.

File

./textimage.module, line 1205
Textimage - Provides text to image manipulations.

Code

function _textimage_flush_all() {
  foreach (image_styles() as $style) {
    if (TextimageStyles::isTextimage($style)) {
      image_style_flush($style);
    }
  }
  if (file_exists(_textimage_get_store_path('unstyled_hashed'))) {
    file_unmanaged_delete_recursive(_textimage_get_store_path('unstyled_hashed'));
  }
  if (file_exists(_textimage_get_store_path('uncached'))) {
    file_unmanaged_delete_recursive(_textimage_get_store_path('uncached'));
  }
  cache_clear_all(NULL, 'cache_textimage');
  db_truncate('textimage_store')
    ->execute();
  _textimage_diag(t('All Textimage images were removed.'), WATCHDOG_NOTICE);
}