fabianmichael / kirby-typography

Typographic enhancements for your Kirby-driven website.
GNU General Public License v3.0
78 stars 4 forks source link

Parse error on PHP 5.5 #3

Closed fvsch closed 8 years ago

fvsch commented 8 years ago

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.

fabianmichael commented 8 years ago

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.