forked from halo-battle/game
Ajout d'une étape de linting dans DroneCi (#3)
Corrige un doublons laissé par le rebase semi-manuel Ajout d'une étape de linting dans DroneCi Fix linting Co-authored-by: Nigel Sheldon <nigelsheldon@live.fr> Reviewed-on: https://gitea.nemunai.re/halo-battle/game/pulls/3
This commit is contained in:
parent
5b17a7dbd7
commit
dd61d3b66b
263 changed files with 45327 additions and 42695 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue