本文整理汇总了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;
示例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;
}