SourceHistory
Questions answered by this recipe
- 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.
- Download and copy sourceblock.phpΔ to the cookbook/ directory.
- Download and copy sourcehistory.phpΔ to the cookbook/ directory.
- Download and unpack GeSHi distribution to a newly created cookbook/geshi directory.
- 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
Contributors
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.