\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()
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, int $timelimit, string $dest, bool $public)

Constructor

Parameters

string $src

The source URL

int $timelimit

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

string $dest

Optional destination filename.

bool $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() : int

Get the time limit

Returns

int

set_cache_timelimit()

set_cache_timelimit(int $minutes)

Adjust the time limit

Parameters

int $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() : int

Get the size of the cached file

Returns

int

cleanup()

cleanup()

Clean up the cached file.