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


PHP curlCall函数代码示例

本文整理汇总了PHP中curlCall函数的典型用法代码示例。如果您正苦于以下问题:PHP curlCall函数的具体用法?PHP curlCall怎么用?PHP curlCall使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = curlCall($this->_apiURL . '/tmp_api?address=' . $this->_btcaddess);
         // Offline Check
         if (empty($poolData)) {
             return;
         }
         // Data Order
         $data['type'] = $this->_type;
         $data['sent'] = $poolData['balances']['sent'];
         $data['balance'] = $poolData['balances']['confirmed'];
         $data['unconfirmed_balance'] = number_format($poolData['balances']['unconverted'], 8);
         $data['hashrate'] = formatHashrate($poolData['hash_rate'] / 1000);
         $activeWorkers = 0;
         foreach ($poolData['worker_hashrates'] as $worker) {
             if ($worker['hashrate'] != 0) {
                 $activeWorkers++;
                 continue;
             }
         }
         $data['active_worker(s)'] = $activeWorkers;
         $data['url'] = $this->_apiURL;
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:29,代码来源:wafflepool.php

示例2: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = array();
         foreach ($this->_actions as $action) {
             $poolData[$action] = curlCall($this->_apiURL . '/' . $action);
         }
         // Offline Check
         if (empty($poolData[$this->_actions[0]])) {
             return;
         }
         // Data Order
         $data['type'] = $this->_type;
         $data['coin'] = $poolData['web/currency_info']['symbol'];
         $data['balance'] = number_format($poolData['current_payouts'][$this->_addess], 8);
         $data['user_hashrate'] = formatHashrate($poolData['local_stats']['miner_hash_rates'][$this->_addess] / 1000);
         $data['pool_hashrate'] = formatHashrate($poolData['global_stats']['pool_nonstale_hash_rate'] / 1000);
         $data['pool_uptime'] = formatTimeElapsed($poolData['local_stats']['uptime']);
         $data['pool_fee'] = $poolData['local_stats']['fee'] . '%';
         $data['peers_in'] = $poolData['local_stats']['peers']['incoming'];
         $data['peers_out'] = $poolData['local_stats']['peers']['outgoing'];
         $data['url'] = $this->_apiURL;
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:28,代码来源:p2pool.php

示例3: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = array();
         $poolData = curlCall($this->_apiURL . '?accountId=' . $this->_userId);
         // Offline Check
         if (empty($poolData)) {
             return;
         }
         // Data Order
         $data['type'] = $this->_type;
         $data['sent'] = $poolData['miner']['totalEarned'];
         $data['unconfirmed_balance'] = $poolData['miner']['unconfirmedPayouts'];
         $data['user_capacity'] = formatCapacity($poolData['miner']['estimatedCapacity'] * 1000000);
         $data['pool_capacity'] = formatCapacity($poolData['pool']['estimatedCapacity'] * 1000000);
         $data['pool_miners'] = $poolData['pool']['totalMiners'];
         $data['current_block'] = $poolData['current']['block'];
         $data['nonces_submitted'] = $poolData['current']['noncesSubmitted'];
         $data['best_deadline'] = formatTimeElapsed($poolData['current']['bestDeadline']);
         $data['round_duration'] = formatTimeElapsed(time() - $poolData['current']['timeBlockStarted']);
         $data['pool_blocks_won'] = $poolData['pool']['blocksWon'];
         $data['url'] = "http://burst.ninja";
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:28,代码来源:burstninja.php

示例4: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = array();
         $poolData['user'] = curlCall($this->_apiURL . '/index.php?k=api&json=y&username=' . $this->_userId . '&api=' . $this->_apiKey);
         $poolData['workers'] = curlCall($this->_apiURL . '/index.php?k=api&json=y&work=y&username=' . $this->_userId . '&api=' . $this->_apiKey);
         // Offline Check
         if (empty($poolData['user']) || empty($poolData['workers'])) {
             return;
         }
         // Data Order
         $data['type'] = $this->_type;
         $data['user_hashrate'] = formatHashrate($poolData['user']['u_hashrate5m'] / 1000);
         $data['pool_hashrate'] = formatHashrate($poolData['user']['p_hashrate5m'] / 1000);
         for ($i = 0; $poolData['workers']['rows'] > $i; $i++) {
             $data[$poolData['workers']['workername:' . $i]] = formatHashrate($poolData['workers']['w_hashrate5m:' . $i] / 1000);
         }
         $data['workers'] = $poolData['workers']['rows'];
         $data['round_duration'] = formatTimeElapsed(time() - $poolData['user']['lastblock']);
         $data['url'] = $this->_apiURL;
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:26,代码来源:ckpool.php

示例5: pushover_ticket_reply

function pushover_ticket_reply($vars)
{
    $ticketid = $vars['ticketid'];
    $userid = $vars['userid'];
    $deptid = $vars['deptid'];
    $deptname = $vars['deptname'];
    $subject = $vars['subject'];
    $message = $vars['message'];
    $priority = $vars['priority'];
    // Convert HTML entities (single/double quote) back to single or double quote
    $message = htmlspecialchars_decode($message, ENT_QUOTES);
    $pushover_userkey = po_get_userkey();
    if (!$pushover_userkey) {
        return false;
    }
    $po_ticket_url = po_get_admin_ticket_url($ticketid);
    $pushover_api_url = 'https://api.pushover.net/1/messages.json';
    $pushover_app_token = 'a7HcPjJeGmAtyG4e6tCYqyXk5wc5Xj';
    $pushover_title = '[Ticket ID: ' . $ticketid . '] New Support Ticket Response';
    $pushover_url = $po_ticket_url;
    $pushover_url_title = "Open Admin Area to View Ticket";
    $pushover_message = $message;
    $pushover_post_fields = array('token' => $pushover_app_token, 'user' => $pushover_userkey, 'title' => $pushover_title, 'message' => $pushover_message, 'url' => $pushover_url, 'url_title' => $pushover_url_title, 'priority' => 1);
    // Convert to URL-Encoded string to post as application/x-www-form-urlencoded
    $pushover_encoded_post_fields = http_build_query($pushover_post_fields);
    $pushover_resp = curlCall($pushover_api_url, $pushover_encoded_post_fields, $pushover_options);
    $parsed_resp = json_decode($pushover_resp, true);
    if ($parsed_resp['status'] != 1) {
        logModuleCall('pushover', 'pushover_server_error', $pushover_post_fields, $pushover_resp);
    }
    logModuleCall('pushover', 'hook_ticket_open', $pushover_post_fields, $pushover_resp);
}
开发者ID:eunarede,项目名称:whmcs-pushover,代码行数:32,代码来源:hooks.php

示例6: widget_whmcs_news

function widget_whmcs_news($vars)
{
    global $whmcs, $_ADMINLANG;
    $title = $_ADMINLANG['home']['whmcsnewsfeed'];
    if ($whmcs->get_req_var('getwhmcsnews')) {
        if (!function_exists("ticketAutoHyperlinks")) {
            require ROOTDIR . '/includes/ticketfunctions.php';
        }
        $feed = curlCall('http://www.whmcs.com/feeds/news.php', '');
        $feed = json_decode($feed, 1);
        echo '<div style="float:right;margin:15px 15px 10px 10px;padding:8px 20px;text-align:center;background-color:#FDF8E1;border:1px dashed #FADA5A;-moz-border-radius: 5px;-webkit-border-radius: 5px;-o-border-radius: 5px;border-radius: 5px;">Follow Us<br /><a href="http://twitter.com/whmcs" target="_blank" style="font-size:16px;color:#D9AE06;">@whmcs</a></div>';
        $i = 0;
        foreach ($feed as $news) {
            echo '<div style="padding-top:5px;font-size:14px;' . ($i == 0 ? 'border-top:1px dashed #ccc;' : '') . '">' . ($news['link'] ? '<a href="' . $news['link'] . '" target="_blank">' : '') . $news['headline'] . ($news['link'] ? '</a>' : '') . '</div>
<div style="padding:5px;">' . $news['text'] . '</div>
<div style="font-size:10px;font-weight:bold;padding-bottom:5px;border-bottom:1px dashed #ccc;">' . date("l, F jS, Y", strtotime($news['date'])) . '</div>
';
            $i++;
        }
        exit;
    }
    $content = '<div id="whmcsnewsfeed" style="max-height:130px;">' . $vars['loading'] . '</div>';
    $jquerycode = '$.post("index.php", { getwhmcsnews: 1 },
    function(data){
        jQuery("#whmcsnewsfeed").html(data);
    });';
    return array('title' => $title, 'content' => $content, 'jquerycode' => $jquerycode);
}
开发者ID:carriercomm,项目名称:whmcs-5,代码行数:28,代码来源:whmcs_news.php

示例7: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData['global'] = curlCall($this->_apiURL . '/api/pool/stats');
         $poolData['user'] = curlCall($this->_apiURL . '/api/users/' . $this->_userId . '?key=' . $this->_apiKey);
         // Offline Check
         if (empty($poolData['global']) || empty($poolData['user'])) {
             return;
         }
         // Payout Information
         $data['type'] = $this->_type;
         // Balances?
         $data['btc_balance'] = number_format($poolData['user']['balances']['BTC'], 8);
         $data['nmc_balance'] = number_format($poolData['user']['balances']['NMC'], 8);
         $data['user_hashrate'] = formatHashRate($poolData['user']['hash_rate'] * 1000);
         $data['network_hashrate'] = formatHashRate($poolData['global']['hash_rate'] * 1000000);
         $data['workers'] = $poolData['user']['active_workers'];
         $data['round_duration'] = formatTimeElapsed($poolData['user']['now'] - $poolData['user']['round_start']['BTC']);
         $data['username'] = $poolData['user']['name'];
         $data['url'] = $this->_apiURL;
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:26,代码来源:bitminter.php

示例8: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = array();
         foreach ($this->_actions as $action) {
             $nonce = number_format(time() * mt_rand(), 0, '', '');
             $hmacSig = strtoupper(hash_hmac('sha256', $this->_userId . $this->_apiKey . $nonce, $this->_apiSecret));
             $postParams = http_build_query(array('key' => $this->_apiKey, 'nonce' => $nonce, 'signature' => $hmacSig));
             $poolData[$action] = curlCall($this->_apiURL . '/api/' . $action . '.htm', $postParams, 'application/x-www-form-urlencoded', array('key' => $this->_apiKey, 'sig' => $hmacSig));
             $poolData[$action] = $poolData[$action]['data'];
         }
         // Offline Check
         if (empty($poolData[$this->_actions[0]])) {
             return;
         }
         // Data Order
         $data['type'] = $this->_type;
         $data['sent'] = number_format($poolData['account']['paidOut'], 8);
         $data['balance'] = number_format($poolData['account']['balance'], 8);
         $data['current_earnings'] = number_format($poolData['account']['earnTotal'], 8);
         $data['pool_hashrate'] = formatHashrate($poolData['poolStats']['poolHashrate'] * 1000);
         // User Hashrate
         $data['user_hashrate_(1_day)'] = formatHashrate($poolData['hashrate']['last1d'] * 1000);
         $data['user_hashrate_(1_hour)'] = formatHashrate($poolData['hashrate']['last1h'] * 1000);
         $data['user_hashrate_(10_minutes)'] = formatHashrate($poolData['hashrate']['last10m'] * 1000);
         $data['eta_on_block'] = formatTimeElapsed($poolData['poolStats']['estimateTime']);
         $data['url'] = $this->_apiURL;
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:33,代码来源:antpool.php

示例9: update

 public function update()
 {
     if ($CACHED == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = array();
         $poolData['global'] = curlCall($this->_apiURL . '/stats/json/' . $this->_apiKey);
         $poolData['user'] = curlCall($this->_apiURL . '/accounts/profile/json/' . $this->_apiKey);
         // Offline Check
         if (empty($poolData['global']) || empty($poolData['user'])) {
             return;
         }
         $data = array();
         $data['type'] = $this->_type;
         $data['confirmed_balance'] = $poolData['user']['confirmed_reward'];
         $data['unconfirmed_balance'] = $poolData['user']['unconfirmed_reward'];
         $data['estimated_balance'] = $poolData['user']['estimated_reward'];
         $data['pool_hashrate'] = formatHashrate($poolData['global']['ghashes_ps'] * 1000000);
         $data['user_hashrate'] = formatHashrate($poolData['user']['hashrate'] * 1000);
         $data['workers'] = count($poolData['user']['workers']);
         $roundDuration = 0;
         $roundDurationVal = explode(':', $poolData['global']['round_duration']);
         $roundDuration += intval($roundDurationVal[0] * 60 * 60);
         $roundDuration += intval($roundDurationVal[1] * 60);
         $roundDuration += intval($roundDurationVal[2]);
         $data['round_duration'] = formatTimeElapsed($roundDuration);
         $data['username'] = $poolData['user']['username'];
         $data['url'] = $this->_apiURL;
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:32,代码来源:slush.php

示例10: optimalpayments_capture

function optimalpayments_capture($params)
{
    global $remote_ip;
    $url = "https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1";
    if ($params['testmode']) {
        $url = "https://webservices.test.optimalpayments.com/creditcardWS/CreditCardServlet/v1";
    }
    $cardtype = optimalpayments_cardtype($params['cardtype']);
    if ($params['country'] == "US") {
        $state = "<state>" . $params['clientdetails']['state'] . "</state>";
    } else {
        $state = "<region>" . $params['clientdetails']['state'] . "</region>";
    }
    $xml = "<ccAuthRequestV1 xmlns=\"http://www.optimalpayments.com/creditcard/xmlschema/v1\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxsi:schemaLocation=\"http://www.optimalpayments.com/creditcard/xmlschema/v1\">\n<merchantAccount>\n<accountNum>" . $params['accountnumber'] . "</accountNum>\n<storeID>" . $params['merchantid'] . "</storeID>\n<storePwd>" . $params['merchantpw'] . "</storePwd>\n</merchantAccount>\n<merchantRefNum>" . $params['invoiceid'] . "</merchantRefNum>\n<amount>" . $params['amount'] . "</amount>\n<card>\n<cardNum>" . $params['cardnum'] . "</cardNum>\n<cardExpiry>\n<month>" . substr($params['cardexp'], 0, 2) . "</month>\n<year>20" . substr($params['cardexp'], 2, 2) . "</year>\n</cardExpiry>\n<cardType>" . $cardtype . "</cardType>\n";
    if ($params['cccvv']) {
        $xml .= "<cvdIndicator>1</cvdIndicator>\n<cvd>" . $params['cccvv'] . "</cvd>\n";
    } else {
        $xml .= "<cvdIndicator>0</cvdIndicator>\n";
    }
    $xml .= "</card>\n<billingDetails>\n<cardPayMethod>WEB</cardPayMethod>\n<firstName>" . $params['clientdetails']['firstname'] . "</firstName>\n<lastName>" . $params['clientdetails']['lastname'] . "</lastName>\n<street>" . $params['clientdetails']['address1'] . "</street>\n<city>" . $params['clientdetails']['city'] . "</city>\n" . $state . "\n<country>" . $params['clientdetails']['country'] . "</country>\n<zip>" . $params['clientdetails']['postcode'] . "</zip>\n<phone>" . $params['clientdetails']['phonenumber'] . "</phone>\n<email>" . $params['clientdetails']['email'] . "</email>\n</billingDetails>\n<recurring>\n<recurringIndicator>R</recurringIndicator>\n</recurring>\n<customerIP>" . $remote_ip . "</customerIP>\n</ccAuthRequestV1>";
    $query_str = "txnMode=ccPurchase&txnRequest=" . urlencode($xml);
    $data = curlCall($url, $query_str);
    $xmldata = XMLtoArray($data);
    $xmldata = $xmldata['CCTXNRESPONSEV1'];
    if ($xmldata['CODE'] == "0") {
        return array("status" => "success", "transid" => $xmldata['txnNumber'], "rawdata" => $xmldata);
    }
    return array("status" => "declined", "rawdata" => $xmldata);
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:29,代码来源:optimalpayments.php

示例11: _quantumvault_http_post

function _quantumvault_http_post($host, $path, $data, $port = 80)
{
    $url = "https://secure.quantumgateway.com" . $path;
    $result = curlCall($url, $data);
    $response = explode("\n\n", $result, 2);
    $response[1] = $response[0];
    return $response;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:8,代码来源:quantumvault.php

示例12: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = array();
         foreach ($this->_actions as $action) {
             $poolData[$action] = curlCall($this->_apiURL . '/index.php?page=api&id=' . $this->_userId . '&api_key=' . $this->_apiKey . '&action=' . $action);
             if ($action == 'getpoolstatus') {
                 $poolData[$action] = $poolData[$action]['getpoolstatus']['data'];
             } else {
                 if ($action == 'getblockstats') {
                     $poolData[$action] = $poolData[$action]['getblockstats']['data'];
                 } else {
                     if ($action == 'getuserbalance') {
                         $poolData[$action] = $poolData[$action]['getuserbalance']['data'];
                     } else {
                         if ($action == 'getuserstatus') {
                             $poolData[$action] = $poolData[$action]['getuserstatus']['data'];
                         }
                     }
                 }
             }
         }
         // Offline Check
         if (empty($poolData[$this->_actions[0]])) {
             return;
         }
         // Data Order
         $data['type'] = $this->_type;
         $data['pending_payout'] = number_format($poolData['getuserbalance']['pending_payout'], 8);
         $data['payout_bonus'] = number_format($poolData['getuserbalance']['pending_bonus'], 8);
         $data['bonus_%'] = $poolData['getuserbalance']['pending_bonus_pct'] . '%';
         if ($poolData['getuserbalance']['merged_mining']) {
             foreach ($poolData['getuserbalance']['merged_mining'] as $coin) {
                 $data[$coin['coin'] . '_balance'] = number_format($coin['balance'], 8);
             }
         }
         $data['network_hashrate'] = formatHashrate($poolData['getpoolstatus']['nethashrate'] / 1000);
         $data['pool_hashrate'] = formatHashrate($poolData['getpoolstatus']['hashrate']);
         $data['user_hashrate'] = formatHashrate($poolData['getuserstatus']['hashrate']);
         $data['pool_workers'] = $poolData['getpoolstatus']['workers'];
         $data['efficiency'] = $poolData['getpoolstatus']['efficiency'] . '%';
         $data['accepted'] = $poolData['public']['shares_this_round'];
         $data['rejected'] = round($poolData['public']['shares_this_round'] - $poolData['public']['shares_this_round'] * ($poolData['getpoolstatus']['efficiency'] / 100));
         $data['difficulty'] = round($poolData['getpoolstatus']['networkdiff'], 5);
         $timeSinceLastBlock = formatTimeElapsed($poolData['getpoolstatus']['timesincelast']);
         $data['time_since_last_block'] = $timeSinceLastBlock;
         $data['%_of_expected'] = round($poolData['public']['shares_this_round'] / $poolData['getpoolstatus']['estshares'] * 100, 2) . '%';
         $data['current_block'] = $poolData['getpoolstatus']['currentnetworkblock'];
         $data['last_block'] = $poolData['getpoolstatus']['lastblock'];
         $data['username'] = $poolData['getuserstatus']['username'];
         $data['url'] = $this->_apiURL;
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:57,代码来源:bitcoinaffiliatenetwork.php

示例13: paymentexpress_link

function paymentexpress_link($params)
{
    $url = "https://sec.paymentexpress.com/pxpay/pxaccess.aspx";
    $xml = "<GenerateRequest>\n<PxPayUserId>" . $params['pxpayuserid'] . "</PxPayUserId>\n<PxPayKey>" . $params['pxpaykey'] . "</PxPayKey>\n<AmountInput>" . $params['amount'] . "</AmountInput>\n<CurrencyInput>" . $params['currency'] . "</CurrencyInput>\n<MerchantReference>" . $params['description'] . "</MerchantReference>\n<EmailAddress>" . $params['clientdetails']['email'] . "</EmailAddress>\n<TxnData1>" . $params['invoiceid'] . "</TxnData1>\n<TxnType>Purchase</TxnType>\n<TxnId>" . substr(time() . $params['invoiceid'], 0, 16) . "</TxnId>\n<BillingId></BillingId>\n<EnableAddBillCard>0</EnableAddBillCard>\n<UrlSuccess>" . $params['systemurl'] . "/modules/gateways/callback/paymentexpress.php</UrlSuccess>\n<UrlFail>" . $params['systemurl'] . "/clientarea.php</UrlFail>\n</GenerateRequest>";
    $data = curlCall($url, $xml);
    $xmlresponse = XMLtoArray($data);
    $uri = $xmlresponse['REQUEST']['URI'];
    $code = "<form method=\"post\" action=\"" . $uri . "\"><input type=\"submit\" value=\"" . $params['langpaynow'] . "\"></form>";
    return $code;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:10,代码来源:paymentexpress.php

示例14: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 30) {
         // updates every 30 seconds
         $poolData = curlCall($this->_apiURL . '?api_key=' . $this->_apiKey);
         // Offline Check
         if (empty($poolData)) {
             return;
         }
         // Payout Information
         $data['type'] = $this->_type;
         $poolHashrate = 0;
         $userHashrate = 0;
         foreach ($poolData['currency'] as $coin => $values) {
             if ($values['confirmed_rewards'] != 0) {
                 $data[$coin . '_balance'] = number_format($values['confirmed_rewards'], 8);
             }
             if ($values['estimated_rewards'] != 0) {
                 $data[$coin . '_unconfirmed_balance'] = number_format($values['estimated_rewards'], 8);
             }
             // removed until we find a better way to display this information. Right now it's way too cluttered
             // if ($values['hashrate'] != '0') {
             //     $data[$coin.'_hashrate'] =  formatHashrate($values['hashrate']);
             // }
             if ($values['hashrate'] != 0) {
                 $userHashrate += $values['hashrate'];
             }
             $poolHashrate += $values['pool_hashrate'];
         }
         $data['pool_hashrate'] = $poolHashrate;
         $data['user_hashrate'] = $userHashrate;
         $userWorkers = array();
         foreach ($poolData['workers'] as $coin => $workers) {
             foreach ($workers as $name => $worker) {
                 if (!array_key_exists($name, $userWorkers)) {
                     $userWorkers[$name] = 0;
                 }
                 if ($worker['hashrate'] != 0) {
                     $userWorkers[$name] += $worker['hashrate'];
                 }
             }
         }
         foreach ($userWorkers as $name => $worker) {
             $name = explode('.', $name);
             $data['worker_' . $name[1]] = formatHashrate($worker);
         }
         $data['pool_hashrate'] = formatHashrate($data['pool_hashrate']);
         $data['user_hashrate'] = formatHashrate($data['user_hashrate']);
         $data['url_name'] = 'https://multipool.us';
         $data['url'] = 'https://multipool.us/';
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:55,代码来源:multipoolus.php

示例15: update

 public function update()
 {
     if ($GLOBALS['cached'] == false || $this->_fileHandler->lastTimeModified() >= 3600) {
         // updates every 60 minutes. How much are you being paid out that this must change? We take donations :)
         $addressBalance = curlCall($this->_apiURL);
         $data = array('label' => $this->_label, 'address' => $this->_address, 'balance' => (double) $addressBalance);
         $this->_fileHandler->write(json_encode($data));
         return $data;
     }
     return json_decode($this->_fileHandler->read(), true);
 }
开发者ID:ctubio,项目名称:cryptoGlance-web-app,代码行数:11,代码来源:vertcoin.php


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