\cge_cached_remote_file

A class to copy a remote URL to a local, temporary location for a specified amount of time.

Summary

Methods
Properties
Constants
__construct()
get_source()
get_dest()
get_cache_timelimit()
set_cache_timelimit()
file()
file_get_contents()
md5()
size()
type()
cleanup()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(string  $src, integer  $timelimit, string  $dest = '', boolean  $public = FALSE) 

Constructor

Parameters

string $src

The source URL

integer $timelimit

The amount of time in minutes before this file must be refreshed. Default is 24 hours.

string $dest

Optional destination filename.

boolean $public

Optional. If public is set, and dest is not set, attempt to use the PUBLIC_CACHE_LOCATION for the destination.

get_source()

get_source() : string

Return the source URL

Returns

string

get_dest()

get_dest() : string

Get the destination filename

Returns

string

get_cache_timelimit()

get_cache_timelimit() : integer

Get the time limit

Returns

integer

set_cache_timelimit()

set_cache_timelimit(integer  $minutes) 

Adjust the time limit

Parameters

integer $minutes

The number of minutes before this item needs refreshing

file()

file() : array

Return the entire cached file into an array

Returns

array

file_get_contents()

file_get_contents() : string

Return the contents of the cached file as a single string

Returns

string

md5()

md5() : string

Return the md5 signature of the cached file

Returns

string

size()

size() : integer

Get the size of the cached file

Returns

integer

type()

type() : string

Get the mime type of the cached file

Returns

string

cleanup()

cleanup() 

Clean up the cached file.