PHP Classes

File: proxy.php

Recommend this page to a friend!
  Classes of Malik Naik  >  PHP Design Patterns Repository  >  proxy.php  >  Download  
File: proxy.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Design Patterns Repository
Implementation of common design patterns in PHP
Author: By
Last change:
Date: 8 months ago
Size: 626 bytes


Class file image Download

require_once 'vendor/autoload.php';


// Instantiate the caching downloader object.
$caching_downloader = new CachingDownloader(new SimpleDownloader);

// Fetch the data from
$result = $caching_downloader->download('');

// Fetch the data from the same url again.
$result = $caching_downloader->download('');

// Outputs:
// Fetching the data.
// Please wait....
// Downloading file from
// Downloaded: 1256 Bytes
// Returning the result from the cache.

For more information send a message to info at phpclasses dot org.