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


PHP Provider::getInstance方法代码示例

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


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

示例1: savaShopDetail

function savaShopDetail($d, $fp, $type)
{
    $pk = new PackageIn();
    $r = $d->DataList;
    $count = count($r);
    $lable = $d->Tag;
    $pk->writeByte($count);
    for ($i = 0; $i < $count; $i++) {
        foreach ($r[$i] as $key => $value) {
            switch ($lable[$key]) {
                case "int":
                    $pk->writeInt($value);
                    break;
                case "string":
                    $pk->writeUTF($value);
                    break;
                case "byte":
                    $pk->writeByte($value);
                    break;
                case "short":
                    $pk->writeShort($value);
                    break;
            }
        }
        $d1 = Provider::getInstance()->getShopCategoryList($r[$i][0]);
        $r1 = $d1->DataList;
        $count1 = count($r1);
        $lable1 = $d1->Tag;
        $pk->writeByte($count1);
        for ($j = 0; $j < $count1; $j++) {
            $pk->writeUTF($r1[$j][1]);
            $d2 = Provider::getInstance()->getShopItemsList($r1[$j][0], $r[$i][0]);
            $r2 = $d2->DataList;
            $count2 = count($r2);
            $lable2 = $d2->Tag;
            $pk->writeShort($count2);
            for ($j1 = 0; $j1 < $count2; $j1++) {
                foreach ($r2[$j1] as $key1 => $value1) {
                    switch ($lable2[$key1]) {
                        case "int":
                            $pk->writeInt($value1);
                            break;
                        case "string":
                            $pk->writeUTF($value1);
                            break;
                        case "byte":
                            $pk->writeByte($value1);
                            break;
                        case "short":
                            $pk->writeShort($value1);
                            break;
                    }
                }
            }
        }
    }
    $str = pack("C", $type);
    //type
    fwrite($fp, $str);
    $str = pack("N", $pk->len);
    //len
    fwrite($fp, $str);
    mypack($fp, $pk->data->format, $pk->data->params);
}
开发者ID:longceng,项目名称:honingwon,代码行数:64,代码来源:Export.php

示例2: dirname

require_once dirname(__FILE__) . '/api/Provider.php';
require_once dirname(__FILE__) . '/lib/SqlResult.php';
require_once dirname(__FILE__) . '/Package/PackageIn.php';
require_once dirname(__FILE__) . '/Package/PHPPack.php';
ini_set("memory_limit", "-1");
$fp = fopen("FilterContentList.data", 'wb') or die("cannot open FilterContentList.data");
$str = pack("C", 0);
//v
fwrite($fp, $str);
$str = pack("C", 0);
//v
fwrite($fp, $str);
$str = pack("C", 1);
//v
fwrite($fp, $str);
$d = Provider::getInstance()->getFilterContent();
sava($d, $fp);
fclose($fp);
echo "export suc", "\n";
function sava($d, $fp)
{
    $pk = new PackageIn();
    $r = $d->DataList;
    $count = count($r);
    $lable = $d->Tag;
    $pk->writeInt($count);
    for ($i = 0; $i < $count; $i++) {
        foreach ($r[$i] as $key => $value) {
            switch ($lable[$key]) {
                case "int":
                    $pk->writeInt($value);
开发者ID:longceng,项目名称:honingwon,代码行数:31,代码来源:ExportFilterWords.php


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