Created
April 2, 2011 19:44
-
-
Save avdg/899811 to your computer and use it in GitHub Desktop.
Revisions
-
avdg revised this gist
Apr 2, 2011 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,14 @@ <?php static function getCache($p_mOptions = null) { if (!is_array($p_mOptions)) { $config = self::getConfig(); $options = isset($config->cache) ? $config->cache->toArray() : array(); if (is_string($p_mOptions)) { $options['handler'] = $p_mOptions; } $p_mOptions = $options; } return $p_mOptions; } -
salathe revised this gist
Apr 2, 2011 . 1 changed file with 9 additions and 18 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,15 @@ <?php static function getCache($p_mOptions = null) { if (is_array($p_mOptions)) { $options = $p_mOptions; } else { $config = self::getConfig(); $options = isset($config->cache) ? $config->cache->toArray() : array(); if (is_string($p_mOptions)) { $options['handler'] = $p_mOptions; } } return $options; } -
dragoonis revised this gist
Apr 2, 2011 . 1 changed file with 18 additions and 18 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,24 @@ <?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 } } -
dragoonis revised this gist
Apr 2, 2011 . 1 changed file with 19 additions and 19 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,24 @@ <?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 } } -
dragoonis revised this gist
Apr 2, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php /** * Get the cache object * -
dragoonis renamed this gist
Apr 2, 2011 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dragoonis created this gist
Apr 2, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ /** * 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); }