Created
April 2, 2011 19:14
-
-
Save dragoonis/899783 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
static function getCache($p_mOptions = null) { | |
switch(true) { | |
case is_array($p_mOptions): | |
return new PPI_Cache($p_mOptions); | |
break; | |
case is_null($p_mOptions) || ($bIsString = is_string($p_mOptions)): | |
$config = self::getConfig(); | |
$options = isset($config->cache) ? $config->cache->toArray() : array(); | |
if(isset($bIsString)) { | |
$options['handler'] = $p_mOptions; | |
} | |
return new PPI_Cache($options); | |
break; | |
default: | |
throw new PPI_Exception('Invalid option passed to getCache()'); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment