Created
December 22, 2009 16:04
-
-
Save meritt/261815 to your computer and use it in GitHub Desktop.
Пример использования Zend_Cache_Manager
This file contains 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 | |
$manager = new Zend_Cache_Manager; | |
$dbCache = array( | |
'frontend' => array( | |
'name' => 'Core', | |
'options' => array( | |
'lifetime' => 7200, | |
'automatic_serialization' => true | |
) | |
), | |
'backend' => array( | |
'name' => 'Core', | |
'options' => array( | |
'cache_dir' => '/path/to/cache' | |
) | |
) | |
); | |
$manager->setCacheTemplate('database', $dbCache); | |
$pageCache = array( | |
'frontend' => array( | |
'name' => 'Output', | |
'options' => array( | |
'ignore_user_abort' => true, | |
), | |
), | |
'backend' => array( | |
'name' => 'Static', | |
'options' => array( | |
'public_dir' => '../public', | |
), | |
), | |
); | |
$manager->setCacheTemplate('page', $pageCache); | |
// Возвращает объект кеширования с настройками для 'database' | |
$databaseCache = $manager->getCache('database'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment