Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Tybaze

    (@tybaze)

    Oh simply in order to match Singleton pattern. It avoid someone calling the construct instead of the getInstance() which may cause duplicate of the core instance ^^

    This is not really important ??
    But as your code is very smart I notice it.

    Thread Starter Tybaze

    (@tybaze)

    This is possible my fix didn’t work, because I do a substr starting at 16, but I don’t know what is in your “/w3tc-config/master-admin.php” file.

    On the svn I can see a change in the method W3_ConfigData::get_array_from_file()

    You can fix it by replacing line 134/135:

    $content = @file_get_contents($filename);
    $config = @eval(substr($content, 5));

    With :
    $config = include $filename;

    This will do the trick, I just tested it and it work.

    I don’t know if the dev of this plugin will read this but :
    I do not recommand to use “serialize/unserialize” for configuration, I recomand json_decode/encode.
    Serilize implementation can change between PHP versions, so it could break compatibility whereas json never change.
    More, json_decode/json_decode are faster than serialize. (but they do not manage Object, and here the configuration is an Array)

    Thread Starter Tybaze

    (@tybaze)

    My Fix is wrong, please use

    @eval('$config = '.substr($content, 16));

Viewing 3 replies - 1 through 3 (of 3 total)