PHP code example of zeroem / curl-bundle

1. Go to this page and download the library: Download zeroem/curl-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zeroem / curl-bundle example snippets


    // app/AppKernel.php
    $bundles = array(
        // ...
        new Zeroem\CurlBundle\ZeroemCurlBundle(),        
        // ...
    );

    // app/autoload.php
    $loader->registerNamespaces(array(
        // ...
        'Zeroem'              => __DIR__.'/../vendor/bundles'
        // ...
    ));



use Symfony\Component\HttpFoundation\Request;
use Zeroem\CurlBundle\HttpKernel\RemoteHttpKernel;

$request = Request::create("http://www.symfony.com");
$remoteKernel = new RemoteHttpKernel();
$response = $remoteKernel->handle($request);

use Zeroem\CurlBundle\Curl\RequestGenerator;

$generator = new RequestGenerator(array(CURLOPT_RETURNTRANSFER=>true));

// Automatically has CURLOPT_RETURNTRANSFER set to true
$request = $generator->getRequest();
shell
    php bin/vendors install