8 protected function initLbc()
10 $this->lbc = new \PEAR2\Services\Linkback\Client();
11 $req = $this->lbc->getRequest();
15 'ssl_verify_peer' => false,
16 'ssl_verify_host' => false
20 $headers = $req->getHeaders();
21 $req->setHeader('user-agent', 'anoweco');
22 $this->lbc->setRequestTemplate($req);
25 public function ping($postId)
28 $storage = new Storage();
29 $rowPost = $storage->getJsonComment($postId)->Xrow;
31 $from = Urls::full(Urls::comment($postId));
32 $to = $rowPost->comment_of_url;
35 $res = $this->lbc->send($from, $to);
36 if (!$res->isError()) {
41 error_log($res->getMessage());
44 } catch (\Exception $e) {
45 error_log($e->getMessage());
50 $pingState = $rowPost->comment_pingstate + 1;
54 $storage->setPostPingState($postId, $pingState);