FOSSology  4.4.0
Open Source License Compliance by Open Source Software
CurlRequest.php
Go to the documentation of this file.
1 <?php
2 # SPDX-FileCopyrightText: © Fossology contributors
3 
4 # SPDX-License-Identifier: GPL-2.0-only
5 
18 
24 {
29  private $handle = null;
30 
35  public function __construct($url)
36  {
37  $this->handle = curl_init($url);
38  }
39 
44  public function setOptions($options)
45  {
46  curl_setopt_array($this->handle, $options);
47  }
48 
53  public function execute()
54  {
55  return curl_exec($this->handle);
56  }
57 
63  public function getInfo($resource)
64  {
65  return curl_getinfo($this->handle, $resource);
66  }
67 
71  public function close()
72  {
73  curl_close($this->handle);
74  }
75 }
Utility functions for specific applications.