Classe: Cache_Container_db - X-Ref
PEAR/DB Cache Container.
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' has no meaning for the Cache itself. It's just there
because it's a good idea to have an automatically updated timestamp
field for debugging in all of your tables.
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, $userdata)
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.
|