Exemplo n.º 1
0
 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";
     echo "use       set basedir to load config.\n";
     echo "delete    query delete command.\n\n";
     echo "for more help see http://www.freeiris.org/astconfquerylanguage\n\n";
 } elseif ($input == 'quit') {
     exit;
 } elseif ($input == 'freedb') {
     $aql->free_database();
     echo "database freed.\n";
 } elseif (preg_match('/^(select|alter|update|insert|delete|use) /i',$input)) {
     $b1 = microtime(true);
     $result = $aql->query($input);
     $b2 = microtime(true);
     if (!$result) {
         echo $aql->get_error()."\n";
     } else {
         if (is_array($result)==true) {
             echo "+-----------------+-------------------------------\n";
             echo "+     SECTION     +\n";
             foreach ($result as $section => $dataref) {
                 echo "+-----------------+-------------------------------\n";
                 echo "+  $section";
                 if (strlen($section) <= 14) {