$_GET['debugtnx'] = 1; $path = "utenti/avatable_demo_ristorante/cache/css/"; // $path = "utenti/demo_ristorante/cache/css/"; $path = "utenti/italiandesigncontract_com/cache/css/"; // $path = "indi"; if($_GET['demin']){ exec('sed "s/[;},]/\n/g" '.$path.$_GET['demin'], $output); echo "
".implode("\n", $output)."";
die;
}
$html = '';
function genera_link($params){
return $_SERVER['REQUEST_URI']."&".http_build_query($params);
}
function htmlentities_utf8($string){
return htmlentities($string, ENT_COMPAT | ENT_HTML401, "UTF-8");
}
$output = [];
exec("ls -tal --full-time $path", $output);
$allFilesByDate = [];
foreach($output as $k=>$o) if($k > 1){//la prima riga è "total" la seconda è l'entry "."
$o = explode(" ", preg_replace("/\s+/", " ", $o));//le date con cifra singola hanno un doppio spazio
/*
[0] => -rw-r--r--
[1] => 1
[2] => www-data
[3] => www-data
[4] => 287736
[5] => Sep
[6] => 14
[7] => 15:33
[8] => less_7d84624ae2b222a7c974791b8f843651.min.css
[0] => -rw-r--r--
[1] => 1
[2] => www-data
[3] => www-data
[4] => 131
[5] => 2024-11-11
[6] => 17:43:13.594412167
[7] => +0100
[8] => _FW_container_701ea67888d68a967ded0be661637803.min.css
*/
// print_r_tnx($o, $_SERVER['REMOTE_ADDR'] == '192.168.0.177') || die;
$o[6] = explode(".", $o[6]);
$allFilesByDate[] = [
'n' => $o[8],
's' => $o[4],
'd' => $o[5]." ".$o[6][0],
];
}
$stampati = 0;
foreach($allFilesByDate as $f1){
$files = [];
foreach($allFilesByDate as $f2) if($f1['s'] == $f2['s']) $files[] = $f2;
if(count($files) > 1){
foreach($files as $k=>$v){
foreach($files as $k1=>$v1) if($k1 > $k){
exec('sed "s/[;},]/\n/g" '.$path.$v['n'].' > /tmp/1');
exec('sed "s/[;},]/\n/g" '.$path.$v1['n'].' > /tmp/2');
$cmd = 'diff -C 1 /tmp/1 /tmp/2';
$output = [];
exec($cmd, $output, $ret);
$html .= "