fabianmichael/kirby-typography

Parse error on PHP 5.5

fvsch opened this issue · 1 comments

fvsch commented

On PHP 5.4 (yeah there are some old servers around) and PHP 5.5 (built-in PHP version in latest OSX, I’m getting a parse error in lib/kirbytypography.php, line 9.
Apparently PHP prior to 5.6 does not like computing stuff when declaring class properties.

class KirbyTypography extends PHP_Typography {

  protected $domainListUrl = 'http://data.iana.org/TLD/tlds-alpha-by-domain.txt';
  protected $domainListCacheLifetime = 60 * 24 * 7; // one week

Changing to protected $domainListCacheLifetime = 10080; seems to fix the issue (tested with PHP 5.5).

By the way, is that property supposed to represent a number of minutes?
Because 60 * 24 * 7 = 10080 is the number of minutes in a week.
If you want seconds, that’s 60 * 60 * 24 * 7 = 604800.

Thanks for the hint, should be fixed now.

FYI: Kirby-Typography uses the File Cache driver of the Toolkit, which needs cache lifetime in minutes.