Zend_cache usage of zf framework _ PHP Tutorial

Source: Internet
Author: User
Zend_cache usage of the zf framework. This article mainly introduces the basic operations of Zend_Cache file caching. for a simple example, you can refer to the basic operations of Zend_Cache file caching. comments have been written in the code, this article mainly introduces the basic operations of Zend_Cache file cache, a simple example. For more information, see

The basic operations of Zend_Cache file cache are as follows: 60, 'automtic _ serialization' => true); // backend cache settings (cache storage path) $ Boptions = array ('cachedir' => 'cache '); // enable the Cache mode. (Core [Core], File [File], frontend Cache configuration information, and backend Cache configuration information) $ Cache = Zend_Cache: factory ('core ', 'file', $ Foptions, $ Boptions); // determines whether the cache exists. If yes, load the cache ('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 content into 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 mode load ($ Result [read resource], 'cache name') $ Cache-> save ($ Result, 'cache _ two'); print_r ($ Result) ;}?>

The basic operations of the Zend_Cache file cache, with comments written in the code ,...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.