!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/usr/share/php/JsonSchema/Uri/Retrievers/   drwxr-xr-x
Free 28.76 GB of 117.98 GB (24.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Curl.php (2.11 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?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\Exception\RuntimeException;
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')) {
            
// Cannot test this, because curl_init is present on all test platforms plus mock
            
throw new RuntimeException('cURL not installed'); // @codeCoverageIgnore
        
}
    }

    
/**
     * {@inheritdoc}
     *
     * @see \JsonSchema\Uri\Retrievers\UriRetrieverInterface::retrieve()
     */
    
public function retrieve($uri)
    {
        
$ch curl_init();

        
curl_setopt($chCURLOPT_URL$uri);
        
curl_setopt($chCURLOPT_HEADERtrue);
        
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
curl_setopt($chCURLOPT_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 bool Whether the Content-Type header was found or not
     */
    
protected function fetchContentType($response)
    {
        if (
preg_match("/Content-Type:(\V*)/ims"$response$match)) {
            
$this->contentType trim($match[1]);

            return 
true;
        }

        return 
false;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0036 ]--