Same name and namespace in other branches
  1. 7.x modules/image/image.install \image_uninstall()
  2. 8.9.x core/modules/image/image.install \image_uninstall()
  3. 9 core/modules/image/image.install \image_uninstall()

Implements hook_uninstall().

File

core/modules/image/image.install, line 23
Install, update and uninstall functions for the image module.

Code

function image_uninstall() {

  // Remove the styles directory and generated images.

  /** @var \Drupal\Core\File\FileSystemInterface $file_system */
  $file_system = \Drupal::service('file_system');
  try {
    $file_system
      ->deleteRecursive(\Drupal::config('system.file')
      ->get('default_scheme') . '://styles');
  } catch (FileException $e) {

    // Ignore failed deletes.
  }
}