PHP Classes

File: get_cached.php

Recommend this page to a friend!
  Classes of Schroetter Christian   PHP Curl HTTP Wrapper   get_cached.php   Download  
File: get_cached.php
Role: Example script
Content type: text/plain
Description: Sample file
Class: PHP Curl HTTP Wrapper
Send HTTP requests with Curl and cache the results
Author: By
Last change:
Date: 9 years ago
Size: 567 bytes


Class file image Download

$curl = new CCurlWrapper();
$curl->InitEx() === false)
'Unable to init the CURL library' . "\n");

// cache per month (the folder SHOULD have been created first)
$curl->EnableCache(true, CACHE_MONTH, './cache');

// define the port (useless until it 80 but for the example...)

// the result of the request is displayed in the console if the '-v' param is supplied...
$curl->SetReturnTransfer(!in_array('-v', $argv));

// request