Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.41
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
php /
JsonSchema /
Uri /
Retrievers /
Delete
Unzip
Name
Size
Permission
Date
Action
AbstractRetriever.php
604
B
-rw-r--r--
2016-01-25 16:43
Curl.php
1.94
KB
-rw-r--r--
2016-01-25 16:43
FileGetContents.php
2.42
KB
-rw-r--r--
2016-01-25 16:43
PredefinedArray.php
1.26
KB
-rw-r--r--
2016-01-25 16:43
UriRetrieverInterface.php
723
B
-rw-r--r--
2016-01-25 16:43
Save
Rename
<?php /* * This file is part of the JsonSchema package. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace JsonSchema\Uri\Retrievers; use JsonSchema\Validator; /** * Tries to retrieve JSON schemas from a URI using cURL library * * @author Sander Coolen <sander@jibber.nl> */ class Curl extends AbstractRetriever { protected $messageBody; public function __construct() { if (!function_exists('curl_init')) { throw new \RuntimeException("cURL not installed"); } } /** * {@inheritDoc} * @see \JsonSchema\Uri\Retrievers\UriRetrieverInterface::retrieve() */ public function retrieve($uri) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: ' . Validator::SCHEMA_MEDIA_TYPE)); $response = curl_exec($ch); if (false === $response) { throw new \JsonSchema\Exception\ResourceNotFoundException('JSON schema not found'); } $this->fetchMessageBody($response); $this->fetchContentType($response); curl_close($ch); return $this->messageBody; } /** * @param string $response cURL HTTP response */ private function fetchMessageBody($response) { preg_match("/(?:\r\n){2}(.*)$/ms", $response, $match); $this->messageBody = $match[1]; } /** * @param string $response cURL HTTP response * @return boolean Whether the Content-Type header was found or not */ protected function fetchContentType($response) { if (0 < preg_match("/Content-Type:(\V*)/ims", $response, $match)) { $this->contentType = trim($match[1]); return true; } return false; } }