forked from blallo/rss-bridge
[Cache] Remove orphan function utf8_encode_deep
This commit is contained in:
parent
0e9fb31986
commit
51ff8de346
2 changed files with 0 additions and 22 deletions
|
@ -14,8 +14,6 @@ class FileCache extends CacheAbstract {
|
||||||
public function saveData($datas){
|
public function saveData($datas){
|
||||||
$this->isPrepareCache();
|
$this->isPrepareCache();
|
||||||
|
|
||||||
//Re-encode datas to UTF-8
|
|
||||||
//$datas = Cache::utf8_encode_deep($datas);
|
|
||||||
$writeStream = file_put_contents($this->getCacheFile(), serialize($datas));
|
$writeStream = file_put_contents($this->getCacheFile(), serialize($datas));
|
||||||
|
|
||||||
if(!$writeStream) {
|
if(!$writeStream) {
|
||||||
|
|
|
@ -51,26 +51,6 @@ class Cache {
|
||||||
return preg_match('@^[A-Z][a-zA-Z0-9-]*$@', $nameCache);
|
return preg_match('@^[A-Z][a-zA-Z0-9-]*$@', $nameCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static public function utf8_encode_deep(&$input){
|
|
||||||
if (is_string($input)){
|
|
||||||
$input = utf8_encode($input);
|
|
||||||
} elseif(is_array($input)){
|
|
||||||
foreach($input as &$value){
|
|
||||||
Cache::utf8_encode_deep($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($value);
|
|
||||||
} elseif(is_object($input)){
|
|
||||||
$vars = array_keys(get_object_vars($input));
|
|
||||||
|
|
||||||
foreach($vars as $var){
|
|
||||||
Cache::utf8_encode_deep($input->$var);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static public function purge(){
|
static public function purge(){
|
||||||
$cacheTimeLimit = time() - 86400; // 86400 -> 24h
|
$cacheTimeLimit = time() - 86400; // 86400 -> 24h
|
||||||
$cachePath = 'cache';
|
$cachePath = 'cache';
|
||||||
|
|
Loading…
Reference in a new issue