How to use zend_cache cache of zf framework_PHP tutorial

WBOY
Release: 2016-07-13 10:36:05
Original
740 people have browsed it

This article mainly introduces the basic operations of Zend_Cache file caching. For simple examples, friends in need can refer to it

The basic operations of Zend_Cache file caching. There are comments written in the code. Let’s learn it together. ​ The code is as follows: 60 , 'automtic_Serialization' => true); //Backend cache settings (cache storage path) $Boptions = array('cacheDir' => 'cache'); //Enable cache mode, (Core[core], File[file], front-end cache configuration information, back-end cache configuration information) $Cache = Zend_Cache::factory('Core','File',$Foptions,$Boptions); //Determine whether the cache exists, and if it exists, load the cache load('String'[cache name]) if ($Result = $Cache -> load('cache_two')) { echo "The cache already exists!
"; print_r($Result); } else { //If the cache does not exist, read the file and write the file contents to the lake cache echo "The cache does not exist!
"; $Filename = 'temp.txt'; $Fopen = fopen($Filename,'r'); $Result = fread($Fopen, filesize($Filename)); fclose($Fopen); //Save cache method load($Result[read resource],'cache name') $Cache -> save($Result,'cache_two'); print_r($Result); } ?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/741812.htmlTechArticleThis article mainly introduces the basic operations of Zend_Cache file caching. For simple examples, friends in need can refer to it. The basic operations of Zend_Cache file caching, there are comments written in the code,...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!