use pre-configured http_request2 instance
authorChristian Weiske <cweiske@cweiske.de>
Wed, 23 Oct 2013 19:03:15 +0000 (21:03 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 23 Oct 2013 19:03:15 +0000 (21:03 +0200)
src/stapibas/Feed/PingUrls.php

index 0812f0f..7c16223 100644 (file)
@@ -17,15 +17,16 @@ class Feed_PingUrls
         $this->log  = $deps->log;
 
         $this->pbc = new \PEAR2\Services\Linkback\Client();
-
-        $req = new \HTTP_Request2();
+        $req = $this->pbc->getRequest();
         $req->setConfig(
             array(
                 'ssl_verify_peer' => false,
                 'ssl_verify_host' => false
             )
         );
-        $this->pbc->setRequest($req);
+        $headers = $req->getHeaders();
+        $req->setHeader('user-agent', 'stapibas / ' . $headers['user-agent']);
+
         $this->pbc->setDebug(true);
     }