You are here

function rmdir_recurse in Smart IP 6.2

1 call to rmdir_recurse()
smart_ip_maxmind_bin_db_update in includes/smart_ip.utility.inc
Download a Maxmind binary database and activate it for use

File

includes/smart_ip.utility.inc, line 591
Utility routines to load the Smart IP database.

Code

function rmdir_recurse($path) {
  $path = rtrim($path, '/') . '/';
  $handle = opendir($path);
  while ($file = readdir($handle) !== FALSE) {
    if ($file != '.' && $file != '..') {
      $fullpath = $path . $file;
      if (is_dir($fullpath)) {
        rmdir_recurse($fullpath);
      }
      else {
        unlink($fullpath);
      }
    }
  }
  closedir($handle);
  rmdir($path);
}