useCache

Set a DALMP\Cache instance to use.

Parameters

useCache($cache)
$cache:A DALMP\Cache instance.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<?php

require_once 'dalmp.php';

$user = getenv('MYSQL_USER') ?: 'root';
$password = getenv('MYSQL_PASS') ?: '';

$DSN = "utf8://$user:$password".'@localhost/test';

$db = new DALMP\Database($DSN);

$cache = new DALMP\Cache(new DALMP\Cache\Memcache());

$db->useCache($cache);

$rs = $db->CacheGetOne('SELECT now()');

echo $rs, PHP_EOL;

See also

Cache method

Thanks Navicat for supporting Open Source projects.

Navicat



A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.

Donating helps ensure continued support, development and availability.

dalmp


comments powered by Disqus