function rmdir_r in Acquia Cloud Site Factory Connector 8.2
Same name and namespace in other branches
Recursively removes a directory.
Parameters
string $dir: Directory that will be removed.
1 call to rmdir_r()
- drush_exec in acsf_init/
lib/ cloud_hooks/ common/ post-db-copy/ 000-acquia_required_scrub.php - Runs Drush command. Exits with error code if something fails.
File
- acsf_init/
lib/ cloud_hooks/ common/ post-db-copy/ 000-acquia_required_scrub.php, line 18 - Scrubs a site after its database has been copied.
Code
function rmdir_r(string $dir) {
if (is_dir($dir)) {
// Acquia rules disallow exec() with dynamic arguments.
// phpcs:disable
shell_exec(sprintf('rm -rf %s', escapeshellarg($dir)));
// phpcs:enable
}
}