function campaignmonitor_campaign_uninstall in Campaign Monitor 8
Implements hook_uninstall().
Remove the file directory and all files.
File
- modules/
campaignmonitor_campaign/ campaignmonitor_campaign.install, line 24 - Install functions.
Code
function campaignmonitor_campaign_uninstall() {
$path = \Drupal::service('file_system')
->realpath("public://");
$dir = '/campaignmonitor';
$dirname = $path . $dir;
array_map('unlink', glob("{$dirname}/*.*"));
rmdir($dirname);
}