當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BoincDb::error方法代碼示例

本文整理匯總了PHP中BoincDb::error方法的典型用法代碼示例。如果您正苦於以下問題:PHP BoincDb::error方法的具體用法?PHP BoincDb::error怎麽用?PHP BoincDb::error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BoincDb的用法示例。


在下文中一共展示了BoincDb::error方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: show_error

function show_error($str)
{
    page_head("Can't create account");
    echo "{$str}<br>\n";
    echo BoincDb::error();
    echo "<p>Click your browser's <b>Back</b> button to try again.\n<p>\n";
    page_tail();
    exit;
}
開發者ID:nicolas17,項目名稱:boincgit-test,代碼行數:9,代碼來源:openid_login.php

示例2: create_batch

function create_batch($r)
{
    xml_start_tag("create_batch");
    $app = get_submit_app((string) $r->batch->app_name);
    list($user, $user_submit) = authenticate_user($r, $app);
    $now = time();
    $batch_name = (string) $r->batch->batch_name;
    $batch_name = BoincDb::escape_string($batch_name);
    $expire_time = (double) $r->expire_time;
    $batch_id = BoincBatch::insert("(user_id, create_time, name, app_id, state, expire_time) values ({$user->id}, {$now}, '{$batch_name}', {$app->id}, " . BATCH_STATE_INIT . ", {$expire_time})");
    if (!$batch_id) {
        xml_error(-1, "BOINC server: Can't create batch: " . BoincDb::error());
    }
    echo "<batch_id>{$batch_id}</batch_id>\n        </create_batch>\n    ";
}
開發者ID:brevilo,項目名稱:boinc,代碼行數:15,代碼來源:submit_rpc_handler.php

示例3: lookup_team

    } else {
        $team = lookup_team($teamid);
        if ($team && $team->joinable) {
            user_join_team($team, $user);
        }
    }
}
if ($venue) {
    $query .= " venue='{$venue}', ";
}
if ($email_addr && $email_addr != $user->email_addr) {
    $old_email_addr = $user->email_addr;
    $query .= " email_addr='{$email_addr}', ";
}
if ($password_hash) {
    $query .= " passwd_hash='{$password_hash}', ";
}
if (strlen($query)) {
    // the seti_id=seti_id is to make the query valid,
    // since $query ends with a comma at this point
    //
    $query = "{$query} seti_id=seti_id";
    $result = $user->update($query);
    if ($result) {
        success("");
    } else {
        xml_error(-1, "database error: " . BoincDb::error());
    }
} else {
    success("");
}
開發者ID:nicolas17,項目名稱:boincgit-test,代碼行數:31,代碼來源:am_set_info.php

示例4: upload_files

function upload_files($r)
{
    xml_start_tag("upload_files");
    list($user, $user_submit) = authenticate_user($r, null);
    $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
    $delete_time = (int) $r->delete_time;
    $batch_id = (int) $r->batch_id;
    //print_r($_FILES);
    $i = 0;
    foreach ($r->md5 as $f) {
        $md5 = (string) $f;
        $name = "file_{$i}";
        $tmp_name = $_FILES[$name]['tmp_name'];
        if (!is_uploaded_file($tmp_name)) {
            xml_error(-1, "{$tmp_name} is not an uploaded file");
        }
        $fname = job_file_name($md5);
        $path = dir_hier_path($fname, project_dir() . "/download", $fanout);
        rename($tmp_name, $path);
        $now = time();
        $jf_id = BoincJobFile::insert("(md5, create_time, delete_time) values ('{$md5}', {$now}, {$delete_time})");
        if (!$jf_id) {
            xml_error(-1, "upload_files(): BoincJobFile::insert({$md5}) failed: " . BoincDb::error());
        }
        if ($batch_id) {
            BoincBatchFileAssoc::insert("(batch_id, job_file_id) values ({$batch_id}, {$jf_id})");
        }
        $i++;
    }
    echo "<success/>\n        </upload_files>\n    ";
}
開發者ID:gchilders,項目名稱:boinc,代碼行數:31,代碼來源:job_file.php

示例5: insert_case

function insert_case($t, $user)
{
    global $master_url;
    global $dry_run;
    if ($dry_run) {
        if (!$user) {
            echo "   making user {$t->user_email}\n";
        }
        echo "   making team {$t->name}\n";
        return;
    }
    if (!$user) {
        echo "   making user {$t->user_email}\n";
        $user = make_user($t->user_email, $t->user_name, random_string());
        if (!$user) {
            echo "   Can't make user {$t->user_email}\n";
            return;
        }
    }
    echo "   making team {$t->name}\n";
    $team = make_team($user->id, $t->name, $t->url, $t->type, $t->name_html, $t->description, $t->country);
    if (!$team) {
        echo "   Can't make team {$t->id}\n";
        echo BoincDb::error();
        echo "\n";
        exit;
    }
    $team->update("seti_id={$t->id}");
    $user->update("teamid={$team->id}");
    send_email($user, "Team created on " . PROJECT, "An instance of the BOINC-wide team '{$t->name}'\nhas been created on the project:\nname: " . PROJECT . "\nURL: {$master_url}\n");
}
開發者ID:ChristianBeer,項目名稱:boinc,代碼行數:31,代碼來源:team_import.php


注:本文中的BoincDb::error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。