Skip to content

Instantly share code, notes, and snippets.

@dragoonis
Forked from avdg/gist:899811
Created April 2, 2011 19:51
Show Gist options
  • Select an option

  • Save dragoonis/899817 to your computer and use it in GitHub Desktop.

Select an option

Save dragoonis/899817 to your computer and use it in GitHub Desktop.
<?php
static function getCache($p_mOptions = null) {
switch(gettype($p_mOptions)) {
case 'array':
return new PPI_Cache($p_mOptions);
break;
case 'string':
$config = self::getConfig();
$options = isset($config->cache) ? $config->cache->toArray() : array();
$options['handler'] = $p_mOptions;
return new PPI_Cache($options);
break;
case 'null':
$config = self::getConfig();
$options = isset($config->cache) ? $config->cache->toArray() : array();
return new PPI_Cache($options);
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment