<?php /* * This is Test demo script for AQL */ error_reporting(E_ALL); require "../inc/aql.php"; $a = new aql(); $a->open_config_file('t3.conf'); $a->assign_editkey('general', 'allow[1]', 'g722'); if (!$a->save_config_file('t3.conf')) { echo $a->get_error(); } else { echo "changed sections: \n"; print_r($a->last_save_changed_sections); echo "changed filename: " . $a->last_save_changed_filename . "\n"; }
<?php /* * This is Test demo script for AQL */ error_reporting(E_ALL); require "../inc/aql.php"; $a = new aql(); $setok = $a->set('basedir', './'); if (!$setok) { echo __LINE__ . ' ' . $a->get_error(); } $result = $a->query("insert into t15.conf set callerid=\"\\\"99\\\" <99>\",section='" . time() . "'"); if ($result == false) { echo $a->get_error(); } else { echo 'affected_rows :' . $a->get_affected_rows() . "\n"; }
/* * this is demo command line interface of aql library */ ini_set ('memory_limit', '128M'); require(dirname(__FILE__)."/inc/aql.php"); $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";