Skip to content

Commit

Permalink
Updated example
Browse files Browse the repository at this point in the history
  • Loading branch information
stefangabos committed Nov 25, 2023
1 parent 7c4ba54 commit 2208e0b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion examples/proxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@
ini_set('display_errors', 1);
error_reporting(E_ALL);

// instantiate Zebra_cURL
// make sure cache folder exists and is writable
if (!is_dir('cache') || !is_writable('cache')) trigger_error('the "cache" folder must be present and be writable in the "examples" folder', E_USER_ERROR);

// make sure CA bundle exists
elseif (!file_exists('cacert.pem')) trigger_error('"cacert.pem" file was not found', E_USER_ERROR);

// include the library
require '../Zebra_cURL.php';

// instantiate the Zebra_cURL class
$curl = new Zebra_cURL();

// since we are communicating over HTTPS, we load the CA bundle from the examples folder,
// so we don't get CURLE_SSL_CACERT response from cURL
// you can always update this bundle from https://curl.se/docs/caextract.html
$curl->ssl(true, 2, __DIR__ . '/cacert.pem');

// one or more URLs
$queue = array(
'https://url1.com',
Expand Down

0 comments on commit 2208e0b

Please sign in to comment.