コード例 #1
0
ファイル: CurlTest.php プロジェクト: svobodni/web
 public function _testCurlShare()
 {
     // je funkční ale jestli pracuje správně???
     $a = new CUrl('http://example.com/');
     $a->enableShare();
     dump($a->exec());
     $b = new CUrl('http://php.net/');
     $b->enableShare();
     dump($b->exec());
 }
コード例 #2
0
ファイル: Fio.php プロジェクト: svobodni/web
 /**
  * @todo check filesize ??? 2MB in documentation
  * @param string $filename
  * @return XMLResponse
  * @throws FioException
  */
 private function send($filename)
 {
     $curl = new CUrl(self::REST_URL_WRITE);
     $curl->setOptions(array(CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADER => 0, CURLOPT_POST => 1, CURLOPT_VERBOSE => 0, CURLOPT_TIMEOUT => 60, CURLOPT_HTTPHEADER => array('Content-Type: multipart/form-data; charset=utf-8;'), CURLOPT_POSTFIELDS => array('type' => $this->uploadExtension, 'token' => $this->token, 'lng' => $this->language, 'file' => $curl->fileCreate($filename))));
     $this->availableAnotherRequest();
     $xml = trim($curl->exec());
     if (!$xml) {
         throw new FioException('FIO server is not responding.', 500);
     }
     return $this->response = new XMLResponse($xml);
 }