Page test of skymvc website Test, crawling all pages to [1] [full screen preview]
Query ("show tables"); $ data = M ("article")-> fetch_array (PDO: FETCH_NUM); foreach ($ data as $ k => $ t) {$ tables [] = str_replace (TABLE_PRE, "", $ t [0]);} return $ tables;} public function onSetAction ($ a = array ()) {if (! Empty ($ a) {$ this-> action = array_merge ($ this-> action, $ a) ;}} public function onSetPara ($ a = array ()) {if (! Empty ($ a) {$ this-> para = array_merge ($ this-> para, $ a) ;}} public function getUrls () {$ tables = $ this-> getTables (); $ para = ""; foreach ($ this-> para as $ q) {$ para. = "& $ q = ". $ this-> id;} $ para. = "& token = ". $ this-> token. "& per_page = ". $ this-> per_page; foreach ($ tables as $ m) {$ uk = 0; foreach ($ this-> action as $ k => $) {$ urls [] = $ this-> site. "m = $ m & a = $ ". $ para; if ($ k % $ this-> maxThreads ==( $ this-> maxThreads-1) {$ uk ++ ;}} return $ urls ;} public function onStart () {set_time_limit (0); ob_implicit_flush (true); $ urls = $ this-> getUrls (); $ uk = 0; foreach ($ urls as $ k =>$ url) {$ purls [$ uk] [] = $ url; if ($ k % $ this-> maxThreads = ($ this-> maxThreads-1) {$ uk ++ ;}} echo "start
"; Foreach ($ purls as $ k => $ urls) {echo" section ". $ k ."
"; Flush (); @ ob_flush (); $ this-> loadClass (" spider "); $ this-> spider-> start ($ urls, function ($ data) {echo $ data ['URL']."
"; Flush (); @ ob_flush () ;}) ;}echo" test ended ";}}?>