当前位置: 首页>>代码示例>>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;未经允许,请勿转载。