Documentation

BexioCache
in package

Tags
author

Etienne Bagnoud etienne@artnum.ch

license

MIT

copyright

2023 Etienne Bagnoud

todo

Still in heavy developpment, not ready for usage as is.

Manage caching of external bexio data into two caches :

  • Short time cache to avoid hiting ratelimit (put,get,delete)
  • Long time cache in case bexio is down (store,load,remove)

Table of Contents

Properties

$cache  : mixed
$duration  : mixed
$path  : mixed

Methods

__construct()  : mixed
cmp_content()  : mixed
content_hash()  : string
delete()  : bool
get()  : string|false
get_age()  : int
iterate_collection()  : Generator
load()  : string|false
put()  : bool
ref_hash()  : string
ref_to_path()  : string
remove()  : bool
set_to_collection()  : bool
When set into collection, this will be for iterating only so performance penalty is not a concern when reading back. This is to be used in some specific emergency case where slowness is not a problem.
store()  : bool

Properties

$duration

protected mixed $duration = 30

Methods

__construct()

public __construct(Memcached $memcache, string $path[, int $duration = 30 ]) : mixed
Parameters
$memcache : Memcached
$path : string
$duration : int = 30

cmp_content()

public cmp_content(string $reference, string $content) : mixed
Parameters
$reference : string
$content : string

content_hash()

public content_hash(string $content) : string
Parameters
$content : string
Return values
string

delete()

public delete(string $reference) : bool
Parameters
$reference : string
Return values
bool

get()

public get(string $reference) : string|false
Parameters
$reference : string
Return values
string|false

get_age()

public get_age(string $reference) : int
Parameters
$reference : string
Return values
int

iterate_collection()

public iterate_collection(string $collection) : Generator
Parameters
$collection : string
Return values
Generator

load()

public load(string $reference) : string|false
Parameters
$reference : string
Return values
string|false

put()

public put(string $reference, string $content) : bool
Parameters
$reference : string
$content : string
Return values
bool

ref_hash()

public ref_hash(string $reference) : string
Parameters
$reference : string
Return values
string

ref_to_path()

public ref_to_path(string $reference) : string
Parameters
$reference : string
Return values
string

remove()

public remove(string $reference) : bool
Parameters
$reference : string
Return values
bool

set_to_collection()

When set into collection, this will be for iterating only so performance penalty is not a concern when reading back. This is to be used in some specific emergency case where slowness is not a problem.

public set_to_collection(string $reference, string $path) : bool
Parameters
$reference : string
$path : string
Return values
bool

store()

public store(string $reference, string $content) : bool
Parameters
$reference : string
$content : string
Return values
bool

        
On this page

Search results