<?php
if (isset($_SERVER['SERVER_NAME']))
{
die('Bitte führen Sie dieses Script separat über den PHP-Interpreter aus.');
}
/* --------------------------- */
function getAllFiles($directory, $recursive = true) {
{
if (($datei != '.') && ($datei != '..'))
{
$file = $directory.$datei;
if ($recursive) {
$result = array_merge($result, getAllFiles
($file.'/'));
}
} else {
$result[] = $file;
}
}
}
return $result;
}
function getHighestFileTimestamp($directory, $recursive = true) {
$allFiles = getAllFiles($directory, $recursive);
$highestKnown = 0;
foreach ($allFiles as $val) {
// WebBase-Spezifisch: Die eigenen Revisionsdaten gelten nicht als Relevant!
if (($val != $directory.'revision.inc.php') && ($val != $directory.'info.xml')) {
if ($currentValue > $highestKnown) $highestKnown = $currentValue;
}
}
return $highestKnown;
}
/* --------------------------- */
$dir = dirname($_SERVER['SCRIPT_NAME']);
$dir .= '/../';
$i = 0;
$v = 'modules/';
{
if (($file != '.') && ($file != '..') && (is_dir($v.$file)))
{
$i++;
$ary[$i] = $file;
}
}
foreach ($ary as $val)
{
$mod_timestamp = getHighestFileTimestamp('modules/'.$val.'/');
$dat = date('Y-m-d', $mod_timestamp);
{
if (SHOW_OUTPUT) echo "Module '$val' has now the modification date '$dat'.\n";
$inhalt = preg_replace('/<version>(.+?)<\/version>/im', '<version>'.$dat.'</version>', $inhalt);
$handle = fopen('modules/'.$val.'/info.xml', 'w');
}
}
/* --------------------------- */
$i = 0;
$v = 'designs/';
{
if (($file != '.') && ($file != '..') && (is_dir($v.$file)))
{
$i++;
$ary[$i] = $file;
}
}
foreach ($ary as $val)
{
$mod_timestamp = getHighestFileTimestamp('designs/'.$val.'/');
$dat = date('Y-m-d', $mod_timestamp);
{
if (SHOW_OUTPUT) echo "Design '$val' has now the modification date '$dat'.\n";
$inhalt = preg_replace('/<version>(.+?)<\/version>/im', '<version>'.$dat.'</version>', $inhalt);
$handle = fopen('designs/'.$val.'/info.xml', 'w');
}
}
/* --------------------------- */
{
$mod_timestamp = getHighestFileTimestamp('./');
$dat = date('d.m.Y', $mod_timestamp);
foreach ($ary as $val)
{
if ($bry[0] == '$rev_datum')
{
$buffer = str_replace('$rev_datum = '.$bry[1], '$rev_datum = \''.$dat.'\';', $buffer);
}
}
$handle = fopen('includes/revision.inc.php', 'w');
if (SHOW_OUTPUT) echo "The system has now the modification date '$dat'.\n";
}
if (SHOW_OUTPUT) {
die("\nDie Datumsangaben aller Module/Designs und die Revisionsinformation wurden aktualisiert!\n");
}
?>