I want to handle memcache functionality globally via one constant like : define('CACHE_ON',1) or define ('CACHE_ON',0). we use load->driver function in models when fetching/saving records. Is there any function that switches on/off cache functionality?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You could define your own constant, and then load either the memcache driver, or dummy in the event that
CACHE_ON
is 0:If you've referenced the
memcache
driver directly, you'll have to refactor some code. There's no a global on/off switch, but you can create your own by refactoring.