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


PHP L::vdl方法代码示例

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


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

示例1: array

L::line("Where user is userfoo.", $watch->stop()->result(), ",", $subc->length(), "records");
// groupby
$watch->start();
$grouped = $collection->groupBy(function (OA $r) {
    return $r->username;
});
// count records in groups
$temp = $grouped->select(function (AL $c, $key) {
    return array("key" => $key, "count" => $c->length());
});
L::vdl($temp);
L::line("Grouped by username.", $watch->stop()->result());
// select
$watch->start();
L::vdl($grouped['userfoo']->select(function (OA $r) {
    return $r->uri;
}));
L::line("Select uris from userfoo.", $watch->stop()->result());
echo "\n";
// sum
$watch->start();
$sum = $collection->sum(function (OA $r) {
    return $r->bytes;
});
L::line("Sum of bytes:", $sum, $watch->stop()->result());
// avg
$watch->start();
$avg = $collection->avg(function (OA $r) {
    return $r->bytes;
});
L::line("Avg of bytes:", $avg, $watch->stop()->result());
开发者ID:perryflynn,项目名称:PerrysLambda,代码行数:31,代码来源:usage.php

示例2: array

    $columns[] = array(8, number_format($records->avg(function ($v) {
        return $v->outdoor->hudperc;
    }), 2) . "%");
    $columns[] = array(6, number_format($records->max(function ($v) {
        return $v->outdoor->hudperc;
    }), 2) . "%");
    echo columnline($columns);
}
// Last 15 minutes
$date = clone $list->last()->timestamp;
$date->modify("-15 minutes");
$lastminutes = $list->where(function (ObjectArray $o) use($date) {
    return $o->timestamp >= $date;
});
// Create JSON
$avg = array("date" => date('c'), "indoortemp" => $lastminutes->avg(function (ObjectArray $o) {
    return $o->indoor->tempc;
}), "outdoortemp" => $lastminutes->avg(function (ObjectArray $o) {
    return $o->outdoor->tempc;
}), "airhumidity" => $lastminutes->avg(function (ObjectArray $o) {
    return $o->outdoor->hudperc;
}), "pressure" => $lastminutes->avg(function (ObjectArray $o) {
    return $o->indoor->pressurehpa;
}), "brightness" => $lastminutes->avg(function (ObjectArray $o) {
    return $o->brightness->lux;
}));
echo "\n";
L::vdl($avg);
echo "\n";
L::line("Finished. Total time:", $total->stop()->result());
echo "\n";
开发者ID:perryflynn,项目名称:PerrysLambda,代码行数:31,代码来源:customparser.php


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