Page 1 of 1

XML in series

Posted: Wed May 20, 2009 1:58 pm
by styvodiabolo
Hello,

I would like to create many xml files (100000 for testing step). Here is the code to create them :

Code: Select all

 
for($i=$start; $i<=NB_SQL_USER; $i++) {
    //Begin XML
    $user_account->set_u_id($i);
    $user_account->create();
    $user_info->set_u_id($i);
    $user_info->create();
    //End XML
    do {
        sleep(0.5);
    }while(!file_exists($path_xml_infos.$i.'.xml'));
}
 
I add the do/while instruction to be sure that the xml is really there.
The problem : PHP going (maybe) too fast and create only 11000 xml.

Do I join an option to manage the creation ?
Do you have any suggest ?

Thanks a lot.

Steve.

Re: XML in series

Posted: Wed May 20, 2009 2:37 pm
by Christopher
You don't need the loop and it is probably making things worse. My guess is that the script is timing out at 11000. Check the php.ini setting for execution time. You can set it within the script for just that script.

Re: XML in series

Posted: Wed May 20, 2009 2:53 pm
by styvodiabolo
I've thought too that execution time was the pb but before the script, I've a couple of settings :

Code: Select all

 
set_time_limit(0);
ini_set('memory_limit','160M');
if(!ini_get('display_errors'))
    ini_set('display_errors', 1);
error_reporting(E_ALL);
 
arborint wrote:You don't need the loop and it is probably making things worse
How can I do without ?
Is an other way better to do the xml's serie ?

Steve.