本文整理匯總了PHP中api::setAccesstoken方法的典型用法代碼示例。如果您正苦於以下問題:PHP api::setAccesstoken方法的具體用法?PHP api::setAccesstoken怎麽用?PHP api::setAccesstoken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類api
的用法示例。
在下文中一共展示了api::setAccesstoken方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: time
set_time_limit(0);
while (true) {
$now = time();
try {
if (!file_exists('includes.php')) {
throw new Exception("Include File not fountd");
} else {
require_once 'includes.php';
}
$api = new api();
$db = new db();
$users = new user($db);
$moves = new moves($api, $db);
$authorizedUsers = $users->getUsers();
foreach ($authorizedUsers as $user) {
$api->setAccesstoken($user['access_token']);
$moves->setUserID($user['user_id']);
$users->setUserID($user['user_id']);
$date = date("Y-m-d");
// If activity found today not to be duplicated
$activityFound = $users->hasActivityToday($date);
if ($activityFound > 0) {
$users->removeActivites($date);
}
$activites = $moves->getActivities('daily', $date);
$db->save($activites, 'activity');
}
} catch (Exception $e) {
echo "Message : " . $e->getMessage() . "<br>";
echo "Code : " . $e->getCode();
}