mirror of
https://github.com/friendica/friendica
synced 2024-11-13 01:02:53 +00:00
Add Temporal::utcNow()
This commit is contained in:
parent
38ff1b455b
commit
8aff8a76eb
51 changed files with 191 additions and 180 deletions
|
@ -460,7 +460,7 @@ function api_rss_extra(App $a, $arr, $user_info)
|
||||||
'self' => System::baseUrl() . "/" . $a->query_string,
|
'self' => System::baseUrl() . "/" . $a->query_string,
|
||||||
'base' => System::baseUrl(),
|
'base' => System::baseUrl(),
|
||||||
'updated' => api_date(null),
|
'updated' => api_date(null),
|
||||||
'atom_updated' => Temporal::convert('now', 'UTC', 'UTC', Temporal::ATOM),
|
'atom_updated' => Temporal::utcNow(Temporal::ATOM),
|
||||||
'language' => $user_info['language'],
|
'language' => $user_info['language'],
|
||||||
'logo' => System::baseUrl() . "/images/friendica-32.png",
|
'logo' => System::baseUrl() . "/images/friendica-32.png",
|
||||||
];
|
];
|
||||||
|
@ -4216,7 +4216,7 @@ function api_fr_photo_create_update($type)
|
||||||
$result = q(
|
$result = q(
|
||||||
"UPDATE `photo` SET %s, `edited`='%s' WHERE `uid` = %d AND `resource-id` = '%s' AND `album` = '%s'",
|
"UPDATE `photo` SET %s, `edited`='%s' WHERE `uid` = %d AND `resource-id` = '%s' AND `album` = '%s'",
|
||||||
$sql_extra,
|
$sql_extra,
|
||||||
Temporal::convert(), // update edited timestamp
|
Temporal::utcNow(), // update edited timestamp
|
||||||
intval(api_user()),
|
intval(api_user()),
|
||||||
dbesc($photo_id),
|
dbesc($photo_id),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
|
@ -4420,7 +4420,7 @@ function api_account_update_profile_image($type)
|
||||||
|
|
||||||
q(
|
q(
|
||||||
"UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
"UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ class dba {
|
||||||
|
|
||||||
if ($log) {
|
if ($log) {
|
||||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||||
@file_put_contents($a->config["system"]["db_log_index"], Temporal::convert()."\t".
|
@file_put_contents($a->config["system"]["db_log_index"], Temporal::utcNow()."\t".
|
||||||
$row['key']."\t".$row['rows']."\t".$row['Extra']."\t".
|
$row['key']."\t".$row['rows']."\t".$row['Extra']."\t".
|
||||||
basename($backtrace[1]["file"])."\t".
|
basename($backtrace[1]["file"])."\t".
|
||||||
$backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t".
|
$backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t".
|
||||||
|
@ -495,7 +495,7 @@ class dba {
|
||||||
$duration = round($duration, 3);
|
$duration = round($duration, 3);
|
||||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||||
|
|
||||||
@file_put_contents($a->config["system"]["db_log"], Temporal::convert()."\t".$duration."\t".
|
@file_put_contents($a->config["system"]["db_log"], Temporal::utcNow()."\t".$duration."\t".
|
||||||
basename($backtrace[1]["file"])."\t".
|
basename($backtrace[1]["file"])."\t".
|
||||||
$backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t".
|
$backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t".
|
||||||
substr(self::replace_parameters($sql, $args), 0, 2000)."\n", FILE_APPEND);
|
substr(self::replace_parameters($sql, $args), 0, 2000)."\n", FILE_APPEND);
|
||||||
|
|
|
@ -451,7 +451,7 @@ function notification($params)
|
||||||
$datarray['name_cache'] = strip_tags(bbcode($params['source_name']));
|
$datarray['name_cache'] = strip_tags(bbcode($params['source_name']));
|
||||||
$datarray['url'] = $params['source_link'];
|
$datarray['url'] = $params['source_link'];
|
||||||
$datarray['photo'] = $params['source_photo'];
|
$datarray['photo'] = $params['source_photo'];
|
||||||
$datarray['date'] = Temporal::convert();
|
$datarray['date'] = Temporal::utcNow();
|
||||||
$datarray['uid'] = $params['uid'];
|
$datarray['uid'] = $params['uid'];
|
||||||
$datarray['link'] = $itemlink;
|
$datarray['link'] = $itemlink;
|
||||||
$datarray['iid'] = $item_id;
|
$datarray['iid'] = $item_id;
|
||||||
|
|
|
@ -240,8 +240,8 @@ function event_store($arr) {
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$arr['created'] = (($arr['created']) ? $arr['created'] : Temporal::convert());
|
$arr['created'] = (($arr['created']) ? $arr['created'] : Temporal::utcNow());
|
||||||
$arr['edited'] = (($arr['edited']) ? $arr['edited'] : Temporal::convert());
|
$arr['edited'] = (($arr['edited']) ? $arr['edited'] : Temporal::utcNow());
|
||||||
$arr['type'] = (($arr['type']) ? $arr['type'] : 'event' );
|
$arr['type'] = (($arr['type']) ? $arr['type'] : 'event' );
|
||||||
$arr['cid'] = ((intval($arr['cid'])) ? intval($arr['cid']) : 0);
|
$arr['cid'] = ((intval($arr['cid'])) ? intval($arr['cid']) : 0);
|
||||||
$arr['uri'] = (x($arr, 'uri') ? $arr['uri'] : item_new_uri($a->get_hostname(), $arr['uid']));
|
$arr['uri'] = (x($arr, 'uri') ? $arr['uri'] : item_new_uri($a->get_hostname(), $arr['uid']));
|
||||||
|
|
|
@ -142,10 +142,10 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||||
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] . '"');
|
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] . '"');
|
||||||
|
|
||||||
if ($login_initial || $login_refresh) {
|
if ($login_initial || $login_refresh) {
|
||||||
dba::update('user', ['login_date' => Temporal::convert()], ['uid' => $_SESSION['uid']]);
|
dba::update('user', ['login_date' => Temporal::utcNow()], ['uid' => $_SESSION['uid']]);
|
||||||
|
|
||||||
// Set the login date for all identities of the user
|
// Set the login date for all identities of the user
|
||||||
dba::update('user', ['login_date' => Temporal::convert()],
|
dba::update('user', ['login_date' => Temporal::utcNow()],
|
||||||
['password' => $master_record['password'], 'email' => $master_record['email'], 'account_removed' => false]);
|
['password' => $master_record['password'], 'email' => $master_record['email'], 'account_removed' => false]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -723,7 +723,7 @@ function logger($msg, $level = 0) {
|
||||||
|
|
||||||
$callers = debug_backtrace();
|
$callers = debug_backtrace();
|
||||||
$logline = sprintf("%s@%s\t[%s]:%s:%s:%s\t%s\n",
|
$logline = sprintf("%s@%s\t[%s]:%s:%s:%s\t%s\n",
|
||||||
Temporal::convert('now', 'UTC', 'UTC', Temporal::ATOM),
|
Temporal::utcNow(Temporal::ATOM),
|
||||||
$process_id,
|
$process_id,
|
||||||
$LOGGER_LEVELS[$level],
|
$LOGGER_LEVELS[$level],
|
||||||
basename($callers[0]['file']),
|
basename($callers[0]['file']),
|
||||||
|
@ -789,7 +789,7 @@ function dlogger($msg, $level = 0) {
|
||||||
|
|
||||||
$callers = debug_backtrace();
|
$callers = debug_backtrace();
|
||||||
$logline = sprintf("%s@\t%s:\t%s:\t%s\t%s\t%s\n",
|
$logline = sprintf("%s@\t%s:\t%s:\t%s\t%s\t%s\n",
|
||||||
Temporal::convert(),
|
Temporal::utcNow(),
|
||||||
$process_id,
|
$process_id,
|
||||||
basename($callers[0]['file']),
|
basename($callers[0]['file']),
|
||||||
$callers[0]['line'],
|
$callers[0]['line'],
|
||||||
|
|
|
@ -740,7 +740,7 @@ function admin_page_summary(App $a)
|
||||||
if (!$last_worker_call) {
|
if (!$last_worker_call) {
|
||||||
$showwarning = true;
|
$showwarning = true;
|
||||||
$warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');
|
$warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');
|
||||||
} elseif ((strtotime(Temporal::convert()) - strtotime($last_worker_call)) > 60 * 60) {
|
} elseif ((strtotime(Temporal::utcNow()) - strtotime($last_worker_call)) > 60 * 60) {
|
||||||
$showwarning = true;
|
$showwarning = true;
|
||||||
$warningtext[] = L10n::t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.', $last_worker_call);
|
$warningtext[] = L10n::t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.', $last_worker_call);
|
||||||
}
|
}
|
||||||
|
|
|
@ -554,7 +554,7 @@ function contacts_content(App $a)
|
||||||
// tabs
|
// tabs
|
||||||
$tab_str = contacts_tab($a, $contact_id, 2);
|
$tab_str = contacts_tab($a, $contact_id, 2);
|
||||||
|
|
||||||
$lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < datetime_convert('', '', 'now')) ? L10n::t('Communications lost with this contact!') : '');
|
$lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < Temporal::utcNow()) ? L10n::t('Communications lost with this contact!') : '');
|
||||||
|
|
||||||
$fetch_further_information = null;
|
$fetch_further_information = null;
|
||||||
if ($contact['network'] == NETWORK_FEED) {
|
if ($contact['network'] == NETWORK_FEED) {
|
||||||
|
|
|
@ -327,8 +327,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
`network` = '%s' WHERE `id` = %d
|
`network` = '%s' WHERE `id` = %d
|
||||||
",
|
",
|
||||||
intval($new_relation),
|
intval($new_relation),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval($duplex),
|
intval($duplex),
|
||||||
intval($hidden),
|
intval($hidden),
|
||||||
dbesc(NETWORK_DFRN),
|
dbesc(NETWORK_DFRN),
|
||||||
|
@ -378,8 +378,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
`rel` = %d
|
`rel` = %d
|
||||||
WHERE `id` = %d
|
WHERE `id` = %d
|
||||||
",
|
",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($addr),
|
dbesc($addr),
|
||||||
dbesc($notify),
|
dbesc($notify),
|
||||||
dbesc($poll),
|
dbesc($poll),
|
||||||
|
@ -619,8 +619,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
`network` = '%s' WHERE `id` = %d
|
`network` = '%s' WHERE `id` = %d
|
||||||
",
|
",
|
||||||
intval($new_relation),
|
intval($new_relation),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval($duplex),
|
intval($duplex),
|
||||||
intval($forum),
|
intval($forum),
|
||||||
intval($prv),
|
intval($prv),
|
||||||
|
|
|
@ -137,7 +137,7 @@ function dfrn_request_post(App $a)
|
||||||
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `aes_allow`, `hidden`, `blocked`, `pending`)
|
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `aes_allow`, `hidden`, `blocked`, `pending`)
|
||||||
VALUES ( %d, '%s', '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d)",
|
VALUES ( %d, '%s', '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d)",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
Temporal::convert(),
|
Temporal::utcNow(),
|
||||||
dbesc($dfrn_url),
|
dbesc($dfrn_url),
|
||||||
dbesc(normalise_link($dfrn_url)),
|
dbesc(normalise_link($dfrn_url)),
|
||||||
$parms['addr'],
|
$parms['addr'],
|
||||||
|
@ -382,7 +382,7 @@ function dfrn_request_post(App $a)
|
||||||
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
|
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
|
||||||
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
|
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
$parms['url'],
|
$parms['url'],
|
||||||
dbesc(normalise_link($url)),
|
dbesc(normalise_link($url)),
|
||||||
$parms['addr'],
|
$parms['addr'],
|
||||||
|
@ -430,7 +430,7 @@ function dfrn_request_post(App $a)
|
||||||
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
|
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
|
||||||
dbesc(notags(trim($_POST['dfrn-request-message']))),
|
dbesc(notags(trim($_POST['dfrn-request-message']))),
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
dbesc(Temporal::convert())
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ function fsuggest_post(App $a)
|
||||||
dbesc($r[0]['request']),
|
dbesc($r[0]['request']),
|
||||||
dbesc($r[0]['photo']),
|
dbesc($r[0]['photo']),
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
dbesc(Temporal::convert())
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
$r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
|
|
|
@ -62,7 +62,7 @@ function invite_post(App $a)
|
||||||
|
|
||||||
$r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ",
|
$r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ",
|
||||||
dbesc($code),
|
dbesc($code),
|
||||||
dbesc(Temporal::convert())
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! is_site_admin()) {
|
if (! is_site_admin()) {
|
||||||
|
|
14
mod/item.php
14
mod/item.php
|
@ -601,11 +601,11 @@ function item_post(App $a) {
|
||||||
$datarray['author-link'] = $author['url'];
|
$datarray['author-link'] = $author['url'];
|
||||||
$datarray['author-avatar'] = $author['thumb'];
|
$datarray['author-avatar'] = $author['thumb'];
|
||||||
$datarray['author-id'] = Contact::getIdForURL($datarray['author-link'], 0);
|
$datarray['author-id'] = Contact::getIdForURL($datarray['author-link'], 0);
|
||||||
$datarray['created'] = Temporal::convert();
|
$datarray['created'] = Temporal::utcNow();
|
||||||
$datarray['edited'] = Temporal::convert();
|
$datarray['edited'] = Temporal::utcNow();
|
||||||
$datarray['commented'] = Temporal::convert();
|
$datarray['commented'] = Temporal::utcNow();
|
||||||
$datarray['received'] = Temporal::convert();
|
$datarray['received'] = Temporal::utcNow();
|
||||||
$datarray['changed'] = Temporal::convert();
|
$datarray['changed'] = Temporal::utcNow();
|
||||||
$datarray['extid'] = $extid;
|
$datarray['extid'] = $extid;
|
||||||
$datarray['guid'] = $guid;
|
$datarray['guid'] = $guid;
|
||||||
$datarray['uri'] = $uri;
|
$datarray['uri'] = $uri;
|
||||||
|
@ -709,8 +709,8 @@ function item_post(App $a) {
|
||||||
'file' => $datarray['file'],
|
'file' => $datarray['file'],
|
||||||
'rendered-html' => $datarray['rendered-html'],
|
'rendered-html' => $datarray['rendered-html'],
|
||||||
'rendered-hash' => $datarray['rendered-hash'],
|
'rendered-hash' => $datarray['rendered-hash'],
|
||||||
'edited' => Temporal::convert(),
|
'edited' => Temporal::utcNow(),
|
||||||
'changed' => Temporal::convert()];
|
'changed' => Temporal::utcNow()];
|
||||||
|
|
||||||
Item::update($fields, ['id' => $post_id]);
|
Item::update($fields, ['id' => $post_id]);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ function lostpass_post(App $a)
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'pwdreset' => $pwdreset_token,
|
'pwdreset' => $pwdreset_token,
|
||||||
'pwdreset_time' => Temporal::convert()
|
'pwdreset_time' => Temporal::utcNow()
|
||||||
];
|
];
|
||||||
$result = dba::update('user', $fields, ['uid' => $user['uid']]);
|
$result = dba::update('user', $fields, ['uid' => $user['uid']]);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|
|
@ -790,8 +790,8 @@ function networkThreadedView(App $a, $update = 0)
|
||||||
$top_limit = current($r)['order_date'];
|
$top_limit = current($r)['order_date'];
|
||||||
$bottom_limit = end($r)['order_date'];
|
$bottom_limit = end($r)['order_date'];
|
||||||
} else {
|
} else {
|
||||||
$top_limit = Temporal::convert();
|
$top_limit = Temporal::utcNow();
|
||||||
$bottom_limit = Temporal::convert();
|
$bottom_limit = Temporal::utcNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
// When checking for updates we need to fetch from the newest date to the newest date before
|
// When checking for updates we need to fetch from the newest date to the newest date before
|
||||||
|
@ -804,7 +804,7 @@ function networkThreadedView(App $a, $update = 0)
|
||||||
$top_limit = $last_date;
|
$top_limit = $last_date;
|
||||||
} elseif ($a->pager['page'] == 1) {
|
} elseif ($a->pager['page'] == 1) {
|
||||||
// Highest possible top limit when we are on the first page
|
// Highest possible top limit when we are on the first page
|
||||||
$top_limit = Temporal::convert();
|
$top_limit = Temporal::utcNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
$items = dba::p("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid` FROM `item`
|
$items = dba::p("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid` FROM `item`
|
||||||
|
|
|
@ -291,7 +291,7 @@ function photos_post(App $a)
|
||||||
if (DBM::is_result($r)) {
|
if (DBM::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($rr['parent-uri']),
|
dbesc($rr['parent-uri']),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
@ -364,8 +364,8 @@ function photos_post(App $a)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($i)) {
|
if (DBM::is_result($i)) {
|
||||||
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($i[0]['uri']),
|
dbesc($i[0]['uri']),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
@ -649,8 +649,8 @@ function photos_post(App $a)
|
||||||
$r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d",
|
$r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d",
|
||||||
dbesc($newtag),
|
dbesc($newtag),
|
||||||
dbesc($newinform),
|
dbesc($newinform),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval($item_id),
|
intval($item_id),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
@ -1361,7 +1361,7 @@ function photos_content(App $a)
|
||||||
$photo = [
|
$photo = [
|
||||||
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
||||||
'title'=> L10n::t('View Full Size'),
|
'title'=> L10n::t('View Full Size'),
|
||||||
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . Temporal::convert('now', 'UTC', 'UTC', 'ymdhis'),
|
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . Temporal::utcNow('ymdhis'),
|
||||||
'height' => $hires['height'],
|
'height' => $hires['height'],
|
||||||
'width' => $hires['width'],
|
'width' => $hires['width'],
|
||||||
'album' => $hires['album'],
|
'album' => $hires['album'],
|
||||||
|
|
|
@ -226,7 +226,7 @@ function ping_init(App $a)
|
||||||
ORDER BY `start` ASC ",
|
ORDER BY `start` ASC ",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc(Temporal::convert('now + 7 days')),
|
dbesc(Temporal::convert('now + 7 days')),
|
||||||
dbesc(Temporal::convert('now'))
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($ev)) {
|
if (DBM::is_result($ev)) {
|
||||||
Cache::set($cachekey, $ev, CACHE_HOUR);
|
Cache::set($cachekey, $ev, CACHE_HOUR);
|
||||||
|
|
|
@ -130,7 +130,7 @@ function profile_photo_post(App $a) {
|
||||||
// so that browsers will do a cache update unconditionally
|
// so that browsers will do a cache update unconditionally
|
||||||
|
|
||||||
$r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
$r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ function profile_photo_content(App $a) {
|
||||||
);
|
);
|
||||||
|
|
||||||
$r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
$r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -487,7 +487,7 @@ function profiles_post(App $a) {
|
||||||
if ($namechanged && $is_default) {
|
if ($namechanged && $is_default) {
|
||||||
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
||||||
dbesc($name),
|
dbesc($name),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
$r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
|
$r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
|
||||||
|
|
|
@ -188,7 +188,7 @@ function proxy_init(App $a) {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => Temporal::convert(), 'edited' => Temporal::convert(),
|
$fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => Temporal::utcNow(), 'edited' => Temporal::utcNow(),
|
||||||
'filename' => basename($_REQUEST['url']), 'type' => '', 'album' => '', 'height' => imagesy($image), 'width' => imagesx($image),
|
'filename' => basename($_REQUEST['url']), 'type' => '', 'album' => '', 'height' => imagesy($image), 'width' => imagesx($image),
|
||||||
'datasize' => 0, 'data' => $img_str, 'scale' => 100, 'profile' => 0,
|
'datasize' => 0, 'data' => $img_str, 'scale' => 100, 'profile' => 0,
|
||||||
'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime];
|
'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime];
|
||||||
|
|
|
@ -139,7 +139,7 @@ function pubsubhubbub_init(App $a) {
|
||||||
dbesc($hub_callback));
|
dbesc($hub_callback));
|
||||||
|
|
||||||
if ($subscribe) {
|
if ($subscribe) {
|
||||||
$last_update = Temporal::convert();
|
$last_update = Temporal::utcNow();
|
||||||
$push_flag = 0;
|
$push_flag = 0;
|
||||||
|
|
||||||
// if we are just updating an old subscription, keep the
|
// if we are just updating an old subscription, keep the
|
||||||
|
|
|
@ -118,7 +118,7 @@ function register_post(App $a)
|
||||||
$hash = random_string();
|
$hash = random_string();
|
||||||
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language`, `note` ) VALUES ( '%s', '%s', %d, '%s', '%s', '%s' ) ",
|
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language`, `note` ) VALUES ( '%s', '%s', %d, '%s', '%s', '%s' ) ",
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval($user['uid']),
|
intval($user['uid']),
|
||||||
dbesc($result['password']),
|
dbesc($result['password']),
|
||||||
dbesc($lang),
|
dbesc($lang),
|
||||||
|
|
|
@ -631,7 +631,7 @@ function settings_post(App $a)
|
||||||
if ($name_change) {
|
if ($name_change) {
|
||||||
q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self`",
|
q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self`",
|
||||||
dbesc($username),
|
dbesc($username),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,8 +170,8 @@ function videos_post(App $a) {
|
||||||
//echo "<pre>"; var_dump($i); killme();
|
//echo "<pre>"; var_dump($i); killme();
|
||||||
if (DBM::is_result($i)) {
|
if (DBM::is_result($i)) {
|
||||||
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($i[0]['uri']),
|
dbesc($i[0]['uri']),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
|
@ -124,7 +124,7 @@ function wall_attach_post(App $a) {
|
||||||
$filedata = @file_get_contents($src);
|
$filedata = @file_get_contents($src);
|
||||||
$mimetype = Mimetype::getContentType($filename);
|
$mimetype = Mimetype::getContentType($filename);
|
||||||
$hash = get_guid(64);
|
$hash = get_guid(64);
|
||||||
$created = Temporal::convert();
|
$created = Temporal::utcNow();
|
||||||
|
|
||||||
$fields = ['uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
|
$fields = ['uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
|
||||||
'filesize' => $filesize, 'data' => $filedata, 'created' => $created, 'edited' => $created,
|
'filesize' => $filesize, 'data' => $filedata, 'created' => $created, 'edited' => $created,
|
||||||
|
|
|
@ -113,7 +113,7 @@ class OEmbed
|
||||||
'url' => normalise_link($embedurl),
|
'url' => normalise_link($embedurl),
|
||||||
'maxwidth' => $a->videowidth,
|
'maxwidth' => $a->videowidth,
|
||||||
'content' => $txt,
|
'content' => $txt,
|
||||||
'created' => Temporal::convert()
|
'created' => Temporal::utcNow()
|
||||||
], true);
|
], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ class Cache
|
||||||
$memcache->set(get_app()->get_hostname().":".$key, serialize($value), MEMCACHE_COMPRESSED, self::duration($duration));
|
$memcache->set(get_app()->get_hostname().":".$key, serialize($value), MEMCACHE_COMPRESSED, self::duration($duration));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$fields = ['v' => serialize($value), 'expire_mode' => $duration, 'updated' => Temporal::convert()];
|
$fields = ['v' => serialize($value), 'expire_mode' => $duration, 'updated' => Temporal::utcNow()];
|
||||||
$condition = ['k' => $key];
|
$condition = ['k' => $key];
|
||||||
dba::update('cache', $fields, $condition, true);
|
dba::update('cache', $fields, $condition, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,7 +235,7 @@ class Worker
|
||||||
|
|
||||||
if ($age > 1) {
|
if ($age > 1) {
|
||||||
$stamp = (float)microtime(true);
|
$stamp = (float)microtime(true);
|
||||||
dba::update('workerqueue', ['executed' => Temporal::convert()], ['pid' => $mypid, 'done' => false]);
|
dba::update('workerqueue', ['executed' => Temporal::utcNow()], ['pid' => $mypid, 'done' => false]);
|
||||||
self::$db_duration += (microtime(true) - $stamp);
|
self::$db_duration += (microtime(true) - $stamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ class Worker
|
||||||
|
|
||||||
$stamp = (float)microtime(true);
|
$stamp = (float)microtime(true);
|
||||||
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
|
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
|
||||||
Config::set('system', 'last_poller_execution', Temporal::convert());
|
Config::set('system', 'last_poller_execution', Temporal::utcNow());
|
||||||
}
|
}
|
||||||
self::$db_duration = (microtime(true) - $stamp);
|
self::$db_duration = (microtime(true) - $stamp);
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ class Worker
|
||||||
|
|
||||||
if ($age > 1) {
|
if ($age > 1) {
|
||||||
$stamp = (float)microtime(true);
|
$stamp = (float)microtime(true);
|
||||||
dba::update('workerqueue', ['executed' => Temporal::convert()], ['pid' => $mypid, 'done' => false]);
|
dba::update('workerqueue', ['executed' => Temporal::utcNow()], ['pid' => $mypid, 'done' => false]);
|
||||||
self::$db_duration += (microtime(true) - $stamp);
|
self::$db_duration += (microtime(true) - $stamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ class Worker
|
||||||
|
|
||||||
$stamp = (float)microtime(true);
|
$stamp = (float)microtime(true);
|
||||||
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
|
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
|
||||||
Config::set('system', 'last_poller_execution', Temporal::convert());
|
Config::set('system', 'last_poller_execution', Temporal::utcNow());
|
||||||
}
|
}
|
||||||
self::$db_duration = (microtime(true) - $stamp);
|
self::$db_duration = (microtime(true) - $stamp);
|
||||||
} else {
|
} else {
|
||||||
|
@ -574,7 +574,7 @@ class Worker
|
||||||
}
|
}
|
||||||
dba::update(
|
dba::update(
|
||||||
'workerqueue',
|
'workerqueue',
|
||||||
['executed' => NULL_DATE, 'created' => Temporal::convert(), 'priority' => $new_priority, 'pid' => 0],
|
['executed' => NULL_DATE, 'created' => Temporal::utcNow(), 'priority' => $new_priority, 'pid' => 0],
|
||||||
['id' => $entry["id"]]
|
['id' => $entry["id"]]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -825,7 +825,7 @@ class Worker
|
||||||
if ($found) {
|
if ($found) {
|
||||||
$condition = "`id` IN (".substr(str_repeat("?, ", count($ids)), 0, -2).") AND `pid` = 0 AND NOT `done`";
|
$condition = "`id` IN (".substr(str_repeat("?, ", count($ids)), 0, -2).") AND `pid` = 0 AND NOT `done`";
|
||||||
array_unshift($ids, $condition);
|
array_unshift($ids, $condition);
|
||||||
dba::update('workerqueue', ['executed' => Temporal::convert(), 'pid' => $mypid], $ids);
|
dba::update('workerqueue', ['executed' => Temporal::utcNow(), 'pid' => $mypid], $ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $found;
|
return $found;
|
||||||
|
@ -1040,7 +1040,7 @@ class Worker
|
||||||
|
|
||||||
$priority = PRIORITY_MEDIUM;
|
$priority = PRIORITY_MEDIUM;
|
||||||
$dont_fork = Config::get("system", "worker_dont_fork");
|
$dont_fork = Config::get("system", "worker_dont_fork");
|
||||||
$created = Temporal::convert();
|
$created = Temporal::utcNow();
|
||||||
|
|
||||||
if (is_int($run_parameter)) {
|
if (is_int($run_parameter)) {
|
||||||
$priority = $run_parameter;
|
$priority = $run_parameter;
|
||||||
|
|
|
@ -126,6 +126,6 @@ class DBM
|
||||||
$timestamp = -62135596800;
|
$timestamp = -62135596800;
|
||||||
}
|
}
|
||||||
|
|
||||||
return date('Y-m-d H:i:s', (int)$timestamp);
|
return date(Temporal::MYSQL, (int)$timestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ class Contact extends BaseObject
|
||||||
|
|
||||||
$return = dba::insert('contact', [
|
$return = dba::insert('contact', [
|
||||||
'uid' => $user['uid'],
|
'uid' => $user['uid'],
|
||||||
'created' => Temporal::convert(),
|
'created' => Temporal::utcNow(),
|
||||||
'self' => 1,
|
'self' => 1,
|
||||||
'name' => $user['username'],
|
'name' => $user['username'],
|
||||||
'nick' => $user['nickname'],
|
'nick' => $user['nickname'],
|
||||||
|
@ -129,9 +129,9 @@ class Contact extends BaseObject
|
||||||
'poll' => System::baseUrl() . '/dfrn_poll/' . $user['nickname'],
|
'poll' => System::baseUrl() . '/dfrn_poll/' . $user['nickname'],
|
||||||
'confirm' => System::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
|
'confirm' => System::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
|
||||||
'poco' => System::baseUrl() . '/poco/' . $user['nickname'],
|
'poco' => System::baseUrl() . '/poco/' . $user['nickname'],
|
||||||
'name-date' => Temporal::convert(),
|
'name-date' => Temporal::utcNow(),
|
||||||
'uri-date' => Temporal::convert(),
|
'uri-date' => Temporal::utcNow(),
|
||||||
'avatar-date' => Temporal::convert(),
|
'avatar-date' => Temporal::utcNow(),
|
||||||
'closeness' => 0
|
'closeness' => 0
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -210,10 +210,10 @@ class Contact extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact['term-date'] <= NULL_DATE) {
|
if ($contact['term-date'] <= NULL_DATE) {
|
||||||
dba::update('contact', ['term-date' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['term-date' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
|
|
||||||
if ($contact['url'] != '') {
|
if ($contact['url'] != '') {
|
||||||
dba::update('contact', ['term-date' => Temporal::convert()], ['`nurl` = ? AND `term-date` <= ? AND NOT `self`', normalise_link($contact['url']), NULL_DATE]);
|
dba::update('contact', ['term-date' => Temporal::utcNow()], ['`nurl` = ? AND `term-date` <= ? AND NOT `self`', normalise_link($contact['url']), NULL_DATE]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* @todo
|
/* @todo
|
||||||
|
@ -224,7 +224,7 @@ class Contact extends BaseObject
|
||||||
|
|
||||||
/// @todo Check for contact vitality via probing
|
/// @todo Check for contact vitality via probing
|
||||||
$expiry = $contact['term-date'] . ' + 32 days ';
|
$expiry = $contact['term-date'] . ' + 32 days ';
|
||||||
if (Temporal::convert() > Temporal::convert($expiry)) {
|
if (Temporal::utcNow() > Temporal::convert($expiry)) {
|
||||||
/* Relationship is really truly dead. archive them rather than
|
/* Relationship is really truly dead. archive them rather than
|
||||||
* delete, though if the owner tries to unarchive them we'll start
|
* delete, though if the owner tries to unarchive them we'll start
|
||||||
* the whole process over again.
|
* the whole process over again.
|
||||||
|
@ -728,7 +728,7 @@ class Contact extends BaseObject
|
||||||
if (!$contact_id) {
|
if (!$contact_id) {
|
||||||
dba::insert('contact', [
|
dba::insert('contact', [
|
||||||
'uid' => $uid,
|
'uid' => $uid,
|
||||||
'created' => Temporal::convert(),
|
'created' => Temporal::utcNow(),
|
||||||
'url' => $data["url"],
|
'url' => $data["url"],
|
||||||
'nurl' => normalise_link($data["url"]),
|
'nurl' => normalise_link($data["url"]),
|
||||||
'addr' => $data["addr"],
|
'addr' => $data["addr"],
|
||||||
|
@ -749,9 +749,9 @@ class Contact extends BaseObject
|
||||||
'request' => $data["request"],
|
'request' => $data["request"],
|
||||||
'confirm' => $data["confirm"],
|
'confirm' => $data["confirm"],
|
||||||
'poco' => $data["poco"],
|
'poco' => $data["poco"],
|
||||||
'name-date' => Temporal::convert(),
|
'name-date' => Temporal::utcNow(),
|
||||||
'uri-date' => Temporal::convert(),
|
'uri-date' => Temporal::utcNow(),
|
||||||
'avatar-date' => Temporal::convert(),
|
'avatar-date' => Temporal::utcNow(),
|
||||||
'writable' => 1,
|
'writable' => 1,
|
||||||
'blocked' => 0,
|
'blocked' => 0,
|
||||||
'readonly' => 0,
|
'readonly' => 0,
|
||||||
|
@ -823,13 +823,13 @@ class Contact extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {
|
if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {
|
||||||
$updated['uri-date'] = Temporal::convert();
|
$updated['uri-date'] = Temporal::utcNow();
|
||||||
}
|
}
|
||||||
if (($data["name"] != $contact["name"]) || ($data["nick"] != $contact["nick"])) {
|
if (($data["name"] != $contact["name"]) || ($data["nick"] != $contact["nick"])) {
|
||||||
$updated['name-date'] = Temporal::convert();
|
$updated['name-date'] = Temporal::utcNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
$updated['avatar-date'] = Temporal::convert();
|
$updated['avatar-date'] = Temporal::utcNow();
|
||||||
|
|
||||||
dba::update('contact', $updated, ['id' => $contact_id], $contact);
|
dba::update('contact', $updated, ['id' => $contact_id], $contact);
|
||||||
|
|
||||||
|
@ -1026,7 +1026,7 @@ class Contact extends BaseObject
|
||||||
if ($photos) {
|
if ($photos) {
|
||||||
dba::update(
|
dba::update(
|
||||||
'contact',
|
'contact',
|
||||||
['avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => Temporal::convert()],
|
['avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => Temporal::utcNow()],
|
||||||
['id' => $cid]
|
['id' => $cid]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1261,7 +1261,7 @@ class Contact extends BaseObject
|
||||||
// create contact record
|
// create contact record
|
||||||
dba::insert('contact', [
|
dba::insert('contact', [
|
||||||
'uid' => $uid,
|
'uid' => $uid,
|
||||||
'created' => Temporal::convert(),
|
'created' => Temporal::utcNow(),
|
||||||
'url' => $ret['url'],
|
'url' => $ret['url'],
|
||||||
'nurl' => normalise_link($ret['url']),
|
'nurl' => normalise_link($ret['url']),
|
||||||
'addr' => $ret['addr'],
|
'addr' => $ret['addr'],
|
||||||
|
@ -1485,7 +1485,7 @@ class Contact extends BaseObject
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
logger('update_contact_birthday: ' . $rr['bd']);
|
logger('update_contact_birthday: ' . $rr['bd']);
|
||||||
|
|
||||||
$nextbd = Temporal::convert('now', 'UTC', 'UTC', 'Y') . substr($rr['bd'], 4);
|
$nextbd = Temporal::convert('Y') . substr($rr['bd'], 4);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add new birthday event for this person
|
* Add new birthday event for this person
|
||||||
|
@ -1508,7 +1508,7 @@ class Contact extends BaseObject
|
||||||
|
|
||||||
q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`)
|
q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`)
|
||||||
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ", intval($rr['uid']), intval($rr['id']),
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ", intval($rr['uid']), intval($rr['id']),
|
||||||
dbesc(Temporal::convert()), dbesc(Temporal::convert()), dbesc(Temporal::convert($nextbd)),
|
dbesc(Temporal::utcNow()), dbesc(Temporal::utcNow()), dbesc(Temporal::convert($nextbd)),
|
||||||
dbesc(Temporal::convert($nextbd . ' + 1 day ')), dbesc($bdtext), dbesc($bdtext2), dbesc('birthday'),
|
dbesc(Temporal::convert($nextbd . ' + 1 day ')), dbesc($bdtext), dbesc($bdtext2), dbesc('birthday'),
|
||||||
intval(0)
|
intval(0)
|
||||||
);
|
);
|
||||||
|
|
|
@ -120,12 +120,12 @@ class GContact
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($gcid),
|
intval($gcid),
|
||||||
intval($zcid),
|
intval($zcid),
|
||||||
dbesc(Temporal::convert())
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
q(
|
q(
|
||||||
"UPDATE `glink` SET `updated` = '%s' WHERE `cid` = %d AND `uid` = %d AND `gcid` = %d AND `zcid` = %d",
|
"UPDATE `glink` SET `updated` = '%s' WHERE `cid` = %d AND `uid` = %d AND `gcid` = %d AND `zcid` = %d",
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval($cid),
|
intval($cid),
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($gcid),
|
intval($gcid),
|
||||||
|
@ -717,8 +717,8 @@ class GContact
|
||||||
dbesc($contact["url"]),
|
dbesc($contact["url"]),
|
||||||
dbesc(normalise_link($contact["url"])),
|
dbesc(normalise_link($contact["url"])),
|
||||||
dbesc($contact["photo"]),
|
dbesc($contact["photo"]),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($contact["location"]),
|
dbesc($contact["location"]),
|
||||||
dbesc($contact["about"]),
|
dbesc($contact["about"]),
|
||||||
intval($contact["hide"]),
|
intval($contact["hide"]),
|
||||||
|
@ -1050,7 +1050,7 @@ class GContact
|
||||||
|
|
||||||
foreach ($r as $server) {
|
foreach ($r as $server) {
|
||||||
self::fetchGsUsers($server["url"]);
|
self::fetchGsUsers($server["url"]);
|
||||||
q("UPDATE `gserver` SET `last_poco_query` = '%s' WHERE `nurl` = '%s'", dbesc(Temporal::convert()), dbesc($server["nurl"]));
|
q("UPDATE `gserver` SET `last_poco_query` = '%s' WHERE `nurl` = '%s'", dbesc(Temporal::utcNow()), dbesc($server["nurl"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ class Item extends BaseObject
|
||||||
|
|
||||||
// Set the item to "deleted"
|
// Set the item to "deleted"
|
||||||
dba::update('item', ['deleted' => true, 'title' => '', 'body' => '',
|
dba::update('item', ['deleted' => true, 'title' => '', 'body' => '',
|
||||||
'edited' => Temporal::convert(), 'changed' => Temporal::convert()],
|
'edited' => Temporal::utcNow(), 'changed' => Temporal::utcNow()],
|
||||||
['id' => $item['id']]);
|
['id' => $item['id']]);
|
||||||
|
|
||||||
create_tags_from_item($item['id']);
|
create_tags_from_item($item['id']);
|
||||||
|
|
|
@ -82,7 +82,7 @@ class Mail
|
||||||
$handles = $recip_handle . ';' . $sender_handle;
|
$handles = $recip_handle . ';' . $sender_handle;
|
||||||
|
|
||||||
$fields = ['uid' => local_user(), 'guid' => $conv_guid, 'creator' => $sender_handle,
|
$fields = ['uid' => local_user(), 'guid' => $conv_guid, 'creator' => $sender_handle,
|
||||||
'created' => Temporal::convert(), 'updated' => Temporal::convert(),
|
'created' => Temporal::utcNow(), 'updated' => Temporal::utcNow(),
|
||||||
'subject' => $subject, 'recips' => $handles];
|
'subject' => $subject, 'recips' => $handles];
|
||||||
if (dba::insert('conv', $fields)) {
|
if (dba::insert('conv', $fields)) {
|
||||||
$convid = dba::lastInsertId();
|
$convid = dba::lastInsertId();
|
||||||
|
@ -116,7 +116,7 @@ class Mail
|
||||||
'replied' => 0,
|
'replied' => 0,
|
||||||
'uri' => $uri,
|
'uri' => $uri,
|
||||||
'parent-uri' => $replyto,
|
'parent-uri' => $replyto,
|
||||||
'created' => Temporal::convert()
|
'created' => Temporal::utcNow()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ class Mail
|
||||||
|
|
||||||
$convid = null;
|
$convid = null;
|
||||||
$fields = ['uid' => $recipient['uid'], 'guid' => $conv_guid, 'creator' => $sender_handle,
|
$fields = ['uid' => $recipient['uid'], 'guid' => $conv_guid, 'creator' => $sender_handle,
|
||||||
'created' => Temporal::convert(), 'updated' => Temporal::convert(),
|
'created' => Temporal::utcNow(), 'updated' => Temporal::utcNow(),
|
||||||
'subject' => $subject, 'recips' => $handles];
|
'subject' => $subject, 'recips' => $handles];
|
||||||
if (dba::insert('conv', $fields)) {
|
if (dba::insert('conv', $fields)) {
|
||||||
$convid = dba::lastInsertId();
|
$convid = dba::lastInsertId();
|
||||||
|
@ -224,7 +224,7 @@ class Mail
|
||||||
'replied' => 0,
|
'replied' => 0,
|
||||||
'uri' => $uri,
|
'uri' => $uri,
|
||||||
'parent-uri' => $replyto,
|
'parent-uri' => $replyto,
|
||||||
'created' => Temporal::convert(),
|
'created' => Temporal::utcNow(),
|
||||||
'unknown' => 1
|
'unknown' => 1
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
@ -55,8 +55,8 @@ class Photo
|
||||||
'contact-id' => $cid,
|
'contact-id' => $cid,
|
||||||
'guid' => $guid,
|
'guid' => $guid,
|
||||||
'resource-id' => $rid,
|
'resource-id' => $rid,
|
||||||
'created' => Temporal::convert(),
|
'created' => Temporal::utcNow(),
|
||||||
'edited' => Temporal::convert(),
|
'edited' => Temporal::utcNow(),
|
||||||
'filename' => basename($filename),
|
'filename' => basename($filename),
|
||||||
'type' => $Image->getType(),
|
'type' => $Image->getType(),
|
||||||
'album' => $album,
|
'album' => $album,
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Process extends BaseObject
|
||||||
dba::transaction();
|
dba::transaction();
|
||||||
|
|
||||||
if (!dba::exists('process', ['pid' => $pid])) {
|
if (!dba::exists('process', ['pid' => $pid])) {
|
||||||
$return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => Temporal::convert()]);
|
$return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => Temporal::utcNow()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
dba::commit();
|
dba::commit();
|
||||||
|
|
|
@ -557,7 +557,7 @@ class Profile
|
||||||
ORDER BY `start` ASC ",
|
ORDER BY `start` ASC ",
|
||||||
local_user(),
|
local_user(),
|
||||||
Temporal::convert('now + 6 days'),
|
Temporal::convert('now + 6 days'),
|
||||||
Temporal::convert('now')
|
Temporal::utcNow()
|
||||||
);
|
);
|
||||||
if (DBM::is_result($s)) {
|
if (DBM::is_result($s)) {
|
||||||
$r = dba::inArray($s);
|
$r = dba::inArray($s);
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Queue
|
||||||
public static function updateTime($id)
|
public static function updateTime($id)
|
||||||
{
|
{
|
||||||
logger('queue: requeue item ' . $id);
|
logger('queue: requeue item ' . $id);
|
||||||
dba::update('queue', ['last' => Temporal::convert()], ['id' => $id]);
|
dba::update('queue', ['last' => Temporal::utcNow()], ['id' => $id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,6 +95,6 @@ class Queue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dba::insert('queue', ['cid' => $cid, 'network' => $network, 'created' => Temporal::convert(), 'last' => Temporal::convert(), 'content' => $msg, 'batch' =>($batch) ? 1 : 0]);
|
dba::insert('queue', ['cid' => $cid, 'network' => $network, 'created' => Temporal::utcNow(), 'last' => Temporal::utcNow(), 'content' => $msg, 'batch' =>($batch) ? 1 : 0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,7 +396,7 @@ class User
|
||||||
'verified' => $verified,
|
'verified' => $verified,
|
||||||
'blocked' => $blocked,
|
'blocked' => $blocked,
|
||||||
'timezone' => 'UTC',
|
'timezone' => 'UTC',
|
||||||
'register_date' => Temporal::convert(),
|
'register_date' => Temporal::utcNow(),
|
||||||
'default-location' => ''
|
'default-location' => ''
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -613,7 +613,7 @@ class User
|
||||||
dba::insert('userd', ['username' => $user['nickname']]);
|
dba::insert('userd', ['username' => $user['nickname']]);
|
||||||
|
|
||||||
// The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
|
// The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
|
||||||
dba::update('user', ['account_removed' => true, 'account_expires_on' => Temporal::convert()], ['uid' => $uid]);
|
dba::update('user', ['account_removed' => true, 'account_expires_on' => Temporal::utcNow()], ['uid' => $uid]);
|
||||||
Worker::add(PRIORITY_HIGH, "Notifier", "removeme", $uid);
|
Worker::add(PRIORITY_HIGH, "Notifier", "removeme", $uid);
|
||||||
|
|
||||||
// Send an update to the directory
|
// Send an update to the directory
|
||||||
|
|
|
@ -121,7 +121,7 @@ class Login extends BaseModule
|
||||||
|
|
||||||
// if we haven't failed up this point, log them in.
|
// if we haven't failed up this point, log them in.
|
||||||
$_SESSION['remember'] = $_POST['remember'];
|
$_SESSION['remember'] = $_POST['remember'];
|
||||||
$_SESSION['last_login_date'] = Temporal::convert();
|
$_SESSION['last_login_date'] = Temporal::utcNow();
|
||||||
authenticate_success($record, true, true);
|
authenticate_success($record, true, true);
|
||||||
|
|
||||||
if (x($_SESSION, 'return_url')) {
|
if (x($_SESSION, 'return_url')) {
|
||||||
|
@ -220,10 +220,10 @@ class Login extends BaseModule
|
||||||
// stays logged in for a long time, e.g. with "Remember Me"
|
// stays logged in for a long time, e.g. with "Remember Me"
|
||||||
$login_refresh = false;
|
$login_refresh = false;
|
||||||
if (!x($_SESSION['last_login_date'])) {
|
if (!x($_SESSION['last_login_date'])) {
|
||||||
$_SESSION['last_login_date'] = Temporal::convert();
|
$_SESSION['last_login_date'] = Temporal::utcNow();
|
||||||
}
|
}
|
||||||
if (strcmp(Temporal::convert('now - 12 hours'), $_SESSION['last_login_date']) > 0) {
|
if (strcmp(Temporal::convert('now - 12 hours'), $_SESSION['last_login_date']) > 0) {
|
||||||
$_SESSION['last_login_date'] = Temporal::convert();
|
$_SESSION['last_login_date'] = Temporal::utcNow();
|
||||||
$login_refresh = true;
|
$login_refresh = true;
|
||||||
}
|
}
|
||||||
authenticate_success($user, false, false, $login_refresh);
|
authenticate_success($user, false, false, $login_refresh);
|
||||||
|
|
|
@ -68,7 +68,7 @@ class FKOAuth1 extends OAuthServer
|
||||||
$_SESSION['cid'] = $a->cid;
|
$_SESSION['cid'] = $a->cid;
|
||||||
}
|
}
|
||||||
|
|
||||||
dba::update('user', ['login_date' => Temporal::convert()], ['uid' => $_SESSION['uid']]);
|
dba::update('user', ['login_date' => Temporal::utcNow()], ['uid' => $_SESSION['uid']]);
|
||||||
|
|
||||||
Addon::callHooks('logged_in', $a->user);
|
Addon::callHooks('logged_in', $a->user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1406,8 +1406,8 @@ class DFRN
|
||||||
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
|
||||||
intval($contact["uid"]),
|
intval($contact["uid"]),
|
||||||
intval($contact["id"]),
|
intval($contact["id"]),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert($birthday)),
|
dbesc(Temporal::convert($birthday)),
|
||||||
dbesc(Temporal::convert($birthday . " + 1 day ")),
|
dbesc(Temporal::convert($birthday . " + 1 day ")),
|
||||||
dbesc($bdtext),
|
dbesc($bdtext),
|
||||||
|
@ -1889,7 +1889,7 @@ class DFRN
|
||||||
intval($suggest["cid"]),
|
intval($suggest["cid"]),
|
||||||
dbesc($suggest["body"]),
|
dbesc($suggest["body"]),
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval(0)
|
intval(0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2086,7 +2086,7 @@ class DFRN
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['title' => $item["title"], 'body' => $item["body"],
|
$fields = ['title' => $item["title"], 'body' => $item["body"],
|
||||||
'tag' => $item["tag"], 'changed' => Temporal::convert(),
|
'tag' => $item["tag"], 'changed' => Temporal::utcNow(),
|
||||||
'edited' => Temporal::convert($item["edited"])];
|
'edited' => Temporal::convert($item["edited"])];
|
||||||
|
|
||||||
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
|
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
|
||||||
|
@ -2836,7 +2836,7 @@ class DFRN
|
||||||
`body` = '', `title` = ''
|
`body` = '', `title` = ''
|
||||||
WHERE `parent-uri` = '%s' AND `uid` IN (0, %d)",
|
WHERE `parent-uri` = '%s' AND `uid` IN (0, %d)",
|
||||||
dbesc($when),
|
dbesc($when),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($uri),
|
dbesc($uri),
|
||||||
intval($importer["uid"])
|
intval($importer["uid"])
|
||||||
);
|
);
|
||||||
|
@ -2849,7 +2849,7 @@ class DFRN
|
||||||
`body` = '', `title` = ''
|
`body` = '', `title` = ''
|
||||||
WHERE `uri` = '%s' AND `uid` IN (0, %d)",
|
WHERE `uri` = '%s' AND `uid` IN (0, %d)",
|
||||||
dbesc($when),
|
dbesc($when),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($uri),
|
dbesc($uri),
|
||||||
intval($importer["uid"])
|
intval($importer["uid"])
|
||||||
);
|
);
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Diaspora
|
||||||
$r = q(
|
$r = q(
|
||||||
"INSERT INTO `contact` (`uid`, `created`, `name`, `nick`, `addr`, `url`, `nurl`, `batch`, `network`, `rel`, `blocked`, `pending`, `writable`, `name-date`, `uri-date`, `avatar-date`)
|
"INSERT INTO `contact` (`uid`, `created`, `name`, `nick`, `addr`, `url`, `nurl`, `batch`, `network`, `rel`, `blocked`, `pending`, `writable`, `name-date`, `uri-date`, `avatar-date`)
|
||||||
VALUES (0, '%s', '%s', 'relay', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, '%s', '%s', '%s')",
|
VALUES (0, '%s', '%s', 'relay', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, '%s', '%s', '%s')",
|
||||||
Temporal::convert(),
|
Temporal::utcNow(),
|
||||||
dbesc($addr),
|
dbesc($addr),
|
||||||
dbesc($addr),
|
dbesc($addr),
|
||||||
dbesc($server),
|
dbesc($server),
|
||||||
|
@ -85,9 +85,9 @@ class Diaspora
|
||||||
dbesc($batch),
|
dbesc($batch),
|
||||||
dbesc(NETWORK_DIASPORA),
|
dbesc(NETWORK_DIASPORA),
|
||||||
intval(CONTACT_IS_FOLLOWER),
|
intval(CONTACT_IS_FOLLOWER),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert())
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
|
|
||||||
$relais = q("SELECT `batch`, `id`, `name`,`network` FROM `contact` WHERE `uid` = 0 AND `batch` = '%s' LIMIT 1", dbesc($batch));
|
$relais = q("SELECT `batch`, `id`, `name`,`network` FROM `contact` WHERE `uid` = 0 AND `batch` = '%s' LIMIT 1", dbesc($batch));
|
||||||
|
@ -871,7 +871,7 @@ class Diaspora
|
||||||
dbesc($arr["confirm"]),
|
dbesc($arr["confirm"]),
|
||||||
dbesc($arr["alias"]),
|
dbesc($arr["alias"]),
|
||||||
dbesc($arr["pubkey"]),
|
dbesc($arr["pubkey"]),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($arr["url"]),
|
dbesc($arr["url"]),
|
||||||
dbesc($arr["network"])
|
dbesc($arr["network"])
|
||||||
);
|
);
|
||||||
|
@ -894,7 +894,7 @@ class Diaspora
|
||||||
dbesc($arr["network"]),
|
dbesc($arr["network"]),
|
||||||
dbesc($arr["alias"]),
|
dbesc($arr["alias"]),
|
||||||
dbesc($arr["pubkey"]),
|
dbesc($arr["pubkey"]),
|
||||||
dbesc(Temporal::convert())
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1656,7 +1656,7 @@ class Diaspora
|
||||||
if (isset($data->created_at)) {
|
if (isset($data->created_at)) {
|
||||||
$created_at = Temporal::convert(notags(unxmlify($data->created_at)));
|
$created_at = Temporal::convert(notags(unxmlify($data->created_at)));
|
||||||
} else {
|
} else {
|
||||||
$created_at = Temporal::convert();
|
$created_at = Temporal::utcNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($data->thread_parent_guid)) {
|
if (isset($data->thread_parent_guid)) {
|
||||||
|
@ -1831,7 +1831,7 @@ class Diaspora
|
||||||
|
|
||||||
dba::unlock();
|
dba::unlock();
|
||||||
|
|
||||||
dba::update('conv', ['updated' => Temporal::convert()], ['id' => $conversation["id"]]);
|
dba::update('conv', ['updated' => Temporal::utcNow()], ['id' => $conversation["id"]]);
|
||||||
|
|
||||||
notification(
|
notification(
|
||||||
[
|
[
|
||||||
|
@ -1897,7 +1897,7 @@ class Diaspora
|
||||||
dbesc($guid),
|
dbesc($guid),
|
||||||
dbesc($author),
|
dbesc($author),
|
||||||
dbesc($created_at),
|
dbesc($created_at),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($subject),
|
dbesc($subject),
|
||||||
dbesc($participants)
|
dbesc($participants)
|
||||||
);
|
);
|
||||||
|
@ -2164,7 +2164,7 @@ class Diaspora
|
||||||
|
|
||||||
dba::unlock();
|
dba::unlock();
|
||||||
|
|
||||||
dba::update('conv', ['updated' => Temporal::convert()], ['id' => $conversation["id"]]);
|
dba::update('conv', ['updated' => Temporal::utcNow()], ['id' => $conversation["id"]]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2331,7 +2331,7 @@ class Diaspora
|
||||||
dbesc($name),
|
dbesc($name),
|
||||||
dbesc($nick),
|
dbesc($nick),
|
||||||
dbesc($author),
|
dbesc($author),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc($birthday),
|
dbesc($birthday),
|
||||||
dbesc($location),
|
dbesc($location),
|
||||||
dbesc($about),
|
dbesc($about),
|
||||||
|
@ -2537,7 +2537,7 @@ class Diaspora
|
||||||
intval($importer["uid"]),
|
intval($importer["uid"]),
|
||||||
dbesc($ret["network"]),
|
dbesc($ret["network"]),
|
||||||
dbesc($ret["addr"]),
|
dbesc($ret["addr"]),
|
||||||
Temporal::convert(),
|
Temporal::utcNow(),
|
||||||
dbesc($ret["url"]),
|
dbesc($ret["url"]),
|
||||||
dbesc(normalise_link($ret["url"])),
|
dbesc(normalise_link($ret["url"])),
|
||||||
dbesc($batch),
|
dbesc($batch),
|
||||||
|
@ -2580,7 +2580,7 @@ class Diaspora
|
||||||
0,
|
0,
|
||||||
dbesc(L10n::t("Sharing notification from Diaspora network")),
|
dbesc(L10n::t("Sharing notification from Diaspora network")),
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
dbesc(Temporal::convert())
|
dbesc(Temporal::utcNow())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// automatic friend approval
|
// automatic friend approval
|
||||||
|
@ -2611,8 +2611,8 @@ class Diaspora
|
||||||
WHERE `id` = %d
|
WHERE `id` = %d
|
||||||
",
|
",
|
||||||
intval($new_relation),
|
intval($new_relation),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
dbesc(Temporal::convert()),
|
dbesc(Temporal::utcNow()),
|
||||||
intval($contact_record["id"])
|
intval($contact_record["id"])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2852,8 +2852,8 @@ class Diaspora
|
||||||
'deleted' => true,
|
'deleted' => true,
|
||||||
'title' => '',
|
'title' => '',
|
||||||
'body' => '',
|
'body' => '',
|
||||||
'edited' => Temporal::convert(),
|
'edited' => Temporal::utcNow(),
|
||||||
'changed' => Temporal::convert()],
|
'changed' => Temporal::utcNow()],
|
||||||
['id' => $item["id"]]
|
['id' => $item["id"]]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ class OStatus
|
||||||
$contact["location"] = $value;
|
$contact["location"] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact['name-date'] = Temporal::convert();
|
$contact['name-date'] = Temporal::utcNow();
|
||||||
|
|
||||||
dba::update('contact', $contact, ['id' => $contact["id"]], $current);
|
dba::update('contact', $contact, ['id' => $contact["id"]], $current);
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ class OStatus
|
||||||
'nurl' => normalise_link($author["author-link"]),
|
'nurl' => normalise_link($author["author-link"]),
|
||||||
'nick' => $contact["nick"], 'alias' => $contact["alias"],
|
'nick' => $contact["nick"], 'alias' => $contact["alias"],
|
||||||
'about' => $contact["about"], 'location' => $contact["location"],
|
'about' => $contact["about"], 'location' => $contact["location"],
|
||||||
'success_update' => Temporal::convert(), 'last-update' => Temporal::convert()];
|
'success_update' => Temporal::utcNow(), 'last-update' => Temporal::utcNow()];
|
||||||
|
|
||||||
dba::update('contact', $fields, ['id' => $cid], $old_contact);
|
dba::update('contact', $fields, ['id' => $cid], $old_contact);
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ class OStatus
|
||||||
dba::update(
|
dba::update(
|
||||||
'item',
|
'item',
|
||||||
['deleted' => true, 'title' => '', 'body' => '',
|
['deleted' => true, 'title' => '', 'body' => '',
|
||||||
'edited' => Temporal::convert(), 'changed' => Temporal::convert()],
|
'edited' => Temporal::utcNow(), 'changed' => Temporal::utcNow()],
|
||||||
['id' => $deleted["id"]]
|
['id' => $deleted["id"]]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,7 @@ class PortableContact
|
||||||
$contact = ["url" => $profile];
|
$contact = ["url" => $profile];
|
||||||
|
|
||||||
if ($gcontacts[0]["created"] <= NULL_DATE) {
|
if ($gcontacts[0]["created"] <= NULL_DATE) {
|
||||||
$contact['created'] = Temporal::convert();
|
$contact['created'] = Temporal::utcNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($force) {
|
if ($force) {
|
||||||
|
@ -338,7 +338,7 @@ class PortableContact
|
||||||
if ($server_url != "") {
|
if ($server_url != "") {
|
||||||
if (!self::checkServer($server_url, $gcontacts[0]["network"], $force)) {
|
if (!self::checkServer($server_url, $gcontacts[0]["network"], $force)) {
|
||||||
if ($force) {
|
if ($force) {
|
||||||
$fields = ['last_failure' => Temporal::convert()];
|
$fields = ['last_failure' => Temporal::utcNow()];
|
||||||
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,14 +412,14 @@ class PortableContact
|
||||||
|
|
||||||
// Set the date of the last contact
|
// Set the date of the last contact
|
||||||
/// @todo By now the function "update_gcontact" doesn't work with this field
|
/// @todo By now the function "update_gcontact" doesn't work with this field
|
||||||
//$contact["last_contact"] = Temporal::convert();
|
//$contact["last_contact"] = Temporal::utcNow();
|
||||||
|
|
||||||
$contact = array_merge($contact, $noscrape);
|
$contact = array_merge($contact, $noscrape);
|
||||||
|
|
||||||
GContact::update($contact);
|
GContact::update($contact);
|
||||||
|
|
||||||
if (trim($noscrape["updated"]) != "") {
|
if (trim($noscrape["updated"]) != "") {
|
||||||
$fields = ['last_contact' => Temporal::convert()];
|
$fields = ['last_contact' => Temporal::utcNow()];
|
||||||
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
||||||
|
|
||||||
logger("Profile ".$profile." was last updated at ".$noscrape["updated"]." (noscrape)", LOGGER_DEBUG);
|
logger("Profile ".$profile." was last updated at ".$noscrape["updated"]." (noscrape)", LOGGER_DEBUG);
|
||||||
|
@ -468,7 +468,7 @@ class PortableContact
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($data["poll"] == "") || (in_array($data["network"], [NETWORK_FEED, NETWORK_PHANTOM]))) {
|
if (($data["poll"] == "") || (in_array($data["network"], [NETWORK_FEED, NETWORK_PHANTOM]))) {
|
||||||
$fields = ['last_failure' => Temporal::convert()];
|
$fields = ['last_failure' => Temporal::utcNow()];
|
||||||
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
||||||
|
|
||||||
logger("Profile ".$profile." wasn't reachable (profile)", LOGGER_DEBUG);
|
logger("Profile ".$profile." wasn't reachable (profile)", LOGGER_DEBUG);
|
||||||
|
@ -484,7 +484,7 @@ class PortableContact
|
||||||
$feedret = Network::curl($data["poll"]);
|
$feedret = Network::curl($data["poll"]);
|
||||||
|
|
||||||
if (!$feedret["success"]) {
|
if (!$feedret["success"]) {
|
||||||
$fields = ['last_failure' => Temporal::convert()];
|
$fields = ['last_failure' => Temporal::utcNow()];
|
||||||
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
|
||||||
|
|
||||||
logger("Profile ".$profile." wasn't reachable (no feed)", LOGGER_DEBUG);
|
logger("Profile ".$profile." wasn't reachable (no feed)", LOGGER_DEBUG);
|
||||||
|
@ -533,7 +533,7 @@ class PortableContact
|
||||||
|
|
||||||
public static function updateNeeded($created, $updated, $last_failure, $last_contact)
|
public static function updateNeeded($created, $updated, $last_failure, $last_contact)
|
||||||
{
|
{
|
||||||
$now = strtotime(Temporal::convert());
|
$now = strtotime(Temporal::utcNow());
|
||||||
|
|
||||||
if ($updated > $last_contact) {
|
if ($updated > $last_contact) {
|
||||||
$contact_time = strtotime($updated);
|
$contact_time = strtotime($updated);
|
||||||
|
@ -922,7 +922,7 @@ class PortableContact
|
||||||
$gserver = dba::selectFirst('gserver', [], ['nurl' => normalise_link($server_url)]);
|
$gserver = dba::selectFirst('gserver', [], ['nurl' => normalise_link($server_url)]);
|
||||||
if (DBM::is_result($gserver)) {
|
if (DBM::is_result($gserver)) {
|
||||||
if ($gserver["created"] <= NULL_DATE) {
|
if ($gserver["created"] <= NULL_DATE) {
|
||||||
$fields = ['created' => Temporal::convert()];
|
$fields = ['created' => Temporal::utcNow()];
|
||||||
$condition = ['nurl' => normalise_link($server_url)];
|
$condition = ['nurl' => normalise_link($server_url)];
|
||||||
dba::update('gserver', $fields, $condition);
|
dba::update('gserver', $fields, $condition);
|
||||||
}
|
}
|
||||||
|
@ -969,7 +969,7 @@ class PortableContact
|
||||||
// Mastodon uses the "@" for user profiles.
|
// Mastodon uses the "@" for user profiles.
|
||||||
// But this can be misunderstood.
|
// But this can be misunderstood.
|
||||||
if (parse_url($server_url, PHP_URL_USER) != '') {
|
if (parse_url($server_url, PHP_URL_USER) != '') {
|
||||||
dba::update('gserver', ['last_failure' => Temporal::convert()], ['nurl' => normalise_link($server_url)]);
|
dba::update('gserver', ['last_failure' => Temporal::utcNow()], ['nurl' => normalise_link($server_url)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -985,7 +985,7 @@ class PortableContact
|
||||||
if (DBM::is_result($gserver) && ($orig_server_url == $server_url) &&
|
if (DBM::is_result($gserver) && ($orig_server_url == $server_url) &&
|
||||||
($serverret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
|
($serverret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
|
||||||
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
|
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
|
||||||
dba::update('gserver', ['last_failure' => Temporal::convert()], ['nurl' => normalise_link($server_url)]);
|
dba::update('gserver', ['last_failure' => Temporal::utcNow()], ['nurl' => normalise_link($server_url)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1000,7 +1000,7 @@ class PortableContact
|
||||||
// Quit if there is a timeout
|
// Quit if there is a timeout
|
||||||
if ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
if ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
|
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
|
||||||
dba::update('gserver', ['last_failure' => Temporal::convert()], ['nurl' => normalise_link($server_url)]);
|
dba::update('gserver', ['last_failure' => Temporal::utcNow()], ['nurl' => normalise_link($server_url)]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1332,9 +1332,9 @@ class PortableContact
|
||||||
|
|
||||||
if ($failure) {
|
if ($failure) {
|
||||||
$last_contact = $orig_last_contact;
|
$last_contact = $orig_last_contact;
|
||||||
$last_failure = Temporal::convert();
|
$last_failure = Temporal::utcNow();
|
||||||
} else {
|
} else {
|
||||||
$last_contact = Temporal::convert();
|
$last_contact = Temporal::utcNow();
|
||||||
$last_failure = $orig_last_failure;
|
$last_failure = $orig_last_failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1362,7 +1362,7 @@ class PortableContact
|
||||||
dba::update('gserver', $fields, ['nurl' => normalise_link($server_url)]);
|
dba::update('gserver', $fields, ['nurl' => normalise_link($server_url)]);
|
||||||
} elseif (!$failure) {
|
} elseif (!$failure) {
|
||||||
$fields['nurl'] = normalise_link($server_url);
|
$fields['nurl'] = normalise_link($server_url);
|
||||||
$fields['created'] = Temporal::convert();
|
$fields['created'] = Temporal::utcNow();
|
||||||
dba::insert('gserver', $fields);
|
dba::insert('gserver', $fields);
|
||||||
}
|
}
|
||||||
logger("End discovery for server " . $server_url, LOGGER_DEBUG);
|
logger("End discovery for server " . $server_url, LOGGER_DEBUG);
|
||||||
|
@ -1526,7 +1526,7 @@ class PortableContact
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['last_poco_query' => Temporal::convert()];
|
$fields = ['last_poco_query' => Temporal::utcNow()];
|
||||||
dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
|
dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1535,7 +1535,7 @@ class PortableContact
|
||||||
self::checkServer($server["url"], $server["network"], true);
|
self::checkServer($server["url"], $server["network"], true);
|
||||||
|
|
||||||
// If we couldn't reach the server, we will try it some time later
|
// If we couldn't reach the server, we will try it some time later
|
||||||
$fields = ['last_poco_query' => Temporal::convert()];
|
$fields = ['last_poco_query' => Temporal::utcNow()];
|
||||||
dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
|
dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -1561,7 +1561,7 @@ class PortableContact
|
||||||
foreach ($r as $server) {
|
foreach ($r as $server) {
|
||||||
if (!self::checkServer($server["url"], $server["network"])) {
|
if (!self::checkServer($server["url"], $server["network"])) {
|
||||||
// The server is not reachable? Okay, then we will try it later
|
// The server is not reachable? Okay, then we will try it later
|
||||||
$fields = ['last_poco_query' => Temporal::convert()];
|
$fields = ['last_poco_query' => Temporal::utcNow()];
|
||||||
dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
|
dba::update('gserver', $fields, ['nurl' => $server["nurl"]]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ class ParseUrl
|
||||||
[
|
[
|
||||||
'url' => normalise_link($url), 'guessing' => !$no_guessing,
|
'url' => normalise_link($url), 'guessing' => !$no_guessing,
|
||||||
'oembed' => $do_oembed, 'content' => serialize($data),
|
'oembed' => $do_oembed, 'content' => serialize($data),
|
||||||
'created' => Temporal::convert()
|
'created' => Temporal::utcNow()
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
|
@ -123,6 +123,17 @@ class Temporal
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* convert() shorthand for UTC now.
|
||||||
|
*
|
||||||
|
* @param string $format DateTime format string or Temporal constant
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function utcNow($format = self::MYSQL)
|
||||||
|
{
|
||||||
|
return self::convert('now', 'UTC', 'UTC', $format);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief General purpose date parse/convert/format function.
|
* @brief General purpose date parse/convert/format function.
|
||||||
*
|
*
|
||||||
|
|
|
@ -71,7 +71,7 @@ Class Cron {
|
||||||
|
|
||||||
// once daily run birthday_updates and then expire in background
|
// once daily run birthday_updates and then expire in background
|
||||||
$d1 = Config::get('system', 'last_expire_day');
|
$d1 = Config::get('system', 'last_expire_day');
|
||||||
$d2 = intval(Temporal::convert('now', 'UTC', 'UTC', 'd'));
|
$d2 = intval(Temporal::utcNow('d'));
|
||||||
|
|
||||||
if ($d2 != intval($d1)) {
|
if ($d2 != intval($d1)) {
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ Class Cron {
|
||||||
|
|
||||||
Addon::reload();
|
Addon::reload();
|
||||||
|
|
||||||
$d = Temporal::convert();
|
$d = Temporal::utcNow();
|
||||||
|
|
||||||
// Only poll from those with suitable relationships,
|
// Only poll from those with suitable relationships,
|
||||||
// and which have a polling address and ignore Diaspora since
|
// and which have a polling address and ignore Diaspora since
|
||||||
|
@ -218,33 +218,33 @@ Class Cron {
|
||||||
*/
|
*/
|
||||||
switch ($contact['priority']) {
|
switch ($contact['priority']) {
|
||||||
case 5:
|
case 5:
|
||||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 month")) {
|
if (Temporal::utcNow() > Temporal::convert($t . " + 1 month")) {
|
||||||
$update = true;
|
$update = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 week")) {
|
if (Temporal::utcNow() > Temporal::convert($t . " + 1 week")) {
|
||||||
$update = true;
|
$update = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 day")) {
|
if (Temporal::utcNow() > Temporal::convert($t . " + 1 day")) {
|
||||||
$update = true;
|
$update = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (Temporal::convert('now') > Temporal::convert($t . " + 12 hour")) {
|
if (Temporal::utcNow() > Temporal::convert($t . " + 12 hour")) {
|
||||||
$update = true;
|
$update = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 hour")) {
|
if (Temporal::utcNow() > Temporal::convert($t . " + 1 hour")) {
|
||||||
$update = true;
|
$update = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
if (Temporal::convert('now') > Temporal::convert($t . " + ".$min_poll_interval." minute")) {
|
if (Temporal::utcNow() > Temporal::convert($t . " + ".$min_poll_interval." minute")) {
|
||||||
$update = true;
|
$update = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -45,7 +45,7 @@ Class CronHooks {
|
||||||
|
|
||||||
logger('cronhooks: start');
|
logger('cronhooks: start');
|
||||||
|
|
||||||
$d = Temporal::convert();
|
$d = Temporal::utcNow();
|
||||||
|
|
||||||
if (is_array($a->hooks) && array_key_exists("cron", $a->hooks)) {
|
if (is_array($a->hooks) && array_key_exists("cron", $a->hooks)) {
|
||||||
foreach ($a->hooks["cron"] as $hook) {
|
foreach ($a->hooks["cron"] as $hook) {
|
||||||
|
|
|
@ -198,7 +198,7 @@ class DiscoverPoCo {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `nurl` = '%s'",
|
q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `nurl` = '%s'",
|
||||||
dbesc(Temporal::convert()), dbesc(normalise_link($user["url"])));
|
dbesc(Temporal::utcNow()), dbesc(normalise_link($user["url"])));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quit the loop after 3 minutes
|
// Quit the loop after 3 minutes
|
||||||
|
|
|
@ -44,7 +44,7 @@ class OnePoll
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$d = Temporal::convert();
|
$d = Temporal::utcNow();
|
||||||
|
|
||||||
$contact = dba::selectFirst('contact', [], ['id' => $contact_id]);
|
$contact = dba::selectFirst('contact', [], ['id' => $contact_id]);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBM::is_result($contact)) {
|
||||||
|
@ -70,7 +70,7 @@ class OnePoll
|
||||||
// Diaspora users, archived users and followers are only checked if they still exist.
|
// Diaspora users, archived users and followers are only checked if they still exist.
|
||||||
if ($contact['archive'] || ($contact["network"] == NETWORK_DIASPORA) || ($contact["rel"] == CONTACT_IS_FOLLOWER)) {
|
if ($contact['archive'] || ($contact["network"] == NETWORK_DIASPORA) || ($contact["rel"] == CONTACT_IS_FOLLOWER)) {
|
||||||
$last_updated = PortableContact::lastUpdated($contact["url"], true);
|
$last_updated = PortableContact::lastUpdated($contact["url"], true);
|
||||||
$updated = Temporal::convert();
|
$updated = Temporal::utcNow();
|
||||||
if ($last_updated) {
|
if ($last_updated) {
|
||||||
logger('Contact '.$contact['id'].' had last update on '.$last_updated, LOGGER_DEBUG);
|
logger('Contact '.$contact['id'].' had last update on '.$last_updated, LOGGER_DEBUG);
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ class OnePoll
|
||||||
$contact['priority'] = intval($poll_interval);
|
$contact['priority'] = intval($poll_interval);
|
||||||
$hub_update = false;
|
$hub_update = false;
|
||||||
|
|
||||||
if (Temporal::convert('now') > Temporal::convert($t . " + 1 day")) {
|
if (Temporal::utcNow() > Temporal::convert($t . " + 1 day")) {
|
||||||
$hub_update = true;
|
$hub_update = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -117,7 +117,7 @@ class OnePoll
|
||||||
logger("Skipping probably dead contact ".$contact['url']);
|
logger("Skipping probably dead contact ".$contact['url']);
|
||||||
|
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ class OnePoll
|
||||||
logger('Contact is marked dead');
|
logger('Contact is marked dead');
|
||||||
|
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Contact::unmarkForArchival($contact);
|
Contact::unmarkForArchival($contact);
|
||||||
|
@ -137,7 +137,7 @@ class OnePoll
|
||||||
logger('Ignore public contacts');
|
logger('Ignore public contacts');
|
||||||
|
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ class OnePoll
|
||||||
logger('No self contact for user '.$importer_uid);
|
logger('No self contact for user '.$importer_uid);
|
||||||
|
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class OnePoll
|
||||||
|
|
||||||
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ class OnePoll
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
|
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
$fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
|
$fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
|
||||||
self::updateContact($contact, $fields);
|
self::updateContact($contact, $fields);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ class OnePoll
|
||||||
|
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
|
|
||||||
$fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
|
$fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
|
||||||
self::updateContact($contact, $fields);
|
self::updateContact($contact, $fields);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ class OnePoll
|
||||||
|
|
||||||
// we may not be friends anymore. Will keep trying for one month.
|
// we may not be friends anymore. Will keep trying for one month.
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
$fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
|
$fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
|
||||||
self::updateContact($contact, $fields);
|
self::updateContact($contact, $fields);
|
||||||
|
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
|
@ -241,7 +241,7 @@ class OnePoll
|
||||||
|
|
||||||
if ((intval($res->status) != 0) || !strlen($res->challenge) || !strlen($res->dfrn_id)) {
|
if ((intval($res->status) != 0) || !strlen($res->challenge) || !strlen($res->dfrn_id)) {
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ class OnePoll
|
||||||
logger('ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id);
|
logger('ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id);
|
||||||
|
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,7 @@ class OnePoll
|
||||||
|
|
||||||
if ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) {
|
if ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) {
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ class OnePoll
|
||||||
|
|
||||||
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ class OnePoll
|
||||||
$mail_disabled = ((function_exists('imap_open') && (! Config::get('system', 'imap_disabled'))) ? 0 : 1);
|
$mail_disabled = ((function_exists('imap_open') && (! Config::get('system', 'imap_disabled'))) ? 0 : 1);
|
||||||
if ($mail_disabled) {
|
if ($mail_disabled) {
|
||||||
// set the last-update so we don't keep polling
|
// set the last-update so we don't keep polling
|
||||||
dba::update('contact', ['last-update' => Temporal::convert()], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => Temporal::utcNow()], ['id' => $contact['id']]);
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ class OnePoll
|
||||||
unset($password);
|
unset($password);
|
||||||
logger("Mail: Connect to " . $mailconf['user']);
|
logger("Mail: Connect to " . $mailconf['user']);
|
||||||
if ($mbox) {
|
if ($mbox) {
|
||||||
$fields = ['last_check' => Temporal::convert()];
|
$fields = ['last_check' => Temporal::utcNow()];
|
||||||
dba::update('mailacct', $fields, ['id' => $mailconf['id']]);
|
dba::update('mailacct', $fields, ['id' => $mailconf['id']]);
|
||||||
logger("Mail: Connected to " . $mailconf['user']);
|
logger("Mail: Connected to " . $mailconf['user']);
|
||||||
} else {
|
} else {
|
||||||
|
@ -395,7 +395,7 @@ class OnePoll
|
||||||
// Only delete when mails aren't automatically moved or deleted
|
// Only delete when mails aren't automatically moved or deleted
|
||||||
if (($mailconf['action'] != 1) && ($mailconf['action'] != 3))
|
if (($mailconf['action'] != 1) && ($mailconf['action'] != 3))
|
||||||
if ($meta->deleted && ! $item['deleted']) {
|
if ($meta->deleted && ! $item['deleted']) {
|
||||||
$fields = ['deleted' => true, 'changed' => Temporal::convert()];
|
$fields = ['deleted' => true, 'changed' => Temporal::utcNow()];
|
||||||
dba::update('item', $fields, ['id' => $item['id']]);
|
dba::update('item', $fields, ['id' => $item['id']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +572,7 @@ class OnePoll
|
||||||
if (!strstr($xml, '<')) {
|
if (!strstr($xml, '<')) {
|
||||||
logger('post_handshake: response from ' . $url . ' did not contain XML.');
|
logger('post_handshake: response from ' . $url . ' did not contain XML.');
|
||||||
|
|
||||||
$fields = ['last-update' => Temporal::convert(), 'failure_update' => Temporal::convert()];
|
$fields = ['last-update' => Temporal::utcNow(), 'failure_update' => Temporal::utcNow()];
|
||||||
self::updateContact($contact, $fields);
|
self::updateContact($contact, $fields);
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
return;
|
return;
|
||||||
|
@ -616,19 +616,19 @@ class OnePoll
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$updated = Temporal::convert();
|
$updated = Temporal::utcNow();
|
||||||
|
|
||||||
self::updateContact($contact, ['last-update' => $updated, 'success_update' => $updated]);
|
self::updateContact($contact, ['last-update' => $updated, 'success_update' => $updated]);
|
||||||
dba::update('gcontact', ['last_contact' => $updated], ['nurl' => $contact['nurl']]);
|
dba::update('gcontact', ['last_contact' => $updated], ['nurl' => $contact['nurl']]);
|
||||||
Contact::unmarkForArchival($contact);
|
Contact::unmarkForArchival($contact);
|
||||||
} elseif (in_array($contact["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_FEED])) {
|
} elseif (in_array($contact["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_FEED])) {
|
||||||
$updated = Temporal::convert();
|
$updated = Temporal::utcNow();
|
||||||
|
|
||||||
self::updateContact($contact, ['last-update' => $updated, 'failure_update' => $updated]);
|
self::updateContact($contact, ['last-update' => $updated, 'failure_update' => $updated]);
|
||||||
dba::update('gcontact', ['last_failure' => $updated], ['nurl' => $contact['nurl']]);
|
dba::update('gcontact', ['last_failure' => $updated], ['nurl' => $contact['nurl']]);
|
||||||
Contact::markForArchival($contact);
|
Contact::markForArchival($contact);
|
||||||
} else {
|
} else {
|
||||||
$updated = Temporal::convert();
|
$updated = Temporal::utcNow();
|
||||||
dba::update('contact', ['last-update' => $updated], ['id' => $contact['id']]);
|
dba::update('contact', ['last-update' => $updated], ['id' => $contact['id']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class UpdateGContact
|
||||||
}
|
}
|
||||||
|
|
||||||
q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `id` = %d",
|
q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `id` = %d",
|
||||||
dbesc(Temporal::convert()), intval($contact_id));
|
dbesc(Temporal::utcNow()), intval($contact_id));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue