Skip to content

Instantly share code, notes, and snippets.

@samsoir
Created March 4, 2009 18:20
Show Gist options
  • Save samsoir/73927 to your computer and use it in GitHub Desktop.
Save samsoir/73927 to your computer and use it in GitHub Desktop.
<?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