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


PHP Env::displayHistoricDetails方法代码示例

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


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

示例1: dirname

 * @copyright 2011 MediaSift Ltd.
 * @license   http://www.debian.org/misc/bsd.license BSD License (3 Clause)
 * @link      http://www.mediasift.com
 */
/**
 * This script views Historics queries in your account.
 *
 * NB: Most of the error handling (exception catching) has been removed for
 * the sake of simplicity. Nearly everything in this library may throw
 * exceptions, and production code should catch them. See the documentation
 * for full details.
 */
// Include the shared convenience class
require dirname(__FILE__) . '/env.php';
// Create the env object. This reads the command line arguments, creates the
// user object, and provides access to both along with helper functions
$env = new Env();
// Make sure we have at least one playback ID
if (count($env->args) == 0) {
    die('Please specify at least one playback ID!' . PHP_EOL);
}
// Cycle through the IDs passed on the command line
foreach ($env->args as $playback_id) {
    try {
        $hist = $env->user->getHistoric($playback_id);
        $env->displayHistoricDetails($hist);
    } catch (Exception $e) {
        echo get_class($e) . ' ' . $e->getMessage() . PHP_EOL;
    }
    echo '--' . PHP_EOL;
}
开发者ID:datasift,项目名称:datasift-php,代码行数:31,代码来源:view.php

示例2: dirname

 * @copyright 2011 MediaSift Ltd.
 * @license   http://www.debian.org/misc/bsd.license BSD License (3 Clause)
 * @link      http://www.mediasift.com
 */
/**
 * This script lists Historics queries in your account.
 *
 * NB: Most of the error handling (exception catching) has been removed for
 * the sake of simplicity. Nearly everything in this library may throw
 * exceptions, and production code should catch them. See the documentation
 * for full details.
 */
// Include the shared convenience class
require dirname(__FILE__) . '/env.php';
// Create the env object. This reads the command line arguments, creates the
// user object, and provides access to both along with helper functions
$env = new Env();
// Get historics
try {
    $historics = $env->user->listHistorics();
    if (count($historics['historics']) == 0) {
        echo 'No Historics exist in your account.' . PHP_EOL;
    } else {
        foreach ($historics['historics'] as $sub) {
            $env->displayHistoricDetails($sub);
            echo '--' . PHP_EOL;
        }
    }
} catch (Exception $e) {
    echo 'ERR: ' . get_class($e) . ' ' . $e->getMessage() . PHP_EOL;
}
开发者ID:datasift,项目名称:datasift-php,代码行数:31,代码来源:list.php


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