Created
November 17, 2014 17:08
-
-
Save andrebian/f5e1eb09679eea7746f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Memcached nativo */ | |
$m = new Memcached(); | |
$m->addServer('localhost', 11211); | |
$m->set('itens', $itens, 60); | |
/* Memcached Cake */ | |
// core.php | |
Cache::config('application', array( | |
'engine' => 'Memcached', | |
'servers' => array( | |
'127.0.0.1:11211' | |
), | |
'serialize' => 'json' | |
)); | |
// Controller | |
Cache::write('itens', $itens, 'application'); | |
// erro: application cache was unable to write 'itens' to Memcached cache [CORE/Cake/Cache/Cache.php, line 323] | |
/* Memcached Cake */ | |
/* APC Nativo */ | |
// Nativo | |
apc_store('itens', $itens, 60); | |
var_dump( apc_fetch('itens') ); | |
/* APC Cake */ | |
// core.php | |
Cache::config('application', array( | |
'engine' => 'Apc', | |
)); | |
// Controller | |
Cache::write('itens', $itens, 'application'); | |
var_dump( Cache::read('itens') ); | |
// output: false | |
/* APC Cake */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment