Created
October 8, 2009 13:50
-
-
Save thefuxia/205028 to your computer and use it in GitHub Desktop.
function real_lastmod()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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