After i try to enable the module, the following error was displayed:
Parse error: syntax error, unexpected T_FUNCTION in /path/to/my/sites/all/modules/eu_cookie_compliance/eu_cookie_compliance.module on line 581

Comments

t2000k created an issue. See original summary.

t2000k’s picture

Obviously the error was displayed beacuse of the php version 5.2.17.
After changing it to 5.6.31 it works!

t2000k’s picture

Status: Active » Fixed
svenryen’s picture

Technically, the module should have worked in 5.2.5, since that's the minimum requirement for Drupal.

I'll rewrite line 581 so that it works in PHP 5.2. Closures/anonymous functions were introduced first in PHP 5.3.

svenryen’s picture

Status: Fixed » Active
svenryen’s picture

Title: Parse error after enable module » Parse error after enable module (in php 5.2.x)
svenryen’s picture

I have looked into the conflicting line, and sadly it seems that the feature being used (callable functions) was first introduced for SQLite in PHP 5.4. A few attempts at refactoring have failed, so I'll include a note in the readme about this.

svenryen’s picture

Actually, I was able to refactor in a syntax that should work in PHP 5.2.

Attaching patch.

  • svenryen authored f5fb86b on 7.x-2.x
    Issue #2984947 by svenryen, t2000k: Parse error after enable module (in...

  • svenryen authored e30f8cf on 7.x-1.x
    Issue #2984947 by svenryen, t2000k: Parse error after enable module (in...
svenryen’s picture

Status: Active » Fixed

  • svenryen authored e30f8cf on 7.x-2.x
    Issue #2984947 by svenryen, t2000k: Parse error after enable module (in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.