コード例 #1
0
ファイル: someclass.php プロジェクト: qinlibingfeng/html
 function name()
 {
     set_include_path(get_include_path() . PATH_SEPARATOR . BASEPATH . 'libraries/inc');
     $aql = new aql();
     $aql->set('basedir', '/etc/asterisk/');
     $db = $aql->query("insert into t9.conf set callerid=\"'99' <99>\",section='555'");
     echo $aql->errstr;
     print_r($db);
     return 'name';
 }
コード例 #2
0
ファイル: t15.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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";
}
コード例 #3
0
ファイル: t2.php プロジェクト: nareshkhuriwal/asterisk-aql
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
    echo __LINE__ . ' ' . $a->get_error();
}
// very simple test query
$query = <<<EOF
select * from t2.conf where section = 9999
EOF;
// select * from t2.conf where section != 'general' and section != NULL
// select section,host,secret FROM t2.conf where section <= 9995 and section != 'general' and section != null limit 6,1
// select section,host,secret FROM t2.conf where section like '%99%' and section != 'general' and section != null limit 1
$result = $a->query($query);
if ($result == false) {
    echo $a->get_error();
} else {
    print_r($result);
}
echo "====================================================================================\n";
# very simple test query
$query = "select * from t2.conf where section != 'general' and section != NULL limit 1";
$result = $a->query($query);
if ($result == false) {
    echo $a->get_error();
} else {
    print_r($result);
}
echo "====================================================================================\n";
コード例 #4
0
ファイル: t10.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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 t10.conf set type='friend',section='8001',call-limit=1");
$result = $a->query("delete from t10.conf where section = '8001'");
if ($result == false) {
    echo $a->get_error();
} else {
    echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
コード例 #5
0
     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) {
                     echo str_repeat(' ',(18-3-strlen($section)));
                 } else {
                     " ";
                 }
コード例 #6
0
ファイル: t8.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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("alter table t8.conf add nat='yes' after('allow[1]') where section = 'general'");
if ($result == false) {
    echo $a->get_error();
} else {
    echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
コード例 #7
0
ファイル: t11.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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("alter table t11.conf drop abcdefg");
if ($result == false) {
    echo $a->get_error();
} else {
    echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
コード例 #8
0
ファイル: t5.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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();
}
// set manual commit
$a->autocommit = false;
$a->query("update t5.conf set call-limit = 1 where section = 8888");
$a->query("update t5.conf set call-limit = 1 where section = 9999");
$result = $a->commit('t5.conf');
if ($result == false) {
    echo $a->get_error();
} else {
    echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
コード例 #9
0
ファイル: t14.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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 t14.conf set callerid=\"'99' <99>\",section='555'");
if ($result == false) {
    echo $a->get_error();
} else {
    echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
コード例 #10
0
ファイル: t13.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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("alter table t13.conf drop allow[1]");
if ($result == false) {
    echo $a->get_error();
} else {
    echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
コード例 #11
0
ファイル: t6.php プロジェクト: nareshkhuriwal/asterisk-aql
<?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("alter table t6.conf drop setvar where section = 9997");
if ($result == false) {
    echo $a->get_error();
} else {
    echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}