Php apc cache details

Source: Internet
Author: User
Tags apc
Welcome to the Linux community forum and interact with 2 million technical staff to enter publicfunctionset_cache ($ key, $ value, $ time0) {if ($ time0) $ timenull; if null, returnapc_store ($ key, $ value, $ time);} *** Apc cache-Get cache * is permanently cached through KE

Welcome to the Linux community forum and interact with 2 million technical staff> go to public function set_cache ($ key, $ value, $ time = 0) {if ($ time = 0) $ time = null; // return apc_store ($ key, $ value, $ time);}/*** Apc cache-Get cache * through KE

Welcome to the Linux community forum and interact with 2 million technicians>

Public function set_cache ($ key, $ value, $ time = 0 ){

If ($ time = 0) $ time = null; // permanent cache when null

Return apc_store ($ key, $ value, $ time );;

}

/**

* Apc cache-Get Cache

* Obtain cache data using the KEY

* @ Param string $ key KEY value

*/

Public function get_cache ($ key ){

Return apc_fetch ($ key );

}

/**

* Apc cache-Clear a cache

* Delete A cache from memcache

* @ Param string $ key KEY value

*/

Public function clear ($ key ){

Return apc_delete ($ key );

}

/**

* Apc cache-clear all caches

* This function is not recommended.

* @ Return

*/

Public function clear_all (){

Apc_clear_cache ('user'); // clear the user Cache

Return apc_clear_cache (); // clear Cache

}

/**

* Check whether the APC cache exists.

* @ Param string $ key KEY value

*/

Public function exists ($ key ){

Return apc_exists ($ key );

}

/**

* Field Auto-increment-used for counting

* @ Param string $ key KEY value

* @ Param int $ step the new step value

*/

Public function inc ($ key, $ step ){

Return apc_inc ($ key, (int) $ step );

}

/**

* Field Auto-subtraction-used for counting

* @ Param string $ key KEY value

* @ Param int $ step the new step value

*/

Public function dec ($ key, $ step ){

Return apc_dec ($ key, (int) $ step );

}

/**

* Return APC Cache Information

*/

Public function info (){

Return apc_cache_info ();

}

}

[1] [2]

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.