Ejemplo n.º 1
0
function qa_db_blob_create($content, $format, $filename = null, $userid = null, $cookieid = null, $ip = null)
{
    for ($attempt = 0; $attempt < 10; $attempt++) {
        $blobid = qa_db_random_bigint();
        if (qa_db_blob_exists($blobid)) {
            continue;
        }
        qa_db_query_sub('INSERT INTO ^blobs (blobid, format, content, filename, userid, cookieid, createip, created) VALUES (#, $, $, $, $, #, INET_ATON($), NOW())', $blobid, $format, $content, $filename, $userid, $cookieid, $ip);
        return $blobid;
    }
    return null;
}
Ejemplo n.º 2
0
function qa_db_blob_create($content, $format, $sourcefilename = null, $userid = null, $cookieid = null, $ip = null)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    for ($attempt = 0; $attempt < 10; $attempt++) {
        $blobid = qa_db_random_bigint();
        if (qa_db_blob_exists($blobid)) {
            continue;
        }
        qa_db_query_sub('INSERT INTO ^blobs (blobid, format, content, filename, userid, cookieid, createip, created) VALUES (#, $, $, $, $, #, INET_ATON($), NOW())', $blobid, $format, $content, $sourcefilename, $userid, $cookieid, $ip);
        return $blobid;
    }
    return null;
}
Ejemplo n.º 3
0
function qa_blob_exists($blobid)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    require_once QA_INCLUDE_DIR . 'db/blobs.php';
    return qa_db_blob_exists($blobid);
}