[pmwiki-users] pmwiki and Xampp

Petko Yotov 5ko at 5ko.fr
Tue Dec 18 14:05:37 PST 2018


On 18/12/2018 17:46, Mikelis, James wrote:
> I was able to get everything working with PHP 7.2.2 for the most part
> except cookbook/AdvancedTableDirectives.php

I've looked at the AdvancedTableDirectives recipe and made an updated 
version available for download on the cookbook page, open

   https://www.pmwiki.org/wiki/Cookbook/AdvancedTableDirectives

and search for AdvancedTableDirectives-php72.php to get the latest file.

> and the " (:toggle hide box210 show='Show Validation Steps' button=1:)
> " function which I am not sure is part of
> the AdvancedTableDirectives code or not. It doesn't do anything 
> anymore.

The markup "(:toggle hide ...:)" is likely from the Toggle recipe which 
is maintained, see:

   https://www.pmwiki.org/wiki/Cookbook/Toggle

If by "It doesn't do anything" you mean "the (:toggle...:) markup is not 
processed but appears as is in the page" then probably the recipe Toggle 
was installed at some point and you still have old markup in your page - 
either install the recipe or remove the markup.

If you mean a "toggle button" appears but does nothing, then some typo 
may be in that page: read the Toggle documentation to check your markup: 
there may be a missing division block with id=box210.

Petko

> 
> I am using the latest Triad skin.
> 
> James
> 
> -----Original Message-----
> From: Petko Yotov <5ko at 5ko.fr>
> Sent: Thursday, December 13, 2018 4:06 PM
> To: Mikelis, James <James.Mikelis at Staples.com>
> Cc: pmwiki-users <pmwiki-users-bounces at pmichaud.com>
> Subject: Re: [pmwiki-users] pmwiki and Xampp
> 
> PmWiki and MarkupToHTML() work fine for me, I've been using both PHP
> 7.2 and 7.3 since the day they became available.
> 
> The page I suggested explains that MarkupToHTML() processes custom
> Markup rules added by addons. Some of your addons have rules that
> worked before PHP 5.5 or 7.2, they don't appear to work anymore.
> 
> Please try it -- disable all addons and skins, and report if you see
> any warnings. Then:
> 
> 1. Enable one addon (get its most recent version). If there are
> warnings, it needs work: disable the addon.
> 
> 2. If you have more addons you haven't tested, go back to 1.
> 
> 3. Please report which addons cause warnings, and we'll update them.
> 
> This is written in the Troubleshooting page I linked first, if it is
> not clear enough tell us and we'll work on the page.
> 
> Petko
> 
> P.S. Please make sure you updated pmwiki.php and all files in the
> scripts/ directory with their latest version (sometimes it happens
> that one or more of these files was not updated for some reason).
> 
> P.S. You should never need to modify PmWiki core files, everything is
> designed to be configurable and switchable so you don't lose your
> changes when you upgrade. If you have any difficulty please contact
> us.
> 
> 
> 
> On 13/12/2018 21:33, Mikelis, James wrote:
>> The main offender is in function MarkupToHTML in pmwiki.php. I tried
>> to convert it but cannot get it to work. I don't think this is an
>> addon.
>> 
>> I upgraded to the latest wiki and it works ok on php 5.4, but not the
>> latest PHP 7.2.12.
>> 
>> See below. Any help converting the function would be appreciated.
>> 
>> 
>> 
>> function MarkupToHTML($pagename, $text, $opt = NULL) {
>> 
>>   # convert wiki markup text to HTML output
>> 
>>   global $MarkupRules, $MarkupFrame, $MarkupFrameBase, $WikiWordCount,
>> 
>>     $K0, $K1, $RedoMarkupLine, $MarkupToHTML;
>> 
>>   $MarkupToHTML['pagename'] = $pagename;
>> 
>>   StopWatch('MarkupToHTML begin');
>> 
>>   array_unshift($MarkupFrame, array_merge($MarkupFrameBase,
>> (array)$opt));
>> 
>>   $MarkupFrame[0]['wwcount'] = $WikiWordCount;
>> 
>>   foreach((array)$text as $l)
>> 
>>     $lines[] = $MarkupFrame[0]['escape'] ? PVSE($l) : $l;
>> 
>>   $lines[] = '(:closeall:)';
>> 
>>   $out = '';
>> 
>>   while (count($lines)>0) {
>> 
>>     $x = array_shift($lines);
>> 
>>     $RedoMarkupLine=0;
>> 
>>     $markrules = BuildMarkupRules();
>> 
>>     foreach($markrules as $p=>$r) {
>> 
>>       list($r, $id) = (array)$r;
>> 
>>       $MarkupToHTML['markupid'] = $id;
>> 
>>       if ($p{0} == '/') {
>> 
>>         if (is_callable($r)) $x = preg_replace_callback($p,$r,$x);
>> 
>> 
>> 
>>       else $x=preg_replace($p,$r,$x); <--************
>> 
>> 
>> 
>>       }
>> 
>>                   elseif (strstr($x,$p)!==false) $x=eval($r);
>> 
>>       if (isset($php_errormsg))
>> 
>>         { echo "ERROR: pat=$p $php_errormsg"; unset($php_errormsg); }
>> 
>>       if ($RedoMarkupLine) { $lines=array_merge((array)$x,$lines);
>> continue 2; }
>> 
>>     }
>> 
>> 
>> 
>> James Mikelis
>> 
>> Principal  Technical Analyst | Staples Digital Solutions
>> 
>> Ph: 508.253.2016 * Fx: 508.253.7066 * 500 Staples Drive, Framingham,
>> MA
>> 01702
>> 
>> 
>> 
>> 
>> 
>> -----Original Message-----
>> From: Petko Yotov <5ko at 5ko.fr>
>> Sent: Thursday, December 13, 2018 3:13 PM
>> To: Mikelis, James <James.Mikelis at Staples.com>
>> Subject: Re: [pmwiki-users] pmwiki and Xampp
>> 
>> 
>> 
>> See the page
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pm
>> wiki.org%2FTroubleshooting&data=01%7C01%7CJames.Mikelis%40staples.
>> com%7C0435198fb30844f7926808d6613ed7b7%7Cb101f7ab56ac485fb3975279698fd
>> f7d%7C1&sdata=Nc4or9mtnwdlqGBTbgkI9j%2B0UvOg%2FJ03%2FmjzEf2A%2BAs%
>> 3D&reserved=0
>> 
>> 
>> 
>> Basically,
>> 
>> * disable all skins and addons,
>> 
>> * upgrade to the most recent PmWiki version (read release notes),
>> 
>> * get the most recent version of every addon/recipe/module/skin you
>> use (read release notes),
>> 
>> * enable the addons one after another to see what works.
>> 
>> 
>> 
>> If you have any difficulty please report. We are in the process of
>> fixing all addons for PHP 7, if you need some that are not fixed we'll
>> do them first. I already see in your warnings csstooltipstogo and
>> attachdel, if you need those and others we'll update them.
>> 
>> 
>> 
>> Petko
>> 
>> 
>> 
>> --
>> 
>> If you upgrade :
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pm
>> wiki.org%2FUpgrades&data=01%7C01%7CJames.Mikelis%40staples.com%7C0
>> 435198fb30844f7926808d6613ed7b7%7Cb101f7ab56ac485fb3975279698fdf7d%7C1
>> &sdata=y9lk%2BNh3SMgFZeSS%2FzjOuPLl85vLLHpsYgO5dpXrDNU%3D&rese
>> rved=0
>> 
>> 
>> 
>> 
>> 
>> On 13/12/2018 18:00, Mikelis, James wrote:
>> 
>>> I recently upgraded to the latest version of pmwiki I have running on
>> 
>>> a 5-year-old version of XAMPP.
>> 
>>> All worked fine until I tried installing the latest version of XAMPP
>> 
>>> because of PHP security holes in the old version XAMPP was running.
>> 
>>> However, the latest XAMPP containing PHP 7.* breaks my pmwiki with
>> 
>>> several errors during startup.
>> 
>>> 
>> 
>>> What can I do to resolve them? What is the supported version of PHP
>> 
>>> pmwiki runs on?  I am not sure what the below errors mean or how to
>> 
>>> fix them. Help would be appreciated. I get more than 100 of them
>> 
>>> during startup and my wiki does not work.
>> 
>>> Thanks. James
>> 
>>> 
>> 
>>> Deprecated: The each() function is deprecated. This message will be
>> 
>>> suppressed on further calls in
>> 
>>> C:\xampp\htdocs\pmwiki\cookbook\csstooltipstogo.php on line 93
>> 
>>> 
>> 
>>> Warning: preg_replace(): The /e modifier is no longer supported, use
>> 
>>> preg_replace_callback instead in C:\xampp\htdocs\pmwiki\pmwiki.php on
>> 
>>> line 1777
>> 
>>> 
>> 
>>> Warning: Cannot modify header information - headers already sent by
>> 
>>> (output started at C:\xampp\htdocs\pmwiki\pmwiki.php:1777) in
>> 
>>> C:\xampp\htdocs\pmwiki\pmwiki.php on line 1304
>> 
>>> 
>> 
>>> Warning: Use of undefined constant ATTACH_DELETE_VERSION - assumed
>> 
>>> 'ATTACH_DELETE_VERSION' (this will throw an Error in a future version
>> 
>>> of PHP) in C:\xampp\htdocs\pmwiki\cookbook\attachdel.php on line 34



More information about the pmwiki-users mailing list