Created
March 4, 2009 18:20
-
-
Save samsoir/73927 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Clears the cache for Curl library | |
* | |
* @param bool all if TRUE will delete all Curl library caches | |
* @return Curl | |
* @author Sam Clark | |
*/ | |
public function clear_cache($all = FALSE) | |
{ | |
if ($this->config['cache'] === FALSE OR ! ($this->cache instanceof Cache)) | |
throw new Kohana_User_Error('Curl.clear_cache()', 'Cache not enabled for this instance. Please check your settings.'); | |
if ($all) | |
$this->cache->delete_tag($this->config['cache_tags']); | |
else | |
$this->cache->delete($this->create_cache_key()); | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment