CacheFile

File-based caching class.

Version

2008.11.30

Copyright

2006-2009 LifeNexus Digital, Inc., and contributors.

License

Simplified BSD Licensehttp://opensource.org/licenses/bsd-license.php

See Also

Tarzanhttp://tarzan-aws.com

CacheFile

Container for all file-based cache methods.  Inherits additional methods from CacheCore.

Functions

__construct()

public function __construct($name,
$location,
$expires)

The constructor

Access

public

Parameters

namestring (Required) A name to uniquely identify the cache object.
locationstring (Required) The location to store the cache object in.  This may vary by cache method.
expiresinteger (Required) The number of seconds until a cache object is considered stale.

Returns

object Reference to the cache object.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/cachecore/cache.phps

create()

public function create($data)

Creates a new cache.

Access

public

Parameters

datamixed (Required) The data to cache.

Returns

boolean Whether the operation was successful.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/cachecore/cache.phps

read()

public function read()

Reads a cache.

Access

public

Returns

mixed Either the content of the cache object, or boolean false.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/cachecore/cache.phps

update()

public function update($data)

Updates an existing cache.

Access

public

Parameters

datamixed (Required) The data to cache.

Returns

boolean Whether the operation was successful.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/cachecore/cache.phps

delete()

public function delete()

Deletes a cache.

Access

public

Returns

boolean Whether the operation was successful.

timestamp()

public function timestamp()

Retrieves the timestamp of the cache.

Access

public

Returns

mixed Either the Unix timestamp of the cache creation, or boolean false.

reset()

public function reset()

Resets the freshness of the cache.

Access

public

Returns

boolean Whether the operation was successful.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/cachecore/cache.phps

is_expired()

public function is_expired()

Checks whether the cache object is expired or not.

Access

public

Returns

boolean Whether the cache is expired or not.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/cachecore/cache.phps