RecipeCheck

(redirected from Cookbook.VersionChecker)

Summary: Check for new versions of recipes on pmwiki.org
Version: 20190903, pmwiki-2.3.37?
Prerequisites: pmwiki-2.1
Status: Stable
Maintainer: Petko (original author: Pm)
Users: +4 (View / Edit)

RecipeCheck was included in the core from Version 2.2.123 -- if you have this recipe already installed, you can simply comment it out from your config.php

Questions answered by this recipe

  • How can I find newer versions of recipes and skins I'm using?

Description

Over time, recipes and skins are updated to add new features or to keep up with changes to PmWiki. This page describes two methods for keeping up with changes to installed recipes.

Sites available on the public internet can use pmwiki.org's Site Analyzer page to check for newer versions of recipes, as well as diagnose other possible items.

For sites that are behind a firewall or cannot be accessed by pmwiki.org, the function adds ?action=recipecheck, which fetches a list of recipe versions from pmwiki.org and reports on any differences with locally installed recipes.

PmWiki 2.2.123 and newer already include this function. For PmWiki version 2.2.122 or older download recipecheck.phpΔ into the cookbook/ directory, and add the following line to a local customization file:
include_once('cookbook/recipecheck.php');

To use this recipe, invoke PmWiki using '?action=recipecheck'. By default this action is restricted to site administrators, so you will normally be prompted for the administrative password.

Notes

Not all cookbook recipes provide version information. Contact the recipe author or the pmwiki-users mailing list to see about adding recipe version information.

Unable to retrieve cookbook data from url
The recipecheck.php script currently requires that PHP be configured to allow "url fopens" to fetch pmwiki.org's recipe list. For security reasons many web hosting providers and PHP distributions have url fopens disabled or blocked by default. If this is the case, see if PHP's 'allow_url_fopen' setting can be enabled, or try the PmWiki.SiteAnalyzer approach.

Demonstration

See the report for this page on pmwiki.org:

Comments


Hello Pm,
This is a diff for my changes to RecipeCheck.php to make it work with the particularities of my system: ...removed for brevity. I hope this is of some use.

Feral March 30, 2007, at 07:50 AM

Yes, this is excellent -- thanks! Now applied to the 2007-04-17 version of the recipe. Pm April 17, 2007, at 04:13 PM

The '2007-04-17' version can be tripped up if a filename contains '.php' but such as that it is NOT the actual extension, such as my backups which tend to litter my cookbook directory ;)

Example:
  • feralformattedentry.php
  • feralformattedentry.php~
  • feralformattedentry.php.org

All of these will list and have the potential to muck stuff up.

(specifically I was getting the entry for a backup in my listing; The actual file (feralformattedentry.php) was correct but the backup was out of date; This was causing RecipeCheck to produce incorrect results (feralformattedentry.php was not out of date although it showed as such as the backup had an incorrect (all lower case) $RecipeInfo entry.)

This is simply fixed via: Line 95 in v2007-04-17:

if (!preg_match('/\\.php/i', $name)) continue;

In v2007-04-18 becomes,

if (!preg_match('/\\.php$/i', $name)) continue;

--Feral April 18, 2007, at 09:41 PM


Questions

If I get the message (for my intranet) what should I look for, eg PHP settings, etc

PmWiki can't process your request Unable to retrieve cookbook data from http://www.pmwiki.org/pmwiki/recipelist We are sorry for any inconvenience. Return to http://infostore:8080/pmwiki.php

Please see the Unable to retrieve cookbook data from url note above. -- Feral April 18, 2007, at 01:48 AM


Hi, I have struggled to get this through our corporate firewall, to no avail :-(

Would it be possible to have the check performed by a local file. ie. I download http://www.pmwiki.org/pmwiki/recipelist and save it to a txt file or similar and then "RecipeCheck" can compare from the txt file.

Regards Nigel


UPDATE

I have had success by downloading the recipelist and savinging it on locally available webserver. Then editing Line 44 of recipecheck.php to point to locally accessable file

SDV($RecipeListUrl, 'http://<local url>/1/recipelist.txt');

Regards Nigel


Indication of obsolete recipes

IDB 27-May-2009: I wonder if the RecipeCheck recipe can be updated to include a column or something to indicate if a recipe is obsolete? Maybe the information under the column 'pmwiki.org' for the obsolete recipe could have "Obsolete" instead of the old recipe version number?


Skins and RecipeCheck

IDB 27-May-2009: It says at the top of this page that the RecipeCheck recipe will check the skin version number. However, I have found this is not true. Is this a forthcoming feature, incorrect information on this page or is there a setting I haven't switched on?


See Also

Contributors

  • 20190903 : update for PHP 7.4 (Petko)
  • Pm

User notes +4: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.