php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59344 sleep() does not affect on "creation_time"
Submitted: 2010-08-07 17:53 UTC Modified: 2010-08-07 17:58 UTC
From: fruit dot dev at gmail dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.2.13 OS: Fedora 10
Private report: No CVE-ID: None
 [2010-08-07 17:53 UTC] fruit dot dev at gmail dot com
Description:
------------
If some cache are stored after calling sleep(), its creation_time is time, when php script was executed without adding slept time.

Reproduce code:
---------------
<?php

  print time() . "\n";
  apc_clear_cache('user');

  apc_store('CompanyName_31', 'Google Inc.', 86400);

  sleep(5);

  apc_store('Location_27', '1600 Amphitheatre Parkway', 84600);

  print time() . "\n";
  
  var_dump(apc_cache_info('user'));

Expected result:
----------------
// imagine, time() returns value: 1281216994


1281216994

// var_dump shows, that "CompanyName_31" creation_time is: 1281216994
// var_dump shows, that "Location_27" creation_time is: 1281216999

1281216999

Actual result:
--------------
// imagine, time() returns value: 1281216994


1281216994
// var_dump shows, that "CompanyName_31" creation_time is: 1281216994
// var_dump shows, that "Location_27" creation_time is: 1281216994

1281216999

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-07 17:58 UTC] rasmus@php.net
Once again, we assume short web requests and optimize our 
system calls and use the request time for the cache 
timestamps.  If you have long-running scripts where you don't 
want to use the request time, set:

apc.use_request_time = 0

in your php.ini file.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC