[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Cache/Container/ -> phplib.php (sommaire)

(pas de description)

Poids: 259 lignes (10 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 1 fichier
 Cache/Container.php

Définit 1 class

Cache_Container_phplib:: (7 méthodes):
  Cache_Container_phplib()
  fetch()
  save()
  remove()
  flush()
  idExists()
  garbageCollection()


Classe: Cache_Container_phplib  - X-Ref

Stores cache data into a database table using PHPLibs DB abstraction.

WARNING: Other systems might or might not support certain datatypes of
the tables shown. As far as I know there's no large binary
type in SQL-92 or SQL-99. Postgres seems to lack any
BLOB or TEXT type, for MS-SQL you could use IMAGE, don't know
about other databases. Please add sugestions for other databases to
the inline docs.

The field 'changed' is used by the garbage collection. Depending on
your databasesystem you might have to subclass fetch() and garbageCollection().

For _MySQL_ you need this DB table:

CREATE TABLE cache (
id          CHAR(32) NOT NULL DEFAULT '',
cachegroup  VARCHAR(127) NOT NULL DEFAULT '',
cachedata   BLOB NOT NULL DEFAULT '',
userdata    VARCHAR(255) NOT NULL DEFAUL '',
expires     INT(9) NOT NULL DEFAULT 0,

changed     TIMESTAMP(14) NOT NULL,

INDEX (expires),
PRIMARY KEY (id, cachegroup)
)


Cache_Container_phplib($options = '')   X-Ref
Creates an instance of a phplib db class to use it for storage.

param: mixed   If empty the object tries to used the

fetch($id, $group)   X-Ref
Pas de description

save($id, $data, $expires, $group)   X-Ref
Stores a dataset.

WARNING: we use the SQL command REPLACE INTO this might be
MySQL specific. As MySQL is very popular the method should
work fine for 95% of you.

remove($id, $group)   X-Ref
Pas de description

flush($group)   X-Ref
Pas de description

idExists($id, $group)   X-Ref
Pas de description

garbageCollection($maxlifetime)   X-Ref
Pas de description



Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7