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)
)
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.
|