当前位置: 首页>>代码示例>>PHP>>正文


PHP client::setbank方法代码示例

本文整理汇总了PHP中client::setbank方法的典型用法代码示例。如果您正苦于以下问题:PHP client::setbank方法的具体用法?PHP client::setbank怎么用?PHP client::setbank使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在client的用法示例。


在下文中一共展示了client::setbank方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

$user = $users[$usernum];
$err = $client->login($user['passphrase']);
if ($err) {
    echo "Error logging in as user {$usernum}: {$err}\n";
} else {
    echo "Logged in as user {$usernum}\n";
    $banks = $client->getbanks(true);
    if (is_string($banks)) {
        echo "Error getting banks: {$banks}\n";
    } elseif (count($banks) > 0) {
        $bank = false;
        foreach ($banks as $bank) {
            break;
        }
        $bankid = $bank[$t->BANKID];
        $err = $client->setbank($bankid);
        if ($err) {
            echo "Error setting bank to {$bankid} for user {$usernum}: {$err}\n";
        } else {
            "Set bank for user {$usernum} to {$bankid}\n";
        }
    } else {
        echo "No bank for user {$usernum}\n";
    }
}
// Command loop
while (true) {
    $id = $client->current_user();
    if ($id) {
        foreach ($users as $user) {
            if ($user['id'] == $id) {
开发者ID:billstclair,项目名称:trubanc,代码行数:31,代码来源:clientest.php

示例2: doit


//.........这里部分代码省略.........
            $t = $server->t;
            $bankid = $server->bankid();
            $tokenid = $server->tokenid;
            if (file_exists('client/settings.php')) {
                require_once "client/settings.php";
            }
            $dbdir = "client/{$dbdir}";
            $template_file = "client/{$template_file}";
            $error = die_unless_client_properly_configured(true);
            if (!$error) {
                require_once "lib/client.php";
                $clientdb = new fsdb("{$dbdir}");
                $client = new client($clientdb, $ssl);
                if ($enabledebug) {
                    $client->showprocess = 'appenddebug';
                }
                $hash = $client->passphrasehash($passphrase);
                if (!$clientdb->get("privkey/{$hash}")) {
                    // Create the new account
                    $error = $client->newuser($passphrase);
                } else {
                    $error = $client->login($passphrase);
                }
                if (!$error) {
                    $id = $client->id;
                    if ($clientdb->get("account/{$id}/bank/{$bankid}/req")) {
                        $error = 'Account already exists for that passphrase. ' . 'Use the <a href="client/">client interface</a> to administer.';
                    } else {
                        $error = $client->login($bankpass);
                        if (!$error) {
                            $error = $client->addbank($bankurl);
                        }
                        if (!$error) {
                            $error = $client->setbank($bankid);
                        }
                        if (!$error) {
                            $error = $client->spend($id, $tokenid, "10000");
                        }
                        if ($error) {
                            $error = "While spending tokens from bank: {$error}";
                        }
                    }
                    if (!$error) {
                        $error = $client->login($passphrase);
                        if (!$error) {
                            $error = $client->addbank($bankurl, $name);
                        }
                        if (!$error) {
                            ?>
<p>Your bank is now ready for business. You may now login as administrator in the
<a href="client/">Client interface</a>, accept your initial tokens from
the bank, and start inviting customers.</p>
<?php 
                            return;
                        }
                    }
                }
            }
        }
    }
    if (!$error) {
        $error = "&nbsp;";
    }
    if ($drawadmin) {
        ?>
<p>Congratulations! You have succesfully initialized your bank.</p>
开发者ID:billstclair,项目名称:trubanc,代码行数:67,代码来源:bankinit.php


注:本文中的client::setbank方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。