WhiteCrane Console

WhiteCrane has a minimal console interface built in for running cron jobs, benchmarking and debugging among many other things.
The console interface is enabled by default and may become a security risk if run over CGI(modern web servers now use fastCGI over
a socket connection and are safe).

Using the interface is simple. $argv[1] is used for console mode detection and the argument "console" must be passed to enable this mode.
In console mode there is no html output besides that of evoked html mode functions. Below is an example of how to invoke the console interface and
have it dump a list of pages from Index().

$ php index.php console index
 
# Mr CLI 
# Copyright 2009 Ameoto Systems. All Rights Reserved. 
# Written by TheTooth, thetooth[at]ameoto.com 
 
Session: 032ca61c1321c65fe9b44bc1fe6a631cc0e6ca55
 
Array parent Index() 
   Array
   ( 
   [0] => .svn
   [1] => home.txt
   [2] => syntax.txt
   ) 
 
SAFE EXIT 0

There are many predefined functions available but if you need to run a line of code remotely you can use the argument "input" which will allow you to
eval a line of php within the local console environment. Also if you want to run batch jobs you may use the 'batch' argument to have it include a
custom script for execution e.g.

$ php index.php console batch /var/www/dev/batchjob1.php

In addition there are a few console modes. "console" for basic I/O with banner on run, "s-console" for basic I/O without banner or console
output(safe exit message remains) and "r-console" which will repeat the set mode 1,000 times before exiting automatically, this is useful for
benchmarks and memory tests only, be careful using it or your host is going to be pissed.

List of argv[2] modes:

+