[pmwiki-users] Rethinking $RecipeInfo (was: Keeping recipes up to date)

Patrick R. Michaud pmichaud at pobox.com
Thu Feb 15 13:52:59 CST 2007


On Thu, Feb 15, 2007 at 08:40:39PM +0100, Dominique Faure wrote:
> >It's relatively easy to scan the files in cookbook/ for
> >strings matching a given pattern, so perhaps we just
> >need a way of specifying recipe information in the comments
> >of script files.  Perhaps something as simple as...?
> >
> >    # RecipeInfo: Name=RandomQuotes Version=2007-02-15
> >
> From the parsing point of view, I don't see any real difference between:
> 
>  # RecipeInfo: Name=RandomQuotes Version=2007-02-15
> 
> and:
> 
>  $RecipeInfo['RandomQuotes']['Version']='2007-02-15';

Except that we can also expect things like:

    SDV($RecipeInfo['RandomQuotes']['Version'], '2007-02-15');

and

    SDVA($RecipeInfo['RandomQuotes'], array(
       'Version' => '2007-02-15',
       'url' => 'http://www.example.org/recipes/RandomQuotes'
       ));

or even

    $RandomQuotesVersion = '2007-02-15';
    SDV($RecipeInfo['RandomQuotes']['Version'], $RandomQuotesVersion);

If we're willing to restrict recipe authors to one or two specific 
syntaxes for setting $RecipeInfo, then perhaps we can live with parsing
assignment statements as opposed to looking inside of comments.

I do think it's preferable that recipes be able to use SDV() 
to set $RecipeInfo instead of always forcing a value.  Using 
SDV() allows an administrator (or possibly another recipe) to
easily override the recipe's understanding of its version.

But I think we may still want to parse skin templates for 
$RecipeInfo, and that is probably better done with

   <!--RecipeInfo: Name=XYZSkin Version=2007-02-15-->

and not

   <!--$RecipeInfo['XYZSkin']['Version'] = '2007-02-15'-->

as the latter is likely to confuse the heck out of everyone.

Pm



More information about the pmwiki-users mailing list