Or, you can write in your recipe page your requirement that it depends on
php 5.3 or above.
Currently the PmWiki core does not restrict you at all to use closures in
your recipes. You can have them, they will only work on PHP 5.3+ sites.
Petko
John Rankin writes:
Classes and callbacks have changes in different PHP versions so it may be
tricky to write one that is compatible with PHP 4.2 to 5.5. But not
impossible.
I'd like to ask a follow-up about using preg_replace_callback with the
anonymous functions capability (closures) provided from php 5.3 onwards; for
example:
function ($match) use ($pagename) { ... }
While I understand the rationale for supporting older versions of php, is
this necessarily the best strategy?
Mac OS X Leopard (10.5) on my PowerPC mac runs php 5.2. Snow Leopard (10.6)
runs php 5.3. Presumably Lion, Mountain Lion and Mavericks run later php
versions. Ubuntu 12.04 LTS runs php 5.3 and I think 14.04 LTS will ship with
php 5.5.
I wonder whether consideration should be given to renaming pmwiki 2.2.56 as
pmwiki 2.5.1, with a requirement that it depends on php 5.3 or above. Those
running an older version of php would need to run 2.2.55 or below.
Similarly, existing cookbook recipes would continue to work with php 5.4 or
below, but new versions which are compatible with php 5.5 and above could be
progressively added.
I can see arguments for and against this approach, but in my case access to
the 'use' keyword to pass parameters is very attractive. Php 5.2 has not
been officially supported since 2011-01-06 and php 5.3 was released in
2009-06-30 with support until 2014-07.
Thoughts? Any idea what proportion of installations are running pmwiki on
php 5.2 or below? Any idea how many of these are planning to upgrade to
pmwiki 2.2.56 or above?
_______________________________________________
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users