Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created October 8, 2009 13:50
Show Gist options
  • Save thefuxia/205028 to your computer and use it in GitHub Desktop.
Save thefuxia/205028 to your computer and use it in GitHub Desktop.
function real_lastmod()
<?php
/**
* Gibt den Zeitpunkt der letzten Änderung aller verwendeten
* Dateien als UNIX-Timestamp zurück.
* @return integer
*/
function real_lastmod()
{
$arr_all_files = get_included_files();
if ( !array_key_exists(1, $arr_all_files) )
{
return getlastmod();
}
foreach ( $arr_all_files as $val )
{
$all_dates[] = filemtime($val);
}
/* Fix für http://bugs.php.net/bug.php?id=14837 */
if ( strstr(PHP_SAPI, 'cgi')
and
isset ( $_SERVER["SCRIPT_FILENAME"]) )
{
$all_dates[] = filemtime($_SERVER["SCRIPT_FILENAME"]);
}
// Änderungen an dieser Klasse selbst werden nicht berücksichtigt.
$all_dates[] = filemtime(__FILE__);
sort($all_dates);
return end($all_dates);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment