[pmwiki-devel] Updating recipes for PHP 7.2

Petko Yotov 5ko at 5ko.fr
Mon Jun 19 07:33:58 CDT 2017


On 2017-06-19 10:02, Dominique Faure wrote:
> On Mon, Jun 19, 2017 at 8:39 AM, Simon <nzskiwi at gmail.com> wrote:
>> 
>> I have a recipe I'd like to update for PHP 7.2.
>> I checked Custom Markup, which states that markup_e is deprecated.
>> Are there instructions for replacing markup_e available
> 
> Untested replacement code:
> =====<- - - - -
> Markup( 'NZTopo', # an internal PmWiki function that defines the custom
> markup for the wiki (see 
> http://www.pmwiki.org/wiki/PmWiki/CustomMarkup)
>   'directives',
>   "/\\(:nztopo (" . $qlocale . ")\s*(?:" . $qmods . "){0,7}\s*:\\)/i", 
> #
>   "NZTopoMarkup");
> 
> function NZTopoMarkup($m) {
>   return Keep(NZTopo_Parse(\$m[1], \$m[2], \$m[3], \$m[4], \$m[5], 
> \$m[6],
> \$m[7], \$m[8], \$m[9]));
> }
> =====<- - - - -

Either the above (without the backslashes before $m), or you pass as 
forth argument directly "NZTopo_Parse" and modify it like this:

   Markup( 'NZTopo',
     'directives',
     "/\\(:nztopo (" . $qlocale . ")\s*(?:" . $qmods . "){0,7}\s*:\\)/i", 
#
     "NZTopo_Parse");

   function NZTopo_Parse($m) { # change here
     list( , $p1, $p2, $p3, $p4, $p5, $p6, $p7, $p8, $p9) = $m; # add 
line, note the first comma


This is enough if you don't need $pagename in your function. If you need 
it, add such a line:

   extract($GLOBALS["MarkupToHTML"]);

Petko



More information about the pmwiki-devel mailing list