Skip to content

Commit

Permalink
Merge pull request #3056 from vuthao/nukeviet4.4
Browse files Browse the repository at this point in the history
remove Compress for Caches
  • Loading branch information
hoaquynhtim99 committed Mar 15, 2021
2 parents fb7d746 + d3a1cb2 commit 9432bdc
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions vendor/vinades/nukeviet/Cache/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ class Files

private $_Db;

private $_FunCompress = '';

private $_FunUnCompress = '';

private $_Current_Time = 0;

/**
Expand All @@ -50,15 +46,6 @@ public function __construct($CacheDir, $Lang, $Cache_Prefix)
$this->_Lang = $Lang;
$this->_Cache_Prefix = $Cache_Prefix;

// Xac dinh function nen string
if (function_exists('gzcompress') and function_exists('gzuncompress')) {
$this->_FunCompress = 'gzcompress';
$this->_FunUnCompress = 'gzuncompress';
} elseif (function_exists('gzdeflate') and function_exists('gzinflate')) {
$this->_FunCompress = 'gzdeflate';
$this->_FunUnCompress = 'gzinflate';
}

if (defined('NV_CURRENTTIME')) {
$this->_Current_Time = NV_CURRENTTIME;
} else {
Expand Down Expand Up @@ -153,12 +140,7 @@ public function getItem($module_name, $filename, $ttl = 0)
return false;
}

$content = file_get_contents($fullname);
if (!empty($this->_FunUnCompress)) {
$content = call_user_func($this->_FunUnCompress, $content);
}

return $content;
return file_get_contents($fullname);
}

/**
Expand All @@ -181,10 +163,6 @@ public function setItem($module_name, $filename, $content, $ttl = 0)
mkdir($this->_CacheDir . '/' . $module_name, 0777, true);
}

if (!empty($this->_FunCompress)) {
$content = call_user_func($this->_FunCompress, $content);
}

return file_put_contents($this->_CacheDir . '/' . $module_name . '/' . $filename, $content);
}

Expand Down

0 comments on commit 9432bdc

Please sign in to comment.