SourceHistory

Summary: Web php programming abilities from computers without any editor installed
Version: 0.1 2008-12-07
Prerequisites: pmwiki 2.0 with
Status: beta
Maintainer: lionel.a

Questions answered by this recipe

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer.

  • Is there an easy way to follow the code history of a program, and to save changes in an updated .php file out of wiki format ?
  • Is it possible for a separated member team to code php programs under a pmwiki application ?

Description

SourceHistory provides web php programming abilities from computers without any editor installed (in order to target new EEE-computers and cybercafes).

SourceHistory allows several programmers to work together as on a wiki, but the result is php files in addition of the wiki.

Some functions would seem to be kind of a CVS.

Comments, categories and php program code can be set on the same wiki page, but only the code in sourcehistory quotes will be written on a separated file.

Installing instructions

Install first SourceBlock.

  1. Download and copy sourceblock.phpΔ to the cookbook/ directory.
  2. Download and copy sourcehistory.phpΔ to the cookbook/ directory.
  3. Download and unpack GeSHi distribution to a newly created cookbook/geshi directory.
  4. Enable the recipe in your local/config.php file with:
    include_once("$FarmD/cookbook/sourceblock.php"); include_once("$FarmD/cookbook/sourcehistory.php");

All changed php files are located into /prog/ directory, but this can be change into a /core/ directory (or another one). Just modify the sourcehistory.php file :

  $filename = "prog/$standardname.inc.php"; in $filename = "core/$standardname.inc.php";

Also, the php files are named : for a MyFileName wiki name page, my_file_name.inc.php will be the php file, but this can easily be changed by editing few php lines in sourcehistory.php.

Markup

Once installed, add markup at the top and the end of your code:

(:sourcehistory lang=php linenum:)

your php code

(:sourceend:)

Example

This receipe can be seen or tested on www.chefdesventes.org. (In order to avoid hack or spam, ask there for your password.)

Notes

This is a beta release : now, each time the wikipage/file is edited then the new version is updated, even if it is a preview. This is a minor bug, because the right release is always updated from the wiki history.

This could be fix if $mylastmodified = PageVar($pagename, '$LastModified'); works.

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

Contributors

lionel.a

Comments

User notes? : 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.