Skip to content

A PHP class providing an easy interface for running multiple concurrent CURL requests

License

Notifications You must be signed in to change notification settings

bozhidarslaveykov97/ParallelCURL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ParallelCURL

GitHub release GitHub stars Github All Releases GitHub issues GitHub license

A PHP class providing an easy interface for running multiple concurrent CURL requests

<?php
$maxRequests = 2;
$curlOptions = array(
    CURLOPT_SSL_VERIFYPEER => FALSE,
    CURLOPT_SSL_VERIFYHOST => FALSE,
    CURLOPT_FOLLOWLOCATION => 1,
    CURLOPT_VERBOSE => 0,
    CURLOPT_TIMEOUT => 15,
    CURLOPT_ENCODING => 'gzip, deflate',
);

$parallelCurl = new \SelfWorks\PrallelCURL\ParallelCurlClass($maxRequests, $curlOptions);
$parallelCurl->startRequest("https://google.com", 
    array(
        'request_id'=>1
    ));

$parallelCurl->startRequest("https://youtube.com", array(
        'request_id'=>2
));
$requestedContent = $parallelCurl->finishAllRequests();

?>

About

A PHP class providing an easy interface for running multiple concurrent CURL requests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages