Reply to Re: process a BIG string

Your name:

Reply:


Posted by _q_u_a_m_i_s's on 10/06/06 10:50

i will use that..
http://ro2.php.net/set_time_limit

a good advice would be also
http://ro2.php.net/manual/en/function.set-time-limit.php#69957
so i can "resume" file processing from time to time...but i guess it
wold be better to just take the time a do the whole file-processing at
once.
also, this thing seems interesting
http://ro2.php.net/manual/en/function.set-time-limit.php#54023 i may do
an output to the broser, telling the user the progress with that file.
thanks a lot.

PS: what do you mean by runaways? you mean that the script could enter
a infinite loop? or is it something i'm missing here?


Colin McKinnon a scris:
> quamis@gmail.com wrote:
>
> >
> > the problem is that with large files(>8Mb) i get a script error(Fatal
> > error: Maximum execution time of 30 seconds exceeded ).
> > i acess every character in the buffer with
> <snip>
>
> > can i do something to speed things up?
>
> Not without resolving the problem of why you need to examine each char.
>
> I would suggest that you before commencing the processing you put:
>
> set_time_limit(0);
> ignore_user_abort(); // in case your browser timeout.
>
> ...then in the read loop but ouitside the char loop provide a machanism for
> stopping runaways:
>
> if ((rand(0,20)==10) && (file_exists("break")) {
> break;
> }
>
> C.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация