Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#636: write() function in Cacheable class defines $ttl as *seconds* but it is actually *minutes*

The Cacheable Class in lib/core/class.cacheable.php has a write() function that accepts a $ttl parameter.

The documentation defines this as seconds (line 40-41). On line 64 the user input is actually multiplied by 60:

if($ttl > 0) $expiry = $creation + ($ttl * 60);

The result is that when we try to cache something for a day, as so:

$cache->write('foo', serialize($result), 3600 * 24);

.. the $ttl will be ((3600 * 24) * 60) and the content will be cached for sixty days instead of one... Or am I overlooking something silly?

Nope it looks like your absolutely correct, the $ttl is minutes, not seconds. That'd be my mistake.

Thanks.

Would it note be better to actually change it to (the more conventional?), seconds?

I understand a code change like this will have a direct impact on running sites, but my guess is that many others mistakenly believe the current cache to be in seconds.

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details