function image_uninstall

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

Implements hook_uninstall().

File

core/modules/image/image.install, line 23

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.
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.