mirror of
https://github.com/manualdousuario/marreta.git
synced 2025-09-02 18:51:06 +00:00
renomeada a função de debug para disable_cache
This commit is contained in:
parent
5683fe987e
commit
630d03e03d
3 changed files with 9 additions and 9 deletions
|
@ -15,9 +15,9 @@ SITE_URL=https://localhost
|
||||||
# Recomendado: AdGuard DNS (94.140.14.14, 94.140.15.15)
|
# Recomendado: AdGuard DNS (94.140.14.14, 94.140.15.15)
|
||||||
DNS_SERVERS='94.140.14.14,94.140.15.15'
|
DNS_SERVERS='94.140.14.14,94.140.15.15'
|
||||||
|
|
||||||
# Modo de debug (true/false)
|
# Modo sem cache (true/false)
|
||||||
# Quando ativo, desativa o cache do sistema
|
# Quando ativo, desativa o cache do sistema
|
||||||
DEBUG=false
|
DISABLE_CACHE=false
|
||||||
|
|
||||||
# Configurações de Cache S3
|
# Configurações de Cache S3
|
||||||
S3_CACHE_ENABLED=false
|
S3_CACHE_ENABLED=false
|
||||||
|
|
|
@ -28,7 +28,7 @@ define('SITE_URL', isset($_ENV['SITE_URL']) ? $_ENV['SITE_URL'] : 'https://' . $
|
||||||
define('MAX_ATTEMPTS', 3); // Número máximo de tentativas para acessar uma URL
|
define('MAX_ATTEMPTS', 3); // Número máximo de tentativas para acessar uma URL
|
||||||
define('DNS_SERVERS', isset($_ENV['DNS_SERVERS']) ? $_ENV['DNS_SERVERS'] : '1.1.1.1, 8.8.8.8');
|
define('DNS_SERVERS', isset($_ENV['DNS_SERVERS']) ? $_ENV['DNS_SERVERS'] : '1.1.1.1, 8.8.8.8');
|
||||||
define('CACHE_DIR', __DIR__ . '/cache');
|
define('CACHE_DIR', __DIR__ . '/cache');
|
||||||
define('DEBUG', isset($_ENV['DEBUG']) ? filter_var($_ENV['DEBUG'], FILTER_VALIDATE_BOOLEAN) : false);
|
define('DISABLE_CACHE', isset($_ENV['DISABLE_CACHE']) ? filter_var($_ENV['DISABLE_CACHE'], FILTER_VALIDATE_BOOLEAN) : false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configurações de Cache S3
|
* Configurações de Cache S3
|
||||||
|
|
|
@ -65,8 +65,8 @@ class Cache
|
||||||
*/
|
*/
|
||||||
public function exists($url)
|
public function exists($url)
|
||||||
{
|
{
|
||||||
// Se DEBUG está ativo, sempre retorna false
|
// Se DISABLE_CACHE está ativo, sempre retorna false
|
||||||
if (DEBUG) {
|
if (DISABLE_CACHE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +81,8 @@ class Cache
|
||||||
*/
|
*/
|
||||||
public function get($url)
|
public function get($url)
|
||||||
{
|
{
|
||||||
// Se DEBUG está ativo, sempre retorna null
|
// Se DISABLE_CACHE está ativo, sempre retorna null
|
||||||
if (DEBUG) {
|
if (DISABLE_CACHE) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,8 +98,8 @@ class Cache
|
||||||
*/
|
*/
|
||||||
public function set($url, $content)
|
public function set($url, $content)
|
||||||
{
|
{
|
||||||
// Se DEBUG está ativo, não gera cache
|
// Se DISABLE_CACHE está ativo, não gera cache
|
||||||
if (DEBUG) {
|
if (DISABLE_CACHE) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue