本文整理汇总了PHP中Env::displaySubscriptionDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP Env::displaySubscriptionDetails方法的具体用法?PHP Env::displaySubscriptionDetails怎么用?PHP Env::displaySubscriptionDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Env
的用法示例。
在下文中一共展示了Env::displaySubscriptionDetails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseDate
$push_definition = $env->user->createPushDefinition();
$push_definition->setOutputType($output_type);
// Now add the output_type-specific args from the command line
for ($i = 7; $i < count($env->args); $i++) {
$bits = explode('=', $env->args[$i], 2);
if (count($bits) != 2) {
usage('Invalid output_param: ' . $env->args[$i]);
}
$push_definition->setOutputParam($bits[0], $bits[1]);
}
// Subscribe the push definition to the historic query
$push_sub = $push_definition->subscribeHistoric($historic, $name);
// Start the historic
$historic->start();
// Display the details of the new subscription
$env->displaySubscriptionDetails($push_sub);
} catch (Exception $e) {
echo 'ERR: ' . get_class($e) . ' ' . $e->getMessage() . PHP_EOL;
}
/**
* Date string parser.
*
* @param string $date Date string.
*/
function parseDate($date)
{
if (strlen($date) != 14) {
usage('Invalid date: "' . $date . '"');
}
// Expand the date so strtotime can deal with it
return strtotime(substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2) . ' ' . substr($date, 8, 2) . ':' . substr($date, 10, 2) . ':' . substr($date, 12, 2));
示例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 displays the details of push subscriptions 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 subscription ID
if (count($env->args) == 0) {
die('Please specify at least one subscription ID!' . PHP_EOL);
}
// Cycle through the IDs passed on the command line
foreach ($env->args as $sub_id) {
try {
$sub = $env->user->getPushSubscription($sub_id);
$env->displaySubscriptionDetails($sub);
} catch (Exception $e) {
echo get_class($e) . ' ' . $e->getMessage() . PHP_EOL;
}
echo '--' . PHP_EOL;
}