This article mainly describes the basic operation of the Zend_cache file cache, a simple example, the need for friends can refer to the next
Zend_cache the basic operation of the file cache, the code has written comments, everyone together to learn the code is as follows: , ' automtic_serialization ' = true);//Backend Cache settings (cache storage path) $Boptions = Array (' Cachedir ' = ' cache ');//Turn on cache mode (core[ Core],file[file], front-end cache configuration information, backend cache configuration information) $Cache = zend_cache::factory (' core ', ' File ', $Foptions, $Boptions);//Determine if the cache exists, If present, load cache load (' String ' [cache name]) if ($Result = $Cache load (' Cache_two ')) {echo "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 "Cache does not exist!"
"; $Filename = ' temp.txt '; $Fopen = Fopen ($Filename, ' R '); $Result = Fread ($Fopen, FileSize ($Filename)); Fclose ($Fopen); Save cache mode Load ($Result [Read Resources], ' cache name ') $Cache, Save ($Result, ' cache_two '); Print_r ($Result);}? >
http://www.bkjia.com/PHPjc/741812.html www.bkjia.com true http://www.bkjia.com/PHPjc/741812.html techarticle This article mainly describes the basic operation of the Zend_cache file cache, a simple example, the need for friends can refer to the following Zend_cache file cache basic operations, the code has written comments, ...