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