|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +/** |
| 4 | + * PHP class to handle connections with cPanel's UAPI as seamlessly and simply as possible. |
| 5 | + * |
| 6 | + * For documentation on cPanel's UAPI: |
| 7 | + * @see https://documentation.cpanel.net/display/SDK/UAPI+Functions |
| 8 | + * |
| 9 | + * @author N1ghteyes - www.source-control.co.uk |
| 10 | + * @copyright 2014 N1ghteyes |
| 11 | + * @license license.txt The MIT License (MIT) |
| 12 | + * @link https://github.com/N1ghteyes/cpanel-UAPI-php-class |
| 13 | + */ |
| 14 | + |
3 | 15 | /** |
4 | 16 | * Class cpanelUAPI |
5 | 17 | */ |
@@ -82,7 +94,7 @@ protected function curl_request($url) |
82 | 94 | curl_setopt($ch, CURLOPT_URL, $url); |
83 | 95 | curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Basic " . $this->auth)); |
84 | 96 | curl_setopt($ch, CURLOPT_TIMEOUT, 100020); |
85 | | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 97 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
86 | 98 |
|
87 | 99 | $content = $this->curl_exec_follow($ch); |
88 | 100 | $err = curl_errno($ch); |
@@ -118,22 +130,22 @@ protected function curl_exec_follow($ch, &$maxredirect = null) |
118 | 130 |
|
119 | 131 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $mr > 0); |
120 | 132 | curl_setopt($ch, CURLOPT_MAXREDIRS, $mr); |
121 | | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
122 | | - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
| 133 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
| 134 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); |
123 | 135 |
|
124 | 136 | } else { |
125 | 137 |
|
126 | | - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); |
| 138 | + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE); |
127 | 139 |
|
128 | 140 | if ($mr > 0) { |
129 | 141 | $original_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); |
130 | 142 | $newurl = $original_url; |
131 | 143 |
|
132 | 144 | $rch = curl_copy_handle($ch); |
133 | 145 |
|
134 | | - curl_setopt($rch, CURLOPT_HEADER, true); |
135 | | - curl_setopt($rch, CURLOPT_NOBODY, true); |
136 | | - curl_setopt($rch, CURLOPT_FORBID_REUSE, false); |
| 146 | + curl_setopt($rch, CURLOPT_HEADER, TRUE); |
| 147 | + curl_setopt($rch, CURLOPT_NOBODY, TRUE); |
| 148 | + curl_setopt($rch, CURLOPT_FORBID_REUSE, FALSE); |
137 | 149 | do { |
138 | 150 | curl_setopt($rch, CURLOPT_URL, $newurl); |
139 | 151 | $header = curl_exec($rch); |
@@ -164,7 +176,7 @@ protected function curl_exec_follow($ch, &$maxredirect = null) |
164 | 176 | else |
165 | 177 | $maxredirect = 0; |
166 | 178 |
|
167 | | - return false; |
| 179 | + return FALSE; |
168 | 180 | } |
169 | 181 | curl_setopt($ch, CURLOPT_URL, $newurl); |
170 | 182 | } |
|
0 commit comments