a
This commit is contained in:
parent
91176cb79b
commit
f5e04f3452
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
require_once 'Functions.php';
|
||||
require_once 'Societeusercentral.php';
|
||||
|
||||
class Cronnettoyerfihierstemp
|
||||
{
|
||||
private $societeusercentral;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// $this->societeusercentral = new Societeusercentral();
|
||||
}
|
||||
|
||||
// function suppression($dossier_traite , $extension_choisie, $age_requis)
|
||||
function suppression($dossier_traite , $age_requis)
|
||||
{
|
||||
$repertoire = opendir($dossier_traite);
|
||||
|
|
@ -19,20 +21,10 @@ class Cronnettoyerfihierstemp
|
|||
|
||||
|
||||
$infos = pathinfo($chemin);
|
||||
// $extension = $infos['extension'];
|
||||
|
||||
$age_fichier = time() - filemtime($chemin);
|
||||
|
||||
// if($fichier!="." AND $fichier!=".." AND !is_dir($fichier)
|
||||
// $extension == $extension_choisie AND $age_fichier > $age_requis)
|
||||
|
||||
/*
|
||||
echo "Chemai, : ".$chemin." Age : ".$age_fichier;
|
||||
|
||||
echo "<br>";
|
||||
*/
|
||||
|
||||
if($fichier!="." AND $fichier!=".." AND !is_dir($fichier) AND $age_fichier > $age_requis)
|
||||
if($fichier!="." AND $fichier!=".." AND !is_dir($chemin) AND $age_fichier > $age_requis)
|
||||
{
|
||||
unlink($chemin);
|
||||
}
|
||||
|
|
@ -66,11 +58,51 @@ class Cronnettoyerfihierstemp
|
|||
|
||||
}
|
||||
|
||||
$nettoyerfihierstemp = new Cronnettoyerfihierstemp();
|
||||
$nettoyerfihierstemp = new Cronnettoyerfihierstemp();
|
||||
$societeusercentral = (new Societeusercentral())->getSocieteuserSaas();
|
||||
|
||||
/* KANE => maj 14/02/2026
|
||||
$nettoyerfihierstemp->suppression( "../Temp" , "3600" );
|
||||
|
||||
$nettoyerfihierstemp->suppression( "../Temp/import" , "432000" );
|
||||
*/
|
||||
|
||||
$tempProduction = $societeusercentral['tempProduction'];
|
||||
$tempPrestation = $societeusercentral['tempPrestation'];
|
||||
$tempGarant = $societeusercentral['tempGarant'];
|
||||
$tempAssure = $societeusercentral['tempAssure'];
|
||||
$tempRh = $societeusercentral['tempRh'];
|
||||
|
||||
/*
|
||||
var_dump(
|
||||
array(
|
||||
"tempProduction" => $tempProduction,
|
||||
"tempPrestation" =>$tempPrestation,
|
||||
"tempGarant" => $tempGarant,
|
||||
"tempAssure" => $tempAssure,
|
||||
"tempRh" => $tempRh
|
||||
)
|
||||
);
|
||||
exit();
|
||||
*/
|
||||
|
||||
// Production
|
||||
$nettoyerfihierstemp->suppression($tempProduction."/Temp" , "3600" );
|
||||
$nettoyerfihierstemp->suppression($tempProduction."/Temp/import" , "432000" );
|
||||
|
||||
// Prestation
|
||||
$nettoyerfihierstemp->suppression($tempPrestation."/Temp" , "3600" );
|
||||
$nettoyerfihierstemp->suppression($tempPrestation."/Temp/import" , "432000" );
|
||||
|
||||
// Garant
|
||||
$nettoyerfihierstemp->suppression($tempGarant."/Temp" , "3600" );
|
||||
$nettoyerfihierstemp->suppression($tempGarant."/Temp/import" , "432000" );
|
||||
|
||||
// Assure
|
||||
$nettoyerfihierstemp->suppression($tempAssure."/Temp" , "3600" );
|
||||
$nettoyerfihierstemp->suppression($tempAssure."/Temp/import" , "432000" );
|
||||
|
||||
// RH
|
||||
$nettoyerfihierstemp->suppression($tempRh."/Temp" , "3600" );
|
||||
$nettoyerfihierstemp->suppression($tempRh."/Temp/import" , "432000" );
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user