<?php /** * 初始化关键词打入队列处理 */ $prepare = new Prepare(); $prepare->runCom(); class Prepare { public function __construct() { require "./SocketBeanstalk.php"; $this->beanstalk = new SocketBeanstalk(array("host" => "192.168.8.189", "port" => 11300)); $this->conn = new Table("forbuyers"); } public function run() { $kid = 0; while (1) { $mysqlRs = $this->conn->findAll("select kid, keyword from f_keyword_product where kid > '" . $kid . "' order by kid asc limit 100"); if (empty($mysqlRs)) { break; } foreach ($mysqlRs as $value) { $kid = $value["kid"]; $this->writeBeans($value["keyword"]); } } } public function runCom() {