function wp_all_export_remove_source($file, $remove_dir = true)
 {
     @unlink($file);
     $path_parts = pathinfo($file);
     if (!empty($path_parts['dirname'])) {
         $path_all_parts = explode('/', $path_parts['dirname']);
         $dirname = array_pop($path_all_parts);
         if (wp_all_export_isValidMd5($dirname)) {
             if ($remove_dir) {
                 @unlink($path_parts['dirname'] . DIRECTORY_SEPARATOR . 'index.php');
             }
             if ($remove_dir or count(@scandir($path_parts['dirname'])) == 2) {
                 wp_all_export_rmdir($path_parts['dirname']);
             }
         }
     }
 }
Beispiel #2
0
 public static function _get_valid_header_name($element_name)
 {
     $element_name_parts = explode("_", $element_name);
     $elementIndex = array_pop($element_name_parts);
     if (wp_all_export_isValidMd5($elementIndex)) {
         $element_name_in_file = str_replace("_" . $elementIndex, "", $element_name);
     } else {
         $element_name_in_file = $element_name;
     }
     return $element_name_in_file;
 }