[pmwiki-users] Still php5.5 deprecated /e modifier errors
5ko at 5ko.fr
Fri May 15 09:40:27 CDT 2015
On 2015-05-15 14:32, ABClf wrote:
> I'm trying to build an updated version of my website, notably using
> FastCache recipe, and I get a few errors related to php 5.5.
> Among others, FastCache recipe is subject to this issue.
You may prefer to write more precise subject lines on messages, for
example "Cookbook recipe FastCache PHP 5.5 compatibility". This way the
author of the recipe may notice it more quickly and reply and fix it.
> Exploring the code, it looks like there is only one line using the
> deprecated code in the markup declaration, at the very beginning. Here
> is :
> Markup( 'nofastcache', 'directives', '/\\(:nofastcache:\\)/ei', "PZZ(
> \$GLOBALS['FastCacheValid'] = FALSE )" );
> I don't know how to fix it : the documentation at PmWiki/CustomMarkup
> doesn't talk about this case
There are examples how to convert older markup rules to the new format.
1. Replace "Markup(" with "Markup_e(".
2. In the "search" pattern, don't use the /e modifier (remove the letter
"e" after the slash).
3. In the "replace" code, replace '$1', '$2', etc. with \$m, \$m,
etc.; remove any PSS() calls.
In your case you don't have things like '$1' to replace, so it is
'/\\(:nofastcache:\\)/i', "PZZ(\$GLOBALS['FastCacheValid'] = FALSE)");
"Markup_e($name, $when, $pattern, $replace);
* $pattern cannot have an "/e" modifier
* $replace can be a string with program code to be evaluated;
note that the matches can be accessed with $m, $m
instead of '$1', '$2'
and PmWiki/CustomMarkupAlt, which does, has
> not been updated to handle php5.5 new rules.
> May someone help fixing this case ?
More information about the pmwiki-users