config = Dever::db('spider/project')->one($id); $this->check(); $this->runing(); } public function get() { return $this->config; } private function check() { if (!$this->config) { Dever::alert('项目未定义'); } if ($this->config['status'] != 1) { //Dever::alert('项目不是待机状态'); } } private function runing() { Dever::db('spider/project')->update(['status' => 2, 'where_id' => $this->config['id']]); $this->setting(); } private function setting() { $this->config['col'] = Dever::db('spider/col')->all(['project_id' => $this->config['id']]); $this->config['url'] = explode("\r\n", $this->config['site']); $this->config['queue'] = new Queue(); array_walk($this->config['url'], [$this->config['queue'], 'push']); } }