delete() static public method

static public delete ( $path )
Beispiel #1
0
 static function delete($path)
 {
     if (true === is_dir($path)) {
         $files = array_diff(scandir($path), array('.', '..'));
         foreach ($files as $file) {
             BPMediaImporter::delete(realpath($path) . '/' . $file);
         }
         return rmdir($path);
     } else {
         if (true === is_file($path)) {
             return unlink($path);
         }
     }
     return false;
 }