Esempio n. 1
0
function page_profiler_test()
{
    prf_start("main");
    prf_start("sub");
    prf_start("sub3");
    sleep(1);
    prf_end();
    prf_end();
    prf_end();
    global $prf_root;
    echo "<pre>";
    print_r($prf_root);
    echo "</pre>";
    echo "<pre>" . prf_report() . "</pre>";
    die;
}
Esempio n. 2
0
File: bios.php Progetto: NazarK/sqp
function db_query($query)
{
    @prf_start("db_query");
    @prf_start(substr($query, 0, 20));
    global $db_query_error_function;
    $args = func_get_args();
    array_shift($args);
    if (isset($args[0]) and is_array($args[0])) {
        // 'All arguments in one array' syntax
        $args = $args[0];
    }
    db_query_callback($args, TRUE);
    if (mysql) {
        $query = db_sqlite2mysql_sql($query);
    }
    if ($query == "") {
        return;
    }
    $query = preg_replace_callback('/(%d|%s|%%|%f|%b)/', 'db_query_callback', $query);
    if (mysql) {
        $res = mysql_query($query);
        if (!$res) {
            $db_query_error_function("<h1>MYSQL ERROR</h1><br> {$query}<br>" . mysql_error());
        }
    }
    global $dbhandle;
    if (sqlite2) {
        $res = sqlite_query($dbhandle, $query);
        if ($res == FALSE) {
            $db_query_error_function("<h1>SQL ERROR</h1><br> {$query}<br>" . sqlite_error_string($dbhandle));
        }
    }
    if (sqlite3) {
        $res = $dbhandle->query($query);
        if ($res == FALSE) {
            $db_query_error_function("<h1>SQL ERROR</h1><br> {$query}<br>" . sqlite_error_string($dbhandle));
        }
    }
    if (pdo_sqlite) {
        $res = $dbhandle->query($query);
    }
    global $sqllog;
    $sqllog .= $query . "<br>";
    @prf_end();
    @prf_end();
    return $res;
}