-
-
Save dragoonis/899817 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
| /** | |
| * Get the cache object | |
| * | |
| * @param null|string|array $p_mOptions The information to get a different cache object | |
| * @return PPI_Cache | |
| */ | |
| static function getCache($p_mOptions = null) { | |
| if(is_array($p_mOptions)) { | |
| return new PPI_Cache($p_mOptions); | |
| } | |
| $options = array(); | |
| // Lets use the defaults from the config file as no special parameters were needed. | |
| if($p_mOptions === null || ($bIsString = is_string($p_mOptions))) { | |
| $config = self::getConfig(); | |
| $options = !empty($config->cache->handler) ? $config->cache->toArray() : array(); | |
| if(isset($bIsString) && $bIsString === true) { | |
| $options['handler'] = $p_mOptions; | |
| } | |
| } | |
| return new PPI_Cache($options); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment