delete($backup_dir, true); } else { wpa_delete_dir( $backup_dir ); } } } /** * recursively copies a directory from one place to another. excludes 'uploads/wp-clone' by default. * @since 2.1.6 * @param string $from * @param string $to * @param array $exclude an array of directory paths to exclude. */ function wpa_copy_dir( $from, $to, $exclude ) { if( false === stripos( wpCloneSafePathMode( $from ), rtrim( wpCloneSafePathMode( WPCLONE_DIR_BACKUP ), "/\\" ) ) ) { if( !file_exists( $to ) ) @mkdir ( $to ); $files = array_diff( scandir( $from ), array( '.', '..' ) ); foreach( $files as $file ) { if( in_array( $from . '/' . $file, $exclude ) ) { continue; } else { if( is_dir( $from . '/' . $file ) ) { wpa_copy_dir( $from . '/' . $file, $to . '/' . $file, $exclude ); } else { @copy( $from . '/' . $file, $to . '/' . $file ); } } } unset( $files ); } } /** * recursively deletes all the files in the given directory. * @since 2.1.6 * @param string $dir path to the directory that needs to be deleted. */ function wpa_delete_dir( $dir ) { if( !empty( $dir ) ) { $dir = trailingslashit( $dir ); $files = array_diff( scandir( $dir ), array( '.', '..' ) ); foreach ( $files as $file ) { if( is_dir( $dir . $file ) ) { wpa_delete_dir( $dir . $file ); } else { @unlink( $dir . $file ); } } @rmdir($dir); } } /** * @since 2.1.6 */ function wpa_excluded_dirs() { $exclude = array(); if( isset( $_POST['exclude'] ) && '' != $_POST['exclude'] ) { foreach( explode( "\n", $_POST['exclude'] ) as $ex ) { $ex = trim( $ex ); if( '' !== $ex ) { $ex = trim( $ex, "/\\" ); $exclude[] = trailingslashit( WPCLONE_WP_CONTENT ) . str_replace( '\\', '/', $ex ) ; } } } return $exclude; } /* end of file */ Body by Barbra | Your Path to Personal Fitness

It seems we can’t find what you’re looking for. Perhaps searching can help.

Your Path to Personal Fitness