Why is my load_curl() function failing when being used concurrently in several scripts?
Environment
Oracle B2C Service
All supported versions
Resolution
As described in the general Connect PHP API documentation, curl can be used to enable external integrations using the Custom Processes functionality available with Oracle B2C Service.
In order to achieve this, the code needs to load the curl libraries available with Oracle B2C Service starting with August 2013 release, by making use of the sample code below:
==============================
load_curl();
$curl = curl_init();
static::$url_used = $url;
curl_setopt_array($curl,array(
CURLOPT_URL => $url,
CURLOPT_HEADER => 0,
CURLOPT_HTTPHEADER => $header,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_CONNECTTIMEOUT => 20,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_SSL_VERIFYHOST => 0
));
$content = curl_exec($curl);
==============================
When the curl libraries are used/called concurrently in multiple scripts, we need to ensure that the following check is performed before loading the libraries, to prevent any code failures:
if(!extension_loaded('curl')) { load_curl(); }
Para informações adicionais, consulte a seção Custom Process Overview na documentação on-line para a versão que seu site está executando no momento. Para acessar os manuais e a documentação on-line do Oracle B2C Service, consulte a Documentação para produtos Oracle B2C Service.