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


PHP Device::read方法代码示例

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


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

示例1: elseif

             $first = false;
         }
         $result = $result . "" . $device->deviceInfo($item->id, $jsonString->user);
     }
     $result = $result . "]}";
 } elseif ($cmd == 'remove') {
     $result = $device->removeDevice($jsonString->user, $jsonString->device);
 } elseif ($cmd == 'removeall') {
     $result = $device->removeAllDevice($jsonString->user);
 } elseif ($cmd == 'read') {
     if (isset($jsonString->date)) {
         $d = $jsonString->date;
     } else {
         $d = null;
     }
     $result = $device->read($jsonString->user, $jsonString->device, $d);
 } elseif ($cmd == 'getload') {
     $result = $device->getload($jsonString->template, $jsonString->unit);
 } elseif ($cmd == 'readinterval') {
     $result = $device->readInterval($jsonString->user, $jsonString->device, $jsonString->date1, $jsonString->date2);
 } elseif ($cmd == 'info') {
     $result = $device->deviceBehaviour($jsonString->device, $jsonString->user);
 } elseif ($cmd == 'deviceinfo') {
     $result = $device->deviceInfo($jsonString->device, $jsonString->user);
 } else {
     $result = "{'error': 'unsupported command'}";
 }
 if (isset($_GET['standard'])) {
     $result = strtr($result, array("'" => '"'));
 }
 echo $result;
开发者ID:UbiCollab,项目名称:PersuasiveCommunities,代码行数:31,代码来源:prototype.php

示例2: read

 public function read($input)
 {
     $xfer = 0;
     $fname = null;
     $ftype = 0;
     $fid = 0;
     $xfer += $input->readStructBegin($fname);
     while (true) {
         $xfer += $input->readFieldBegin($fname, $ftype, $fid);
         if ($ftype == TType::STOP) {
             break;
         }
         switch ($fid) {
             case 0:
                 if ($ftype == TType::LST) {
                     $this->success = array();
                     $_size0 = 0;
                     $_etype3 = 0;
                     $xfer += $input->readListBegin($_etype3, $_size0);
                     for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
                         $elem5 = null;
                         $elem5 = new \Device();
                         $xfer += $elem5->read($input);
                         $this->success[] = $elem5;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
开发者ID:Rantelo,项目名称:Hackantonio,代码行数:39,代码来源:DeviceService.php


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