Knowledge Base Nr: 00219 filecache.php - http://www.swe-kaiser.de

Downloads:

PHP: Cachen von Files (nur neu erstellen wenn veraltet)

  
$now = getdate();

if ($progid == 1)
$ts = getdate(filemtime("c:/temp/a301.txt"));
else if ($progid == 2)
$ts = getdate(filemtime("c:/temp/z301.txt"));

if ($now['mday'] == $ts['mday'])
$fileuptodate = 1;

if (!$fileuptodate)
{
$cmd = "\"C:\Programme\vtplus\vtplus32.exe\" /se:\mystuff\vtprog_$progid.vts";

echo("<h3>run: $cmd</h3>\n");
exec($cmd, $output);

while (list($lineno,$line) = each($output))
echo "$line\n";
}