Exemplo n.º 1
0
$base_dir = $_SERVER['argv'][1];

if (!is_dir($base_dir)) {
    echo "AQLCLI : sorry can't find basedir\n";
    exit;
}

$aql = new aql();
if (!$aql->set('basedir',$base_dir)) {
    echo "AQLCLI : ".$aql->get_error()."\n";
    exit;
}

echo "Welcome to the AQL command line interface.  Commands end pass Enter key\n";
echo "Your AQL Library version : ".$aql->get_version()." ,   AQL_Confparser Version : ".aql_confparser::get_version()."\n\n";
echo "type 'help' for help.\n\n";

while(1) {
    echo "AQLcli>";
    $input = fgets(STDIN);
    $input = trim($input);
    if ($input == 'help') {
        echo "List of all Interface commands : \n\n";
        echo "help      Display this help.\n";
        echo "quit      Quit AQLcli.\n";
        echo "freedb   free cached config file\n";
        echo "select    query select command.\n";
        echo "alter    query alter command.\n";
        echo "update    query update command.\n";
        echo "insert    query insert command.\n";