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


PHP Feed::get_meta方法代码示例

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


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

示例1: feed_controller


//.........这里部分代码省略.........
                                        $result = $feed->get_field($feedid, get('field'));
                                    } else {
                                        if ($route->action == "aget") {
                                            $result = $feed->get($feedid);
                                        } else {
                                            if ($route->action == 'histogram') {
                                                $result = $feed->histogram_get_power_vs_kwh($feedid, get('start'), get('end'));
                                            } else {
                                                if ($route->action == 'kwhatpower') {
                                                    $result = $feed->histogram_get_kwhd_atpower($feedid, get('min'), get('max'));
                                                } else {
                                                    if ($route->action == 'kwhatpowers') {
                                                        $result = $feed->histogram_get_kwhd_atpowers($feedid, get('points'));
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    // write session required
                    if (isset($session['write']) && $session['write'] && $session['userid'] > 0 && $f['userid'] == $session['userid']) {
                        // Storage engine agnostic
                        if ($route->action == 'set') {
                            $result = $feed->set_feed_fields($feedid, get('fields'));
                        } else {
                            if ($route->action == "insert") {
                                $result = $feed->insert_data($feedid, time(), get("time"), get("value"));
                            } else {
                                if ($route->action == "update") {
                                    $result = $feed->update_data($feedid, time(), get("time"), get('value'));
                                } else {
                                    if ($route->action == "delete") {
                                        $result = $feed->delete($feedid);
                                    } else {
                                        if ($route->action == "getmeta") {
                                            $result = $feed->get_meta($feedid);
                                        } else {
                                            if ($route->action == "csvexport") {
                                                $result = $feed->csv_export($feedid, get('start'), get('end'), get('interval'), get('timeformat'));
                                            } else {
                                                if ($route->action == "process") {
                                                    if ($f['engine'] != Engine::VIRTUALFEED) {
                                                        $result = array('success' => false, 'message' => 'Feed is not Virtual');
                                                    } else {
                                                        if ($route->subaction == "get") {
                                                            $result = $feed->get_processlist($feedid);
                                                        } else {
                                                            if ($route->subaction == "set") {
                                                                $result = $feed->set_processlist($feedid, post('processlist'));
                                                            } else {
                                                                if ($route->subaction == "reset") {
                                                                    $result = $feed->reset_processlist($feedid);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        if ($f['engine'] == Engine::MYSQL || $f['engine'] == Engine::MYSQLMEMORY) {
                            if ($route->action == "export") {
                                $result = $feed->mysqltimeseries_export($feedid, get('start'));
                            } else {
                                if ($route->action == "deletedatapoint") {
                                    $result = $feed->mysqltimeseries_delete_data_point($feedid, get('feedtime'));
                                } else {
                                    if ($route->action == "deletedatarange") {
                                        $result = $feed->mysqltimeseries_delete_data_range($feedid, get('start'), get('end'));
                                    }
                                }
                            }
                        } elseif ($f['engine'] == Engine::PHPTIMESERIES) {
                            if ($route->action == "export") {
                                $result = $feed->phptimeseries_export($feedid, get('start'));
                            }
                        } elseif ($f['engine'] == Engine::PHPFIWA) {
                            if ($route->action == "export") {
                                $result = $feed->phpfiwa_export($feedid, get('start'), get('layer'));
                            }
                        } elseif ($f['engine'] == Engine::PHPFINA) {
                            if ($route->action == "export") {
                                $result = $feed->phpfina_export($feedid, get('start'));
                            }
                        }
                    }
                } else {
                    $result = array('success' => false, 'message' => 'Feed does not exist');
                }
            }
        }
    }
    return array('content' => $result);
}
开发者ID:ashokbasnet,项目名称:emoncms,代码行数:101,代码来源:feed_controller.php

示例2: feed_controller


//.........这里部分代码省略.........
            // Actions that operate on a single existing feed that all use the feedid to select:
            // First we load the meta data for the feed that we want
            if ($feed->exist($feedid)) {
                $f = $feed->get($feedid);
                // if public or belongs to user
                if ($f['public'] || $session['userid'] > 0 && $f['userid'] == $session['userid'] && $session['read']) {
                    if ($route->action == "value") {
                        $result = $feed->get_value($feedid);
                    }
                    if ($route->action == "timevalue") {
                        $result = $feed->get_timevalue_seconds($feedid);
                    }
                    if ($route->action == "get") {
                        $result = $feed->get_field($feedid, get('field'));
                    }
                    // '/[^\w\s-]/'
                    if ($route->action == "aget") {
                        $result = $feed->get($feedid);
                    }
                    if ($route->action == 'histogram') {
                        $result = $feed->histogram_get_power_vs_kwh($feedid, get('start'), get('end'));
                    }
                    if ($route->action == 'kwhatpower') {
                        $result = $feed->histogram_get_kwhd_atpower($feedid, get('min'), get('max'));
                    }
                    if ($route->action == 'kwhatpowers') {
                        $result = $feed->histogram_get_kwhd_atpowers($feedid, get('points'));
                    }
                    if ($route->action == 'data') {
                        $result = $feed->get_data($feedid, get('start'), get('end'), get('dp'));
                    }
                    if ($route->action == 'average') {
                        $result = $feed->get_average($feedid, get('start'), get('end'), get('interval'));
                    }
                    if ($route->action == 'history') {
                        $result = $feed->get_history($feedid, get('start'), get('end'), get('interval'));
                    }
                }
                // write session required
                if (isset($session['write']) && $session['write'] && $session['userid'] > 0 && $f['userid'] == $session['userid']) {
                    // Storage engine agnostic
                    if ($route->action == 'set') {
                        $result = $feed->set_feed_fields($feedid, get('fields'));
                    }
                    if ($route->action == "insert") {
                        $result = $feed->insert_data($feedid, time(), get("time"), get("value"));
                    }
                    if ($route->action == "update") {
                        $result = $feed->update_data($feedid, time(), get("time"), get('value'));
                    }
                    if ($route->action == "delete") {
                        $result = $feed->delete($feedid);
                    }
                    if ($route->action == "getmeta") {
                        $result = $feed->get_meta($feedid);
                    }
                    if ($route->action == "csvexport") {
                        $feed->csv_export($feedid, get('start'), get('end'), get('interval'));
                    }
                    if ($f['engine'] == Engine::TIMESTORE) {
                        if ($route->action == "export") {
                            $result = $feed->timestore_export($feedid, get('start'), get('layer'));
                        }
                        if ($route->action == "exportmeta") {
                            $result = $feed->timestore_export_meta($feedid);
                        }
                        if ($route->action == "scalerange") {
                            $result = $feed->timestore_scale_range($feedid, get('start'), get('end'), get('value'));
                        }
                    } elseif ($f['engine'] == Engine::MYSQL) {
                        if ($route->action == "export") {
                            $result = $feed->mysqltimeseries_export($feedid, get('start'));
                        }
                        if ($route->action == "deletedatapoint") {
                            $result = $feed->mysqltimeseries_delete_data_point($feedid, get('feedtime'));
                        }
                        if ($route->action == "deletedatarange") {
                            $result = $feed->mysqltimeseries_delete_data_range($feedid, get('start'), get('end'));
                        }
                    } elseif ($f['engine'] == Engine::PHPTIMESERIES) {
                        if ($route->action == "export") {
                            $result = $feed->phptimeseries_export($feedid, get('start'));
                        }
                    } elseif ($f['engine'] == Engine::PHPFIWA) {
                        if ($route->action == "export") {
                            $result = $feed->phpfiwa_export($feedid, get('start'), get('layer'));
                        }
                    } elseif ($f['engine'] == Engine::PHPFINA) {
                        if ($route->action == "export") {
                            $result = $feed->phpfina_export($feedid, get('start'));
                        }
                    }
                }
            } else {
                $result = array('success' => false, 'message' => 'Feed does not exist');
            }
        }
    }
    return array('content' => $result);
}
开发者ID:barriquello,项目名称:simon,代码行数:101,代码来源:feed_controller.php


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