Changeset 695338
- Timestamp:
- 04/10/2013 03:45:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
blog-copier/trunk/blog-copier.php
r671342 r695338 204 204 * @return string status message 205 205 */ 206 p rivatefunction copy_blog($domain, $title, $from_blog_id = 0, $copy_files = true) {206 p function copy_blog($domain, $title, $from_blog_id = 0, $copy_files = true) { 207 207 global $wpdb, $current_site, $base; 208 208 … … 344 344 */ 345 345 private function copy_blog_files( $from_blog_id, $to_blog_id ) { 346 set_time_limit( 600 ); // 60 seconds x 10 minutes346 set_time_limit( 00 ); // 60 seconds x 10 minutes 347 347 @ini_set('memory_limit','2048M'); 348 $base = WP_CONTENT_DIR . '/blogs.dir/'; 348 349 349 // Path to source blog files. 350 $from = apply_filters('copy_blog_files_from', trailingslashit( $base . $from_blog_id ), $base, $from_blog_id); 350 switch_to_blog($from_blog_id); 351 $dir_info = wp_upload_dir(); 352 $from = str_replace(' ', "\\ ", trailingslashit($dir_info['basedir']).'*'); // * necessary with GNU cp, doesn't hurt anything with BSD cp 353 restore_current_blog(); 354 $from = apply_filters('copy_blog_files_from', $from, $from_blog_id); 355 351 356 // Path to destination blog files. 352 $to = apply_filters('copy_blog_files_to', trailingslashit( $base . $to_blog_id ), $base, $to_blog_id); 357 switch_to_blog($to_blog_id); 358 $dir_info = wp_upload_dir(); 359 $to = str_replace(' ', "\\ ", trailingslashit($dir_info['basedir'])); 360 restore_current_blog(); 361 $to = apply_filters('copy_blog_files_to', $to, $to_blog_id); 362 353 363 // Shell command used to copy files. 354 $command = apply_filters('copy_blog_files_command', "cp -rfp $from $to", $from, $to );364 $command = apply_filters('copy_blog_files_command', , $from, $to ); 355 365 exec($command); 356 366 }
Note: See TracChangeset
for help on using the changeset viewer.