Doc #64881 [Com]: It's unclear how getlastmod is affected by includes/requires

From: Date: Mon, 20 May 2013 20:11:50 +0000
Subject: Doc #64881 [Com]: It's unclear how getlastmod is affected by includes/requires
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9861@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64881&edit=1 ID: 64881 Comment by: mail+php at requinix dot net Reported by: dean at omnivisiontechnology dot com Summary: It's unclear how getlastmod is affected by includes/requires Status: Open Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 1. When the documentation says "page" it really means "file" (ie, __FILE__). So >Gets the time of the last modification of the current file. 2. PHP can't know what files may be include()d later on, but you can use get_included_files() and filemtime() a la the comment by Moro [1] to get the most recent modification date of the ones include()d so far. IMO a feature request to bundle this into getlastmod() seems quite reasonable but you might want to make a separate feature request ticket so this one can remain a bug report. [1] http://php.net/function.getlastmod#109250 Previous Comments: ------------------------------------------------------------------------ [2013-05-20 11:28:07] dean at omnivisiontechnology dot com Description: ------------ It isn't clear from the manual page whether getlastmod() only checks the modification date of the main script file, or whether it takes into account modification dates of all include/require files also. Actually there are two issues: (1) If I use getlastmod() inside an include file, does it report the modification date of the include file, or of the main including script? (2) If I use getlastmod() inside a script that uses INCLUDE or REQUIRE to inline other files, and at least one of these has been modified more recently than the main including script, will this more recent modification date be returned by getlastmod()? If the answer to (2) is NO, then perhaps there should be an extension to getlastmod() (a boolean argument perhaps) or else a separate function that DOES work this way? A lot of webpages for example, are constructed by INCLUDE-ing a header and footer around the main content of the page; the reported modification date of the page should reflect a modification to any of these. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64881&edit=1

« previous php.doc.bugs (#9861) next »