FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
CurlRequest.php
Go to the documentation of this file.
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License
5 version 2 as published by the Free Software Foundation.
6 
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11 
12 You should have received a copy of the GNU General Public License along
13 with this program; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 */
16 
29 
35 {
40  private $handle = null;
41 
46  public function __construct($url)
47  {
48  $this->handle = curl_init($url);
49  }
50 
55  public function setOptions($options)
56  {
57  curl_setopt_array($this->handle, $options);
58  }
59 
64  public function execute()
65  {
66  return curl_exec($this->handle);
67  }
68 
74  public function getInfo($resource)
75  {
76  return curl_getinfo($this->handle, $resource);
77  }
78 
82  public function close()
83  {
84  curl_close($this->handle);
85  }
86 }
Utility functions for specific applications.