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


PHP objectsIntoArray函数代码示例

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


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

示例1: process

 function process($data, $config)
 {
     $myTransactionData = $this->set_array($data, $config);
     $xmlRequest = "<?xml version=\"1.0\"?>";
     $xmlRequest .= "<request>";
     $xmlRequest .= "\t<type>transaction</type>";
     $xmlRequest .= "\t<authtype>authorise</authtype>";
     $xmlRequest .= "\t<authentication>";
     $xmlRequest .= "\t\t<shreference>" . $config['sh_ref'] . "</shreference>";
     $xmlRequest .= "\t\t<checkcode>" . $config['sh_check'] . "</checkcode>";
     $xmlRequest .= "\t</authentication>";
     $xmlRequest .= "\t<transaction>";
     foreach ($myTransactionData as $key => $value) {
         $xmlRequest .= "<{$key}>{$value}</{$key}>";
     }
     $xmlRequest .= "\t</transaction>";
     $xmlRequest .= "</request>";
     // =debug
     $xmlResponse = $this->sendTransaction($xmlRequest, $config);
     if ($xmlResponse != "") {
         $responseFields = simplexml_load_string($xmlResponse);
         $responseArray = objectsIntoArray($responseFields);
     }
     if (trim($responseArray['status']) != "OK") {
         $trans = array('error' => $responseArray['reason']);
     } else {
         $details = array("Method" => "SecureHosting", "Approval Code" => $responseArray['reference']);
         // Return the trans details
         $trans = array('status' => 3, 'transaction_id' => $responseArray['reference'], 'payment_type' => 'SecureHosting', 'amount' => $data["order_total"], 'details' => serialize($details), 'approval' => $responseArray['authtype']);
     }
     return $trans;
 }
开发者ID:ebeauchamps,项目名称:brilliantretail,代码行数:32,代码来源:gateway.securehosting.php

示例2: response

 public function response()
 {
     require_once '../includes/util.php';
     $response_object = simplexml_load_string($this->request());
     $response_array = objectsIntoArray($response_object);
     return $response_array;
 }
开发者ID:nuandy,项目名称:alloy,代码行数:7,代码来源:FetchToken.php

示例3: process

 function process($data, $config)
 {
     $messageID = md5(time() . rand(1000, 1000000) . time());
     if ($config['x_test_request'] == "TRUE") {
         $merchantID = "XYZ0010";
         $merchantPW = "abcd1234";
     } else {
         $merchantID = $config['merchant_id'];
         $merchantPW = $config['password'];
     }
     $myTransactionData = $this->set_array($data, $config);
     $xmlRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
     $xmlRequest .= "<NABTransactMessage>";
     $xmlRequest .= "<MessageInfo>";
     $xmlRequest .= "<messageID>" . $messageID . "</messageID>";
     $xmlRequest .= "<messageTimestamp>" . create_date() . "</messageTimestamp>";
     $xmlRequest .= "<timeoutValue>60</timeoutValue>";
     $xmlRequest .= "<apiVersion>xml-4.2</apiVersion>";
     $xmlRequest .= "</MessageInfo>";
     $xmlRequest .= "<MerchantInfo>";
     $xmlRequest .= "<merchantID>" . $merchantID . "</merchantID>";
     $xmlRequest .= "<password>" . $merchantPW . "</password>";
     $xmlRequest .= "</MerchantInfo>";
     $xmlRequest .= "<RequestType>Payment</RequestType>";
     $xmlRequest .= "<Payment>";
     $xmlRequest .= '<TxnList count="1">';
     $xmlRequest .= '<Txn ID="1">';
     foreach ($myTransactionData as $key => $value) {
         $xmlRequest .= "<{$key}>{$value}</{$key}>";
     }
     $xmlRequest .= "<CreditCardInfo>";
     $xmlRequest .= "<cardNumber>" . $data['nab_cc_num'] . "</cardNumber>";
     $xmlRequest .= "<expiryDate>" . $data['nab_cc_month'] . '/' . $data['nab_cc_year'] . "</expiryDate>";
     $xmlRequest .= "</CreditCardInfo>";
     $xmlRequest .= "</Txn>";
     $xmlRequest .= "</TxnList>";
     $xmlRequest .= "</Payment>";
     $xmlRequest .= "</NABTransactMessage>";
     $xmlResponse = $this->sendTransactionToNab($xmlRequest, $config['x_test_request']);
     if ($xmlResponse != "") {
         $responseFields = simplexml_load_string($xmlResponse);
         $responseArray = objectsIntoArray($responseFields);
     }
     if (trim($responseArray['Payment']['TxnList']['Txn']['responseCode']) != "00") {
         $trans = array('error' => $responseArray['Payment']['TxnList']['Txn']['responseText']);
     } else {
         $details = array("Method" => "NAB", "Approval Code" => $responseArray['Payment']['TxnList']['Txn']['responseCode'], "Transaction ID" => $responseArray['Payment']['TxnList']['Txn']['txnID'], "Transaction Ref" => $data['transaction_id'], "Transaction Info" => $responseArray['Payment']['TxnList']['Txn']['responseText']);
         // Return the trans details
         $trans = array('status' => 3, 'transaction_id' => $responseArray['Payment']['TxnList']['Txn']['txnID'], 'payment_type' => 'NAB', 'amount' => $data["order_total"], 'details' => serialize($details), 'approval' => $responseArray['Payment']['TxnList']['Txn']['responseCode']);
     }
     return $trans;
 }
开发者ID:ebeauchamps,项目名称:brilliantretail,代码行数:52,代码来源:gateway.nab_transact.php

示例4: definition

 function definition()
 {
     $search = rawurlencode($this->query);
     $url = "API";
     $response = httpGet($url);
     $xmlObj = simplexml_load_string($response);
     $arrXml = objectsIntoArray($xmlObj);
     //print_r($arrXml);
     //echo count($arrXml['definitions']);
     if (count($arrXml) > 0) {
         if (isset($arrXml['definition']['text'])) {
             echo $arrXml['definition']['text'];
         } else {
             foreach ($arrXml['definition'] as $i => $definition) {
                 echo $i + 1 . ". " . $definition['text'] . "\n";
             }
         }
     }
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:19,代码来源:wordnik.php

示例5: objectsIntoArray

function objectsIntoArray($arrObjData, $arrSkipIndices = array())
{
    $arrData = array();
    if (is_object($arrObjData)) {
        $arrObjData = get_object_vars($arrObjData);
    }
    if (is_array($arrObjData)) {
        foreach ($arrObjData as $index => $value) {
            if (is_object($value) || is_array($value)) {
                $value = objectsIntoArray($value, $arrSkipIndices);
            }
            if (in_array($index, $arrSkipIndices)) {
                continue;
            }
            $arrData[$index] = $value;
        }
    }
    return $arrData;
}
开发者ID:jcjnyc,项目名称:Stock-Market-Simulation,代码行数:19,代码来源:fetchxml.php

示例6: process

 function process($data, $config)
 {
     $myTransactionData = $this->set_array($data, $config);
     $xmlRequest = "<ewaygateway>";
     foreach ($myTransactionData as $key => $value) {
         $xmlRequest .= "<{$key}>{$value}</{$key}>";
     }
     $xmlRequest .= "</ewaygateway>";
     $xmlResponse = $this->sendTransactionToEway($xmlRequest, $config['x_test_request']);
     if ($xmlResponse != "") {
         $responseFields = simplexml_load_string($xmlResponse);
         $responseArray = objectsIntoArray($responseFields);
     }
     if (trim($responseArray['ewayTrxnStatus']) != "True") {
         $trans = array('error' => $responseArray['ewayTrxnError']);
     } else {
         $details = array("Method" => "eWay", "Approval Code" => $responseArray['ewayAuthCode'], "Transaction ID" => $responseArray['ewayTrxnNumber'], "Transaction Info" => $responseArray['ewayTrxnError']);
         // Return the trans details
         $trans = array('status' => 3, 'transaction_id' => $responseArray['ewayTrxnNumber'], 'payment_type' => 'eWay', 'amount' => $data["order_total"], 'details' => serialize($details), 'approval' => $responseArray['ewayTrxnStatus']);
     }
     return $trans;
 }
开发者ID:ebeauchamps,项目名称:brilliantretail,代码行数:22,代码来源:gateway.eway_au.php

示例7: process

 function process($data, $config)
 {
     $myTransactionData = $this->set_array($data, $config);
     $xmlRequest = "<Order>";
     foreach ($myTransactionData as $key => $value) {
         $xmlRequest .= "<{$key}>{$value}</{$key}>";
     }
     $xmlRequest .= "</Order>";
     $xmlResponse = $this->sendTransactionToPSI($xmlRequest, $config);
     if ($xmlResponse != "") {
         $responseFields = simplexml_load_string($xmlResponse);
         $responseArray = objectsIntoArray($responseFields);
     }
     if (trim($responseArray['Approved']) != "APPROVED") {
         $trans = array('error' => 'An error occurred while processing your transaction: ' . $responseArray['ErrMsg']);
     } else {
         $details = array("Method" => "PSIGate", "Approval Code" => $responseArray['CardAuthNumber'], "Transaction Info" => $responseArray['TransRefNumber']);
         // Return the trans details
         $trans = array('status' => 3, 'transaction_id' => $responseArray['OrderID'], 'payment_type' => 'PSIGate', 'amount' => $responseArray["FullTotal"], 'details' => serialize($details), 'approval' => $responseArray['Approved']);
     }
     return $trans;
 }
开发者ID:ebeauchamps,项目名称:brilliantretail,代码行数:22,代码来源:gateway.psigate.php

示例8: process

 function process($data, $config)
 {
     $timestamp = strftime("%Y%m%d%H%M%S");
     $orderid = $timestamp . mt_rand(1, 999);
     $email = $this->EE->session->userdata["email"];
     $args = "&Username=" . $config['api_username'];
     //Your API Username which can be located in your PayLeap merchant interface
     $args .= "&Password=" . $config['transaction_key'];
     //Your Transaction Key which can be located in your PayLeap merchant interface
     $args .= "&TransType=Sale";
     // Review guide for transaction types
     $args .= "&NameOnCard=" . $data['payleap_cc_name'];
     $args .= "&CardNum=" . $data['payleap_cc_num'];
     $args .= "&ExpDate=" . $data['payleap_cc_month_exp'] . $data['payleap_cc_year_exp'];
     //MMYY Format
     $args .= "&CVNum=" . $data['payleap_cc_cv2'];
     $args .= "&Amount=" . $data['order_total'];
     $args .= "&ExtData=<TrainingMode>" . substr($config['test_mode'], 0, 1) . "</TrainingMode>\n    \t\t\t\t<Invoice>\n    \t\t\t\t\t<InvNum>" . $orderid . "</InvNum>\n    \t\t\t\t\t<BillTo>\n    \t\t\t\t\t\t<Name>" . $data['br_billing_fname'] . " " . $data['br_billing_lname'] . "</Name>\n    \t\t\t\t\t\t<Address>\n    \t\t\t\t\t\t\t<Street>" . $data['br_billing_address1'] . "</Street>\n    \t\t\t\t\t\t\t<City>" . $data['br_billing_city'] . "</City>\n\t\t\t\t\t\t\t\t<State>" . $data['br_billing_state'] . "</State>\n\t\t\t\t\t\t\t\t<Zip>" . $data['br_billing_zip'] . "</Zip>\n\t\t\t\t\t\t\t\t<Country>" . $data['br_billing_country'] . "</Country>\n\t\t\t\t\t\t\t</Address>\n\t\t\t\t\t\t\t<Email>" . $email . "</Email>\n\t\t\t\t\t\t\t<Phone>" . $data['br_billing_phone'] . "</Phone>\n\t\t\t\t\t\t</BillTo>\n\t\t\t\t\t\t<Description>" . $config['order_description'] . "</Description>\n\t\t\t\t\t</Invoice>";
     $args .= "&PNRef=";
     $args .= "&MagData=";
     if ($config['test_mode'] == "TRUE") {
         $host = "https://uat.payleap.com/TransactServices.svc/ProcessCreditCard";
     } else {
         $host = "https://secure1.payleap.com/TransactServices.svc/ProcessCreditCard";
     }
     $result = $this->payleap_send($args, $host);
     if ($result != "") {
         $responseFields = simplexml_load_string($result);
         $responseArray = objectsIntoArray($responseFields);
     }
     if (trim($responseArray['Result']) != "0") {
         $trans = array('error' => '<b>Gateway Error:</b> ' . $responseArray['RespMSG']);
     } else {
         $details = array("Method" => "PayLeap", "Approval Code" => $responseArray['PNRef']);
         // Return the trans details
         $trans = array('status' => 3, 'transaction_id' => $responseArray['AuthCode'], 'payment_type' => 'PayLeap', 'amount' => $data["order_total"], 'details' => serialize($details), 'approval' => $responseArray['Message']);
     }
     return $trans;
 }
开发者ID:ebeauchamps,项目名称:brilliantretail,代码行数:39,代码来源:gateway.brilliantretail.php

示例9: getAllBingUrls

function getAllBingUrls($local_word)
{
    $url = "http://IP/search?q=" . urlencode($local_word) . "&go=&qb=1&format=rss";
    $content = file_get_contents($url);
    $arXml = objectsIntoArray(simplexml_load_string($content));
    if (!empty($arXml["channel"]["item"])) {
        foreach ($arXml["channel"]["item"] as $value) {
            $arUrl[] = $value["link"];
        }
        $arUrls["url"] = $arUrl;
    }
    if (empty($arUrls["url"])) {
        echo "<h1>After BING RSS</h1>";
        echo $bing_url = "http://IP/search?q=" . urlencode($local_word) . "&mkt=en-in&go=&qs=n&sk=&form=QBLH&filt=all&cc=in";
        $data = file_get_contents($bing_url);
        $arUrls = $arUrl = array();
        $arUrls["content"] = $data;
        if (preg_match_all("~class=\"sb_meta\"><cite>(.+)</cite>~Usi", $data, $matches)) {
            foreach ($matches[1] as $url) {
                $url = strip_tags($url);
                $arUrl[] = "http://" . $url;
            }
            $arUrls["url"] = $arUrl;
        }
    }
    return $arUrls;
}
开发者ID:superego546,项目名称:SMSGyan,代码行数:27,代码来源:functions.php

示例10: GetUnitList


//.........这里部分代码省略.........
        unset($xml_quests);
    }
    $vCraftingConfig = 'farmville-xml/' . $_SESSION['flashRevision'] . '_Crafting.xml';
    if (!file_exists($vCraftingConfig)) {
        $xml_crafting = '';
        AddLog2('DL: v' . $_SESSION['flashRevision'] . ' crafting xml');
        if (isset($flashVars['xml_url']) && !empty($flashVars['xml_url'])) {
            $geturl = $flashVars['xml_url'] . 'crafting.xml.gz';
        } else {
            $geturl = $flashVars['app_url'] . 'v' . $_SESSION['flashRevision'] . '/crafting.xml.gz';
        }
        $xml_crafting = gzuncompress(proxy_GET($geturl));
        if (!$xml_crafting) {
            AddLog2('Couldn\'t find a crafting xml...');
        } else {
            AddLog2('Download completed.');
            file_put_contents($vCraftingConfig, $xml_crafting);
            $sqlite_update = 1;
        }
        unset($xml_crafting);
    }
    if ($sqlite_update == 1) {
        $_SESSION['vDataDB']->exec('BEGIN TRANSACTION');
        $_SESSION['vDataDB']->exec('delete from units');
        $_SESSION['vDataDB']->exec('delete from achievements');
        $_SESSION['vDataDB']->exec('delete from collectables');
        $_SESSION['vDataDB']->exec('delete from storage');
        $_SESSION['vDataDB']->exec('delete from crafting');
        $_SESSION['vDataDB']->exec('delete from quests');
        $_SESSION['vDataDB']->exec('COMMIT TRANSACTION');
        $_SESSION['vDataDB']->exec('vacuum');
        $_SESSION['vDataDB']->exec('BEGIN TRANSACTION');
        $xmlDoc = simplexml_load_file($vItemsSetting);
        $itemsarray = objectsIntoArray($xmlDoc);
        //file_put_contents('testarray.txt', print_r($array,true));
        foreach ($itemsarray['items']['item'] as $item) {
            $itemName = $item['@attributes']['name'];
            foreach ($item as $key => $field) {
                if ($key == '@attributes') {
                    foreach ($field as $key1 => $attr) {
                        $_SESSION['vDataDB']->exec('insert into units(name,field,content) values("' . $itemName . '","' . $key1 . '","' . $attr . '");');
                    }
                    continue;
                }
                if ($key == 'image') {
                    foreach ($field as $key1 => $attr) {
                        if ($attr['name'] == 'icon') {
                            $_SESSION['vDataDB']->exec('insert into units(name,field,content) values("' . $itemName . '","iconurl","' . $attr['url'] . '");');
                            break;
                        }
                        if ($attr['@attributes']['name'] == 'icon') {
                            $_SESSION['vDataDB']->exec('insert into units(name,field,content) values("' . $itemName . '","iconurl","' . $attr['@attributes']['url'] . '");');
                            break;
                        }
                    }
                    continue;
                }
                if ($key == 'masteryLevel') {
                    foreach ($field as $key1 => $attr) {
                        if (isset($attr['@attributes']['gift'])) {
                            $_SESSION['vDataDB']->exec('insert into units(name,field,content) values("' . $itemName . '","masterymax","' . $attr['@attributes']['count'] . '");');
                            break;
                        }
                        if (isset($attr['gift'])) {
                            $_SESSION['vDataDB']->exec('insert into units(name,field,content) values("' . $itemName . '","masterymax","' . $attr['count'] . '");');
                            break;
开发者ID:RadicalLinux,项目名称:faceBot,代码行数:67,代码来源:parser.php

示例11: shipping_sync_14

/**
 * 刷单标记发货:一号店
 */
function shipping_sync_14($order_info)
{
    include '../admin/yhd/YhdClient.php';
    include '../admin/yhd/sk.php';
    include '../admin/yhd/request/order/OrderLogisticsPushRequest.php';
    include '../admin/yhd/request/logistics/LogisticsOrderShipmentsUpdateRequest.php';
    $auth = (include '../admin/yhd/config.php');
    $req = new LogisticsOrderShipmentsUpdateRequest();
    // 应用级参数
    $req->setOrderCode($order_info['order_sn']);
    $req->setExpressNbr($tracking_sn);
    $sql_select = 'SELECT 1mall_code FROM ' . $GLOBALS['ecs']->table('shipping') . " WHERE shipping_id={$order_info['shipping_id']}";
    $req->setDeliverySupplierId($GLOBALS['db']->getOne($sql_select));
    $yhdClient = new YhdClient();
    // 系统级参数
    $yhdClient->appkey = $auth['appkey'];
    $yhdClient->secretKey = $auth['secretKey'];
    $yhdClient->format = 'json';
    $result = $yhdClient->execute($req, $sk['accessToken']);
    $result = objectsIntoArray($result);
    if ($result['response']['errInfoList']) {
        $req = new OrderDetailGetRequest();
        $req->setOrderCode($order_info['order_sn']);
        $yhdClient = new YhdClient();
        // 系统级参数
        $yhdClient->appkey = $auth['appkey'];
        $yhdClient->secretKey = $auth['secretKey'];
        $yhdClient->format = 'json';
        $express = $yhdClient->execute($req, $sk['accessToken']);
        $express = json_decode($express, true);
        if (isset($express['response']['orderInfo']['orderDetail']['merchantExpressNbr']) && $express['response']['orderInfo']['orderDetail']['merchantExpressNbr'] == $tracking_sn) {
        } elseif (isset($express['response']['orderInfo']['orderDetail']['merchantExpressNbr']) && $express['response']['orderInfo']['orderDetail']['merchantExpressNbr'] != $tracking_sn) {
            $res['message'] = '该订单已经在一号店标记发货,所使用的运单号为【' . $express['response']['orderInfo']['orderDetail']['merchantExpressNbr'] . '】';
        } else {
            $res['message'] = $result['response']['errInfoList']['errDetailInfo'][0]['errorDes'];
            $res['tracking_sn'] = $order_info['tracking_sn'];
        }
    }
}
开发者ID:554119220,项目名称:kjrscrm,代码行数:42,代码来源:lib_c2c.php

示例12: rtomatoes_details

function rtomatoes_details($cons)
{
    global $rkey;
    global $remain_movie;
    global $word;
    global $spell_checked_word;
    $check_title = $spell_checked_word;
    global $snn;
    //    $check_title = $mov_name;
    global $title_tm, $rating_tm, $synop_tm, $casting_tm, $year_tm;
    $rotten_return = '';
    $rating = array();
    $content_jsn = json_decode($cons);
    $content_jsn = objectsIntoArray($content_jsn);
    //print_r($content_jsn);
    if (isset($content_jsn['total']) && $content_jsn['total'] != 0 && $content_jsn['total'] != NULL) {
        $total_results = trim($content_jsn['total']);
    }
    foreach ($content_jsn['movies'] as $distinct) {
        //print_r($distinct);
        $snn[] = $distinct;
    }
    //print_r($snn);
    foreach ($snn as $key => $data) {
        if (isset($data['title']) && $data['title'] != NULL) {
            $title_tm[$key] = trim($data['title']);
        }
        if (isset($data['id']) && $data['id'] != NULL) {
            $id_tm[$key] = trim($data['id']);
        }
        foreach ($data['ratings'] as $kn => $rnt) {
            if (isset($rnt) && $rnt != NULL) {
                $rating_tm[$key][$kn] = trim($rnt) / 10;
            }
        }
        if (isset($data['year']) && $data['year'] != NULL) {
            $year_tm[$key] = trim($data['year']);
        }
        if (isset($data['synopsis']) && $data['synopsis'] != NULL) {
            $synop_tm[$key] = trim($data['synopsis']);
        }
        //$runtime[$key]= trim($data['runtime']);
        //print_r($release = trim($content_jsn['movies'][0]['synopsis']));
        $i = 0;
        foreach ($data['abridged_cast'] as $cst) {
            //var_dump($cst);
            if (isset($cst['name']) && $cst['name'] != NULL) {
                $casting_tm[$key][$i][0] = trim($cst['name']);
            }
            if (isset($cst['characters'][0]) && $cst['characters'][0] != NULL) {
                $casting_tm[$key][$i][1] = trim($cst['characters'][0]);
            }
            $i = $i + 1;
        }
    }
    $fkey = 100;
    $prevyear = 1111;
    $rkey = 0;
    if (isset($total_results)) {
        for ($i = 0; $i < $total_results; $i++) {
            if (!isset($title_tm[$i])) {
                continue;
            }
            $dist_title = $title_tm[$i];
            $lev_arry[$i] = levenshtein($dist_title, $check_title);
        }
        foreach ($lev_arry as $id => $val) {
            if ($val <= $fkey) {
                if ($val == $fkey) {
                    if ($prevyear < $year_tm[$id]) {
                        $rkey = $id;
                        $fkey = $val;
                        $prevyear = $year_tm[$id];
                    }
                } else {
                    $rkey = $id;
                    $fkey = $val;
                    $prevyear = $year_tm[$id];
                }
            }
        }
        //        asort($lev_arry);
        //
        //        $temp = each($lev_arry);
        //        echo "Key--" . $rkey = $temp["key"];
        //        echo "Value--" . $rtitle = $temp["value"];
        $rotten_return = get_movie_details($rkey);
        //unset ($title_tm[$rkey]);
        if (isset($title_tm)) {
            //echo "INN";
            print_r($remain_movie = $title_tm);
        }
    }
    //$rotten_return = get_movie_details(0);
    if (!empty($rotten_return)) {
        $result = array("movie" => true, "type" => "rotten", "id" => $id_tm[$rkey], "title" => $title_tm[$rkey], "value" => $rotten_return);
    } else {
        $result = false;
    }
    return $result;
//.........这里部分代码省略.........
开发者ID:superego546,项目名称:SMSGyan,代码行数:101,代码来源:grotten.php

示例13: addFromXml

 public function addFromXml($releaseID, $xml)
 {
     $xmlObj = @simplexml_load_string($xml);
     $arrXml = objectsIntoArray($xmlObj);
     $containerformat = "";
     $overallbitrate = "";
     if (isset($arrXml["File"]) && isset($arrXml["File"]["track"])) {
         foreach ($arrXml["File"]["track"] as $track) {
             if (isset($track["@attributes"]) && isset($track["@attributes"]["type"])) {
                 if ($track["@attributes"]["type"] == "General") {
                     if (isset($track["Format"])) {
                         $containerformat = $track["Format"];
                     }
                     if (isset($track["Overall_bit_rate"])) {
                         $overallbitrate = $track["Overall_bit_rate"];
                     }
                     $gendata = $track;
                 } elseif ($track["@attributes"]["type"] == "Video") {
                     $videoduration = "";
                     $videoformat = "";
                     $videocodec = "";
                     $videowidth = "";
                     $videoheight = "";
                     $videoaspect = "";
                     $videoframerate = "";
                     $videolibrary = "";
                     $gendata = "";
                     $viddata = "";
                     $audiodata = "";
                     if (isset($track["Duration"])) {
                         $videoduration = $track["Duration"];
                     }
                     if (isset($track["Format"])) {
                         $videoformat = $track["Format"];
                     }
                     if (isset($track["Codec_ID"])) {
                         $videocodec = $track["Codec_ID"];
                     }
                     if (isset($track["Width"])) {
                         $videowidth = preg_replace("/[^0-9]/", '', $track["Width"]);
                     }
                     if (isset($track["Height"])) {
                         $videoheight = preg_replace("/[^0-9]/", '', $track["Height"]);
                     }
                     if (isset($track["Display_aspect_ratio"])) {
                         $videoaspect = $track["Display_aspect_ratio"];
                     }
                     if (isset($track["Frame_rate"])) {
                         $videoframerate = str_replace(" fps", "", $track["Frame_rate"]);
                     }
                     if (isset($track["Writing_library"])) {
                         $videolibrary = $track["Writing_library"];
                     }
                     $viddata = $track;
                     $this->addVideo($releaseID, $containerformat, $overallbitrate, $videoduration, $videoformat, $videocodec, $videowidth, $videoheight, $videoaspect, $videoframerate, $videolibrary);
                 } elseif ($track["@attributes"]["type"] == "Audio") {
                     $audioID = 1;
                     $audioformat = "";
                     $audiomode = "";
                     $audiobitratemode = "";
                     $audiobitrate = "";
                     $audiochannels = "";
                     $audiosamplerate = "";
                     $audiolibrary = "";
                     $audiolanguage = "";
                     $audiotitle = "";
                     if (isset($track["@attributes"]["streamid"])) {
                         $audioID = $track["@attributes"]["streamid"];
                     }
                     if (isset($track["Format"])) {
                         $audioformat = $track["Format"];
                     }
                     if (isset($track["Mode"])) {
                         $audiomode = $track["Mode"];
                     }
                     if (isset($track["Bit_rate_mode"])) {
                         $audiobitratemode = $track["Bit_rate_mode"];
                     }
                     if (isset($track["Bit_rate"])) {
                         $audiobitrate = $track["Bit_rate"];
                     }
                     if (isset($track["Channel_s_"])) {
                         $audiochannels = $track["Channel_s_"];
                     }
                     if (isset($track["Sampling_rate"])) {
                         $audiosamplerate = $track["Sampling_rate"];
                     }
                     if (isset($track["Writing_library"])) {
                         $audiolibrary = $track["Writing_library"];
                     }
                     if (isset($track["Language"])) {
                         $audiolanguage = $track["Language"];
                     }
                     if (isset($track["Title"])) {
                         $audiotitle = $track["Title"];
                     }
                     $audiodata = $track;
                     $this->addAudio($releaseID, $audioID, $audioformat, $audiomode, $audiobitratemode, $audiobitrate, $audiochannels, $audiosamplerate, $audiolibrary, $audiolanguage, $audiotitle);
                 } elseif ($track["@attributes"]["type"] == "Text") {
                     $subsID = 1;
//.........这里部分代码省略.........
开发者ID:ehsanguru,项目名称:nnplus,代码行数:101,代码来源:releaseextra.php

示例14: getEpisodeInfo

 public function getEpisodeInfo($rageid, $series, $episode)
 {
     $result = array('title' => '', 'airdate' => '');
     $series = str_ireplace("s", "", $series);
     $episode = str_ireplace("e", "", $episode);
     $lookupUrl = $this->xmlEpisodeInfoUrl . "&sid=" . $rageid . "&ep=" . $series . "x" . $episode;
     $xml = $this->fetchCache($lookupUrl);
     if ($xml === false) {
         $xml = Utility::getUrl(['url' => $lookupUrl, 'verifycert' => false]);
     }
     if ($xml !== false) {
         $this->storeCache($lookupUrl, $xml);
         if (preg_match('/no show found/i', $xml)) {
             return false;
         }
         $xmlObj = @simplexml_load_string($xml);
         $arrXml = objectsIntoArray($xmlObj);
         if (is_array($arrXml)) {
             if (isset($arrXml['episode']['airdate']) && $arrXml['episode']['airdate'] != '0000-00-00') {
                 $result['airdate'] = $arrXml['episode']['airdate'];
             }
             if (isset($arrXml['episode']['title'])) {
                 $result['title'] = $arrXml['episode']['title'];
             }
             return $result;
         }
         return false;
     }
     return false;
 }
开发者ID:engine9-,项目名称:newznab-tmux,代码行数:30,代码来源:TvRage.php

示例15: getReleaseNameForReqId

 public function getReleaseNameForReqId($url, $groupname, $reqid, $echooutput = false)
 {
     $url = str_ireplace("[GROUP]", urlencode($groupname), $url);
     $url = str_ireplace("[REQID]", urlencode($reqid), $url);
     $xml = "";
     $arrXml = "";
     $xml = getUrl($url);
     if ($xml === false || preg_match('/no feed/i', $xml)) {
         return "no feed";
     } else {
         if ($xml != "") {
             $xmlObj = @simplexml_load_string($xml);
             $arrXml = objectsIntoArray($xmlObj);
             if (isset($arrXml["item"]) && is_array($arrXml["item"]) && is_array($arrXml["item"]["@attributes"])) {
                 if ($echooutput) {
                     echo "found title for reqid " . $reqid . " - " . $arrXml["item"]["@attributes"]["title"] . "\n";
                 }
                 return $arrXml["item"]["@attributes"]["title"];
             }
         }
     }
     if ($echooutput) {
         echo "no title found for reqid " . $reqid . "\n";
     }
     return "";
 }
开发者ID:priyavadan,项目名称:newznab,代码行数:26,代码来源:releases.php


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