[wp-cvs] wordpress/wp-admin import-mt.php,1.19,1.20

Matthew Mullenweg saxmatt at users.sourceforge.net
Sat Feb 12 07:50:15 GMT 2005


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20331/wp-admin

Modified Files:
	import-mt.php 
Log Message:
Be nicer to memory

Index: import-mt.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/import-mt.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** import-mt.php	1 Feb 2005 01:51:05 -0000	1.19
--- import-mt.php	12 Feb 2005 07:50:13 -0000	1.20
***************
*** 66,71 ****
  // Bring in the data
  set_magic_quotes_runtime(0);
! $datalines = file(MTEXPORT); // Read the file into an array
! $importdata = implode('', $datalines); // squish it
  $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
  $importdata = preg_replace("/--------\nAUTHOR/", "--MT-ENTRY--\nAUTHOR", $importdata);
--- 66,71 ----
  // Bring in the data
  set_magic_quotes_runtime(0);
! $importdata = file(MTEXPORT); // Read the file into an array
! $importdata = implode('', $importdata); // squish it
  $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
  $importdata = preg_replace("/--------\nAUTHOR/", "--MT-ENTRY--\nAUTHOR", $importdata);
***************
*** 73,76 ****
--- 73,77 ----
  $temp = array();
  $posts = explode("--MT-ENTRY--", $importdata);
+ unset( $importdata ); // Free up memory
  
  function users_form($n) {
***************
*** 175,184 ****
  
  	//bring in the posts now
! 	set_magic_quotes_runtime(0);
! $datalines = file(MTEXPORT); // Read the file into an array
! $importdata = implode('', $datalines); // squish it
  $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
  $importdata = preg_replace("/--------\nAUTHOR/", "--MT-ENTRY--\nAUTHOR", $importdata);
  $posts = explode("--MT-ENTRY--", $importdata);
  $i = -1;
  echo "<ol>";
--- 176,189 ----
  
  	//bring in the posts now
! set_magic_quotes_runtime(0);
! $importdata = file(MTEXPORT); // Read the file into an array
! $importdata = implode('', $importdata); // squish it
  $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
  $importdata = preg_replace("/--------\nAUTHOR/", "--MT-ENTRY--\nAUTHOR", $importdata);
+ $authors = array();
+ $temp = array();
  $posts = explode("--MT-ENTRY--", $importdata);
+ unset( $importdata ); // Free up memory
+ 
  $i = -1;
  echo "<ol>";



More information about the cvs mailing list