[pmwiki-users] Recipe comments

Petko Yotov 5ko at 5ko.fr
Sat Apr 5 13:50:22 CDT 2014


Vince Administration writes:
> Is there a recommended style for recipe configuration comments, especially  
> in the files themselves?

No.

>
> Example:
> There is the $RecipeInfo array, but this seems at present to contain just  
> the Version tag.
> Is there a recommended way to include  a requires line for a pmwiki version,  
> or another recipe?


Something like this may work for you (not required, but possible):

  if ($VersionNum< 2002062) {
    Abort("Recipe requires PmWiki 2.2.62 or newer.");
  }
  if (floatval(phpversion())<5.3) {
    Abort("Recipe requires PHP 5.3 or newer.");
  }

  if (file_exists("$FarmD/cookbook/another-recipe.php")) {
    include_once("$FarmD/cookbook/another-recipe.php");
  }
  else {
    Abort("Recipe requires AnotherRecipe.");
  }

> Or does this just belong in the documentation page in the wiki, or the talk  
> page?

It definitely belongs to the recipe page. There is a header line  
"Prerequisites", and sections "Install" and "Notes" (all optional).

> As an example,  am about to upload a new version of UpdateForm, which will  
> be compatible with php5.whatever, but if so require pmwikii version ….
> This can of course all be made clear on the documentation page, but even   
> with this, is there a preferred format?

There is no preferred format or any obligation, use what you think will be  
easier for people to notice and to understand.

Petko




More information about the pmwiki-users mailing list