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 ?
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.
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:
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.
Once installed, add markup at the top and the end of your code:
(:sourcehistory lang=php linenum:)
your php code
This receipe can be seen or tested on www.chefdesventes.org. (In order to avoid hack or spam, ask there for your password.)
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.
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".