web crawler - PHP Start script where it timed out -
i'm building web crawler start test on shared webhosting, not allow set_time_limit
can't make sure script keeps running longer 30 seconds.
what best way start php script next time timed out before? thinking saving last crawled url in file there other options?
edit: scallioxtx right, can't use variables goto
label. around large if
statement, @ point i'd it's best not use goto
@ all. here alternative method:
<?php // load label number database or text file $label_num if($label_num <= 1) { // stuff } if($label_num <= 2) { // more stuff } // ... ?>
old (incorrect) method:
you can of course use goto
: http://us1.php.net/goto
i use temporary measure until better hosting.
here's do:
- at various locations throughout code, write label (ex.
count1:
,count2:
, etc.) - at each location added label, write label name database or text file
- at beginning of script, load value , jump specified label
example:
<?php // load label number database or text file $label_num if($label_num) { goto $label_num; } count1: // stuff count2: // more stuff // ... ?>
Comments
Post a Comment