Wi Phiki

Another ShortestWikiContest contender, heavily influenced by SigWik. Written to prove that also PHP can be as short and unreadable as Perl.

289 chars of PHP and Shell on 4 lines.

Features

Quick instructions

  1. Save the code e.g. as wiphiki.php
  2. chmod the directory 0777
  3. Start the built-in PHP server
  4. Navigate to localhost:8000/HomePage to get started.

Code

 <?$p=$_SERVER[PHP_SELF];$e=htmlentities($_GET[t]);if($e)`echo "$e">.$p`
 &header("Location:$p");$n=`cat .$p`;echo preg_replace('~htt\S+|([A-Z]\w+){2,}~'
 ,'<a href=$0>$0</a>',`ls -t|head`."<hr><h1>$p</h1><pre>$n"),"<form action=.$p>
 <input type=submit>\n<textarea name=t cols=80 rows=16>$n";
Command to start the PHP built-in webserver
 $ php -d error_reporting=0 -d short_open_tag=On -S localhost:8000 wiphiki.php

License

WiPhiki is licensed under the terms and conditions of the MIT License - http://opensource.org/licenses/mit-license

The author of the original WiPhiki code is Smasty (http://smasty.net).
CategoryWikiImplementation

EditText of this page (last edited July 14, 2012) or FindPage with title or text search