Req #66639 [NEW]: Use ctime for file verification
From: nimzo at nimzo dot info
Operating system: Linux
PHP version: 5.5.8
Package: opcache
Bug Type: Feature/Change Request
Bug description:Use ctime for file verification
Description:
------------
In order to avoid problems when preserving timestamps using rsync and
similar tools it might be desirable to check ctime instead of mtime when
checking if script needs to be invalidated. APC has this option and it
comes quite useful.
Attached is a patch that enables this, it is lacking documentation and
tests (?), but I can create them too if this gets accepted.
Test script:
---------------
<?php
print_r(opcache_get_status(true));
echo "foo";
?>
Expected result:
----------------
If you set opcache.stat_ctime and run the script for the first time, it
should not be cached. If you then run it again you should see it cached
like this:
(
[full_path] => /tmp/test.php
[hits] => 0
[memory_consumption] => 1240
[last_used] => Mon Feb 3 20:37:05 2014
[last_used_timestamp] => 1391477825
[timestamp] => 1391477689
)
Then just 'chmod' the script so it changes ctime, but not mtime, then
run it again and you will get the empty array. Next time you run it, it
will be cached.
--
Edit bug report at https://bugs.php.net/bug.php?id=66639&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66639&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66639&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66639&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66639&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66639&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66639&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66639&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66639&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66639&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66639&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66639&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66639&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66639&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66639&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66639&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66639&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66639&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66639&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66639&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66639&r=mysqlcfg
Thread (2 messages)
- nimzo at nimzo dot info