Page test of skymvc website Test, crawling all pages-PHP source code

Source: Internet
Author: User
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 ";}}?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.