Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
Curl.php
01 <?php
02
03 /*
04 * @package s9e\TextFormatter
05 * @copyright Copyright (c) 2010-2016 The s9e Authors
06 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
07 */
08 namespace s9e\TextFormatter\Utils\Http\Clients;
09 use s9e\TextFormatter\Utils\Http\Client;
10 class Curl extends Client
11 {
12 protected static $handle;
13 public function get($url, $headers = array())
14 {
15 $handle = $this->getHandle();
16 \curl_setopt($handle, \CURLOPT_HTTPGET, \true);
17 \curl_setopt($handle, \CURLOPT_HTTPHEADER, $headers);
18 \curl_setopt($handle, \CURLOPT_URL, $url);
19 return \curl_exec($handle);
20 }
21 public function post($url, $headers = array(), $body = '')
22 {
23 $headers[] = 'Content-Length: ' . \strlen($body);
24 $handle = $this->getHandle();
25 \curl_setopt($handle, \CURLOPT_HTTPHEADER, $headers);
26 \curl_setopt($handle, \CURLOPT_POST, \true);
27 \curl_setopt($handle, \CURLOPT_POSTFIELDS, $body);
28 \curl_setopt($handle, \CURLOPT_URL, $url);
29 return \curl_exec($handle);
30 }
31 protected function getHandle()
32 {
33 if (!isset(self::$handle))
34 self::$handle = $this->getNewHandle();
35 \curl_setopt(self::$handle, \CURLOPT_SSL_VERIFYPEER, $this->sslVerifyPeer);
36 \curl_setopt(self::$handle, \CURLOPT_TIMEOUT, $this->timeout);
37 return self::$handle;
38 }
39 protected function getNewHandle()
40 {
41 $handle = \curl_init();
42 \curl_setopt($handle, \CURLOPT_ENCODING, '');
43 \curl_setopt($handle, \CURLOPT_FAILONERROR, \true);
44 \curl_setopt($handle, \CURLOPT_FOLLOWLOCATION, \true);
45 \curl_setopt($handle, \CURLOPT_RETURNTRANSFER, \true);
46 return $handle;
47 }
48 }