|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesopcache_ctime (last revision 2014-02-04 01:41 UTC by nimzo at nimzo dot info)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-02-04 01:48 UTC] nmerdan at reflected dot net
-: nimzo at nimzo dot info
+: nmerdan at reflected dot net
[2014-02-04 01:48 UTC] nmerdan at reflected dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 08:00:01 2025 UTC |
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.