arkleyjoe Posted August 20, 2009 Share Posted August 20, 2009 Hi, I am designing a routine that handles a bulk upload of files and assosiated data from either xml or CSV. due to the number of files (maybe 1000) it take a long time to execute. Rather than we have to wait until my script has fully executed before I get feedback on what has happened can I make the script give me feed back to the screen following the conpletetion of each loop? I hope that makes sense? Joe Quote Link to comment https://forums.phpfreaks.com/topic/171141-script-that-takes-a-long-time-to-execute/ Share on other sites More sharing options...
Maq Posted August 20, 2009 Share Posted August 20, 2009 Rather than we have to wait until my script has fully executed before I get feedback on what has happened can I make the script give me feed back to the screen following the conpletetion of each loop? Sure, why not? Quote Link to comment https://forums.phpfreaks.com/topic/171141-script-that-takes-a-long-time-to-execute/#findComment-902521 Share on other sites More sharing options...
arkleyjoe Posted August 20, 2009 Author Share Posted August 20, 2009 Can you help me under stand how? If I echo something to the screen link " file uploaded " it will wait until the script completes before displaying this?? Quote Link to comment https://forums.phpfreaks.com/topic/171141-script-that-takes-a-long-time-to-execute/#findComment-902531 Share on other sites More sharing options...
corbin Posted August 20, 2009 Share Posted August 20, 2009 Disable output buffering. ob_flush(); At the top of the script should do it. Or perhaps: while(ob_flush()); Quote Link to comment https://forums.phpfreaks.com/topic/171141-script-that-takes-a-long-time-to-execute/#findComment-902806 Share on other sites More sharing options...
Daniel0 Posted August 20, 2009 Share Posted August 20, 2009 flush Quote Link to comment https://forums.phpfreaks.com/topic/171141-script-that-takes-a-long-time-to-execute/#findComment-902812 Share on other sites More sharing options...
corbin Posted August 20, 2009 Share Posted August 20, 2009 Oooo never knew there was a function that caused the environment PHP was running under to flush too (or requests it anyway). Guess that makes sense . Quote Link to comment https://forums.phpfreaks.com/topic/171141-script-that-takes-a-long-time-to-execute/#findComment-902912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.