Fix linting

This commit is contained in:
Nigel Sheldon 2020-11-21 15:51:56 +01:00
commit 1614145b18
262 changed files with 45324 additions and 42695 deletions

View file

@ -1,35 +1,39 @@
<?php
class Cache
{
public function set($id, $var)
{
function set($id,$var)
{
$file = '<?php $cache = '.var_export($var,TRUE).'; ?>';
$file = '<?php $cache = '.var_export($var, true).'; ?>';
file_put_contents(ONYX.'cache/'.md5($id).'.cache.php',$file) or trigger_error('dossier cache inaccessible en écriture.',E_USER_ERROR);
}
function read($id)
{
if(!is_readable(ONYX.'cache/'.md5($id).'.cache.php')) return FALSE;
include(ONYX.'cache/'.md5($id).'.cache.php');
if(!$cache) return FALSE;
return $cache;
}
function del($id)
{
if(!is_file(ONYX.'cache/'.md5($id).'.cache.php')) return FALSE;
return unlink(ONYX.'cache/'.md5($id).'.cache.php');
}
function flush()
{
foreach(glob(ONYX.'cache/*.cache.php') as $file) unlink($file);
}
file_put_contents(ONYX.'cache/'.md5($id).'.cache.php', $file) or trigger_error('dossier cache inaccessible en écriture.', E_USER_ERROR);
}
?>
public function read($id)
{
if (!is_readable(ONYX.'cache/'.md5($id).'.cache.php')) {
return false;
}
include(ONYX.'cache/'.md5($id).'.cache.php');
if (!$cache) {
return false;
}
return $cache;
}
public function del($id)
{
if (!is_file(ONYX.'cache/'.md5($id).'.cache.php')) {
return false;
}
return unlink(ONYX.'cache/'.md5($id).'.cache.php');
}
public function flush()
{
foreach (glob(ONYX.'cache/*.cache.php') as $file) {
unlink($file);
}
}
}