Move Temporal::convert() to DateTimeFormat::convert()
This commit is contained in:
parent
b7a7355292
commit
5e7285b9ba
64 changed files with 568 additions and 551 deletions
|
@ -20,7 +20,7 @@ use Friendica\Model\Contact;
|
|||
use Friendica\Model\Item;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Module\Login;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
require_once 'include/text.php';
|
||||
|
@ -740,7 +740,7 @@ function admin_page_summary(App $a)
|
|||
if (!$last_worker_call) {
|
||||
$showwarning = true;
|
||||
$warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');
|
||||
} elseif ((strtotime(Temporal::utcNow()) - strtotime($last_worker_call)) > 60 * 60) {
|
||||
} elseif ((strtotime(DateTimeFormat::utcNow()) - strtotime($last_worker_call)) > 60 * 60) {
|
||||
$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);
|
||||
}
|
||||
|
|
16
mod/cal.php
16
mod/cal.php
|
@ -17,7 +17,7 @@ use Friendica\Model\Contact;
|
|||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Protocol\DFRN;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/event.php';
|
||||
|
||||
|
@ -152,8 +152,8 @@ function cal_content(App $a)
|
|||
|
||||
// The view mode part is similiar to /mod/events.php
|
||||
if ($mode == 'view') {
|
||||
$thisyear = Temporal::localNow('Y');
|
||||
$thismonth = Temporal::localNow('m');
|
||||
$thisyear = DateTimeFormat::localNow('Y');
|
||||
$thismonth = DateTimeFormat::localNow('m');
|
||||
if (!$y) {
|
||||
$y = intval($thisyear);
|
||||
}
|
||||
|
@ -203,11 +203,11 @@ function cal_content(App $a)
|
|||
}
|
||||
}
|
||||
|
||||
$start = Temporal::utc($start);
|
||||
$finish = Temporal::utc($finish);
|
||||
$start = DateTimeFormat::utc($start);
|
||||
$finish = DateTimeFormat::utc($finish);
|
||||
|
||||
$adjust_start = Temporal::local($start);
|
||||
$adjust_finish = Temporal::local($finish);
|
||||
$adjust_start = DateTimeFormat::local($start);
|
||||
$adjust_finish = DateTimeFormat::local($finish);
|
||||
|
||||
// put the event parametes in an array so we can better transmit them
|
||||
$event_params = [
|
||||
|
@ -231,7 +231,7 @@ function cal_content(App $a)
|
|||
if (DBM::is_result($r)) {
|
||||
$r = sort_by_date($r);
|
||||
foreach ($r as $rr) {
|
||||
$j = $rr['adjust'] ? Temporal::local($rr['start'], 'j') : Temporal::utc($rr['start'], 'j');
|
||||
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
|
||||
if (!x($links, $j)) {
|
||||
$links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ use Friendica\Model\GContact;
|
|||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'mod/proxy.php';
|
||||
|
||||
|
@ -540,7 +540,7 @@ function contacts_content(App $a)
|
|||
|
||||
$insecure = L10n::t('Private communications are not available for this contact.');
|
||||
|
||||
$last_update = (($contact['last-update'] <= NULL_DATE) ? L10n::t('Never') : Temporal::local($contact['last-update'], 'D, j M Y, g:i A'));
|
||||
$last_update = (($contact['last-update'] <= NULL_DATE) ? L10n::t('Never') : DateTimeFormat::local($contact['last-update'], 'D, j M Y, g:i A'));
|
||||
|
||||
if ($contact['last-update'] > NULL_DATE) {
|
||||
$last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? L10n::t("\x28Update was successful\x29") : L10n::t("\x28Update was not successful\x29"));
|
||||
|
@ -554,7 +554,7 @@ function contacts_content(App $a)
|
|||
// tabs
|
||||
$tab_str = contacts_tab($a, $contact_id, 2);
|
||||
|
||||
$lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < Temporal::utcNow()) ? L10n::t('Communications lost with this contact!') : '');
|
||||
$lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < DateTimeFormat::utcNow()) ? L10n::t('Communications lost with this contact!') : '');
|
||||
|
||||
$fetch_further_information = null;
|
||||
if ($contact['network'] == NETWORK_FEED) {
|
||||
|
|
|
@ -31,8 +31,8 @@ use Friendica\Model\User;
|
|||
use Friendica\Network\Probe;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Util\Crypto;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\XML;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
|
@ -327,8 +327,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
`network` = '%s' WHERE `id` = %d
|
||||
",
|
||||
intval($new_relation),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
intval($duplex),
|
||||
intval($hidden),
|
||||
dbesc(NETWORK_DFRN),
|
||||
|
@ -378,8 +378,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
`rel` = %d
|
||||
WHERE `id` = %d
|
||||
",
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc($addr),
|
||||
dbesc($notify),
|
||||
dbesc($poll),
|
||||
|
@ -619,8 +619,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
`network` = '%s' WHERE `id` = %d
|
||||
",
|
||||
intval($new_relation),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
intval($duplex),
|
||||
intval($forum),
|
||||
intval($prv),
|
||||
|
|
|
@ -24,8 +24,8 @@ use Friendica\Model\Profile;
|
|||
use Friendica\Model\User;
|
||||
use Friendica\Module\Login;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
|
||||
|
@ -137,7 +137,7 @@ function dfrn_request_post(App $a)
|
|||
`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)",
|
||||
intval(local_user()),
|
||||
Temporal::utcNow(),
|
||||
DateTimeFormat::utcNow(),
|
||||
dbesc($dfrn_url),
|
||||
dbesc(normalise_link($dfrn_url)),
|
||||
$parms['addr'],
|
||||
|
@ -241,7 +241,7 @@ function dfrn_request_post(App $a)
|
|||
// Block friend request spam
|
||||
if ($maxreq) {
|
||||
$r = q("SELECT * FROM `intro` WHERE `datetime` > '%s' AND `uid` = %d",
|
||||
dbesc(Temporal::utc('now - 24 hours')),
|
||||
dbesc(DateTimeFormat::utc('now - 24 hours')),
|
||||
intval($uid)
|
||||
);
|
||||
if (DBM::is_result($r) && count($r) > $maxreq) {
|
||||
|
@ -382,7 +382,7 @@ function dfrn_request_post(App $a)
|
|||
`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 )",
|
||||
intval($uid),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
$parms['url'],
|
||||
dbesc(normalise_link($url)),
|
||||
$parms['addr'],
|
||||
|
@ -430,7 +430,7 @@ function dfrn_request_post(App $a)
|
|||
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
|
||||
dbesc(notags(trim($_POST['dfrn-request-message']))),
|
||||
dbesc($hash),
|
||||
dbesc(Temporal::utcNow())
|
||||
dbesc(DateTimeFormat::utcNow())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use Friendica\Core\Worker;
|
|||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/bbcode.php';
|
||||
require_once 'include/datetime.php';
|
||||
|
@ -76,14 +76,14 @@ function events_post(App $a) {
|
|||
}
|
||||
|
||||
if ($adjust) {
|
||||
$start = Temporal::convert($start, 'UTC', date_default_timezone_get());
|
||||
$start = DateTimeFormat::convert($start, 'UTC', date_default_timezone_get());
|
||||
if (! $nofinish) {
|
||||
$finish = Temporal::convert($finish, 'UTC', date_default_timezone_get());
|
||||
$finish = DateTimeFormat::convert($finish, 'UTC', date_default_timezone_get());
|
||||
}
|
||||
} else {
|
||||
$start = Temporal::utc($start);
|
||||
$start = DateTimeFormat::utc($start);
|
||||
if (! $nofinish) {
|
||||
$finish = Temporal::utc($finish);
|
||||
$finish = DateTimeFormat::utc($finish);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,8 +276,8 @@ function events_content(App $a) {
|
|||
// The view mode part is similiar to /mod/cal.php
|
||||
if ($mode == 'view') {
|
||||
|
||||
$thisyear = Temporal::localNow('Y');
|
||||
$thismonth = Temporal::localNow('m');
|
||||
$thisyear = DateTimeFormat::localNow('Y');
|
||||
$thismonth = DateTimeFormat::localNow('m');
|
||||
if (! $y) {
|
||||
$y = intval($thisyear);
|
||||
}
|
||||
|
@ -323,11 +323,11 @@ function events_content(App $a) {
|
|||
}
|
||||
}
|
||||
|
||||
$start = Temporal::utc($start);
|
||||
$finish = Temporal::utc($finish);
|
||||
$start = DateTimeFormat::utc($start);
|
||||
$finish = DateTimeFormat::utc($finish);
|
||||
|
||||
$adjust_start = Temporal::local($start);
|
||||
$adjust_finish = Temporal::local($finish);
|
||||
$adjust_start = DateTimeFormat::local($start);
|
||||
$adjust_finish = DateTimeFormat::local($finish);
|
||||
|
||||
// put the event parametes in an array so we can better transmit them
|
||||
$event_params = [
|
||||
|
@ -351,7 +351,7 @@ function events_content(App $a) {
|
|||
if (DBM::is_result($r)) {
|
||||
$r = sort_by_date($r);
|
||||
foreach ($r as $rr) {
|
||||
$j = $rr['adjust'] ? Temporal::local($rr['start'], 'j') : Temporal::utc($rr['start'], 'j');
|
||||
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
|
||||
if (! x($links,$j)) {
|
||||
$links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
|
||||
}
|
||||
|
@ -465,19 +465,19 @@ function events_content(App $a) {
|
|||
$tz = (($orig_event['adjust']) ? date_default_timezone_get() : 'UTC');
|
||||
}
|
||||
|
||||
$syear = Temporal::convert($sdt, $tz, 'UTC', 'Y');
|
||||
$smonth = Temporal::convert($sdt, $tz, 'UTC', 'm');
|
||||
$sday = Temporal::convert($sdt, $tz, 'UTC', 'd');
|
||||
$syear = DateTimeFormat::convert($sdt, $tz, 'UTC', 'Y');
|
||||
$smonth = DateTimeFormat::convert($sdt, $tz, 'UTC', 'm');
|
||||
$sday = DateTimeFormat::convert($sdt, $tz, 'UTC', 'd');
|
||||
|
||||
$shour = ((x($orig_event)) ? Temporal::convert($sdt, $tz, 'UTC', 'H') : 0);
|
||||
$sminute = ((x($orig_event)) ? Temporal::convert($sdt, $tz, 'UTC', 'i') : 0);
|
||||
$shour = ((x($orig_event)) ? DateTimeFormat::convert($sdt, $tz, 'UTC', 'H') : 0);
|
||||
$sminute = ((x($orig_event)) ? DateTimeFormat::convert($sdt, $tz, 'UTC', 'i') : 0);
|
||||
|
||||
$fyear = Temporal::convert($fdt, $tz, 'UTC', 'Y');
|
||||
$fmonth = Temporal::convert($fdt, $tz, 'UTC', 'm');
|
||||
$fday = Temporal::convert($fdt, $tz, 'UTC', 'd');
|
||||
$fyear = DateTimeFormat::convert($fdt, $tz, 'UTC', 'Y');
|
||||
$fmonth = DateTimeFormat::convert($fdt, $tz, 'UTC', 'm');
|
||||
$fday = DateTimeFormat::convert($fdt, $tz, 'UTC', 'd');
|
||||
|
||||
$fhour = ((x($orig_event)) ? Temporal::convert($fdt, $tz, 'UTC', 'H') : 0);
|
||||
$fminute = ((x($orig_event)) ? Temporal::convert($fdt, $tz, 'UTC', 'i') : 0);
|
||||
$fhour = ((x($orig_event)) ? DateTimeFormat::convert($fdt, $tz, 'UTC', 'H') : 0);
|
||||
$fminute = ((x($orig_event)) ? DateTimeFormat::convert($fdt, $tz, 'UTC', 'i') : 0);
|
||||
|
||||
require_once 'include/acl_selectors.php' ;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\App;
|
|||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
function fsuggest_post(App $a)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ function fsuggest_post(App $a)
|
|||
dbesc($r[0]['request']),
|
||||
dbesc($r[0]['photo']),
|
||||
dbesc($hash),
|
||||
dbesc(Temporal::utcNow())
|
||||
dbesc(DateTimeFormat::utcNow())
|
||||
);
|
||||
$r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1",
|
||||
dbesc($hash),
|
||||
|
|
|
@ -12,7 +12,7 @@ use Friendica\Core\L10n;
|
|||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Protocol\Email;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
function invite_post(App $a)
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ function invite_post(App $a)
|
|||
|
||||
$r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ",
|
||||
dbesc($code),
|
||||
dbesc(Temporal::utcNow())
|
||||
dbesc(DateTimeFormat::utcNow())
|
||||
);
|
||||
|
||||
if (! is_site_admin()) {
|
||||
|
|
16
mod/item.php
16
mod/item.php
|
@ -28,8 +28,8 @@ use Friendica\Model\GContact;
|
|||
use Friendica\Model\Item;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Protocol\Email;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Emailer;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
require_once 'include/tags.php';
|
||||
|
@ -601,11 +601,11 @@ function item_post(App $a) {
|
|||
$datarray['author-link'] = $author['url'];
|
||||
$datarray['author-avatar'] = $author['thumb'];
|
||||
$datarray['author-id'] = Contact::getIdForURL($datarray['author-link'], 0);
|
||||
$datarray['created'] = Temporal::utcNow();
|
||||
$datarray['edited'] = Temporal::utcNow();
|
||||
$datarray['commented'] = Temporal::utcNow();
|
||||
$datarray['received'] = Temporal::utcNow();
|
||||
$datarray['changed'] = Temporal::utcNow();
|
||||
$datarray['created'] = DateTimeFormat::utcNow();
|
||||
$datarray['edited'] = DateTimeFormat::utcNow();
|
||||
$datarray['commented'] = DateTimeFormat::utcNow();
|
||||
$datarray['received'] = DateTimeFormat::utcNow();
|
||||
$datarray['changed'] = DateTimeFormat::utcNow();
|
||||
$datarray['extid'] = $extid;
|
||||
$datarray['guid'] = $guid;
|
||||
$datarray['uri'] = $uri;
|
||||
|
@ -709,8 +709,8 @@ function item_post(App $a) {
|
|||
'file' => $datarray['file'],
|
||||
'rendered-html' => $datarray['rendered-html'],
|
||||
'rendered-hash' => $datarray['rendered-hash'],
|
||||
'edited' => Temporal::utcNow(),
|
||||
'changed' => Temporal::utcNow()];
|
||||
'edited' => DateTimeFormat::utcNow(),
|
||||
'changed' => DateTimeFormat::utcNow()];
|
||||
|
||||
Item::update($fields, ['id' => $post_id]);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ function localtime_post(App $a)
|
|||
$bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
|
||||
|
||||
if ($_POST['timezone']) {
|
||||
$a->data['mod-localtime'] = Temporal::convert($t, $_POST['timezone'], 'UTC', $bd_format);
|
||||
$a->data['mod-localtime'] = DateTimeFormat::convert($t, $_POST['timezone'], 'UTC', $bd_format);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use Friendica\Core\L10n;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'boot.php';
|
||||
require_once 'include/datetime.php';
|
||||
|
@ -33,7 +33,7 @@ function lostpass_post(App $a)
|
|||
|
||||
$fields = [
|
||||
'pwdreset' => $pwdreset_token,
|
||||
'pwdreset_time' => Temporal::utcNow()
|
||||
'pwdreset_time' => DateTimeFormat::utcNow()
|
||||
];
|
||||
$result = dba::update('user', $fields, ['uid' => $user['uid']]);
|
||||
if ($result) {
|
||||
|
@ -92,7 +92,7 @@ function lostpass_content(App $a)
|
|||
}
|
||||
|
||||
// Password reset requests expire in 60 minutes
|
||||
if ($user['pwdreset_time'] < Temporal::utc('now - 1 hour')) {
|
||||
if ($user['pwdreset_time'] < DateTimeFormat::utc('now - 1 hour')) {
|
||||
$fields = [
|
||||
'pwdreset' => null,
|
||||
'pwdreset_time' => null
|
||||
|
|
|
@ -11,7 +11,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Mail;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/acl_selectors.php';
|
||||
require_once 'include/conversation.php';
|
||||
|
@ -397,7 +397,7 @@ function message_content(App $a)
|
|||
'body' => $body_e,
|
||||
'delete' => L10n::t('Delete message'),
|
||||
'to_name' => $to_name_e,
|
||||
'date' => Temporal::local($message['created'], 'D, d M Y - g:i A'),
|
||||
'date' => DateTimeFormat::local($message['created'], 'D, d M Y - g:i A'),
|
||||
'ago' => relative_date($message['created']),
|
||||
];
|
||||
|
||||
|
@ -498,7 +498,7 @@ function render_messages(array $msg, $t)
|
|||
'$delete' => L10n::t('Delete conversation'),
|
||||
'$body' => $body_e,
|
||||
'$to_name' => $to_name_e,
|
||||
'$date' => Temporal::local($rr['mailcreated'], L10n::t('D, d M Y - g:i A')),
|
||||
'$date' => DateTimeFormat::local($rr['mailcreated'], L10n::t('D, d M Y - g:i A')),
|
||||
'$ago' => relative_date($rr['mailcreated']),
|
||||
'$seen' => $rr['mailseen'],
|
||||
'$count' => L10n::tt('%d message', '%d messages', $rr['count']),
|
||||
|
|
|
@ -19,7 +19,7 @@ use Friendica\Model\Contact;
|
|||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Module\Login;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/conversation.php';
|
||||
require_once 'include/items.php';
|
||||
|
@ -681,11 +681,11 @@ function networkThreadedView(App $a, $update = 0)
|
|||
|
||||
if ($datequery) {
|
||||
$sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created <= '%s' ",
|
||||
dbesc(Temporal::convert($datequery, 'UTC', date_default_timezone_get()))));
|
||||
dbesc(DateTimeFormat::convert($datequery, 'UTC', date_default_timezone_get()))));
|
||||
}
|
||||
if ($datequery2) {
|
||||
$sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created >= '%s' ",
|
||||
dbesc(Temporal::convert($datequery2, 'UTC', date_default_timezone_get()))));
|
||||
dbesc(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get()))));
|
||||
}
|
||||
|
||||
$sql_order = '';
|
||||
|
@ -790,8 +790,8 @@ function networkThreadedView(App $a, $update = 0)
|
|||
$top_limit = current($r)['order_date'];
|
||||
$bottom_limit = end($r)['order_date'];
|
||||
} else {
|
||||
$top_limit = Temporal::utcNow();
|
||||
$bottom_limit = Temporal::utcNow();
|
||||
$top_limit = DateTimeFormat::utcNow();
|
||||
$bottom_limit = DateTimeFormat::utcNow();
|
||||
}
|
||||
|
||||
// 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;
|
||||
} elseif ($a->pager['page'] == 1) {
|
||||
// Highest possible top limit when we are on the first page
|
||||
$top_limit = Temporal::utcNow();
|
||||
$top_limit = DateTimeFormat::utcNow();
|
||||
}
|
||||
|
||||
$items = dba::p("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid` FROM `item`
|
||||
|
|
|
@ -20,8 +20,8 @@ use Friendica\Model\Profile;
|
|||
use Friendica\Network\Probe;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Protocol\DFRN;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Map;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
require_once 'include/items.php';
|
||||
require_once 'include/acl_selectors.php';
|
||||
|
@ -291,7 +291,7 @@ function photos_post(App $a)
|
|||
if (DBM::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc($rr['parent-uri']),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
|
@ -364,8 +364,8 @@ function photos_post(App $a)
|
|||
);
|
||||
if (DBM::is_result($i)) {
|
||||
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc($i[0]['uri']),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
|
@ -402,7 +402,7 @@ function photos_post(App $a)
|
|||
$resource_id = $a->argv[2];
|
||||
|
||||
if (!strlen($albname)) {
|
||||
$albname = Temporal::localNow('Y');
|
||||
$albname = DateTimeFormat::localNow('Y');
|
||||
}
|
||||
|
||||
if (x($_POST,'rotate') !== false &&
|
||||
|
@ -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",
|
||||
dbesc($newtag),
|
||||
dbesc($newinform),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
intval($item_id),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
|
@ -738,7 +738,7 @@ function photos_post(App $a)
|
|||
if (strlen($newalbum)) {
|
||||
$album = $newalbum;
|
||||
} else {
|
||||
$album = Temporal::localNow('Y');
|
||||
$album = DateTimeFormat::localNow('Y');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1361,7 +1361,7 @@ function photos_content(App $a)
|
|||
$photo = [
|
||||
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
||||
'title'=> L10n::t('View Full Size'),
|
||||
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . Temporal::utcNow('ymdhis'),
|
||||
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . DateTimeFormat::utcNow('ymdhis'),
|
||||
'height' => $hires['height'],
|
||||
'width' => $hires['width'],
|
||||
'album' => $hires['album'],
|
||||
|
|
12
mod/ping.php
12
mod/ping.php
|
@ -14,7 +14,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Group;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\XML;
|
||||
|
||||
require_once 'include/datetime.php';
|
||||
|
@ -225,8 +225,8 @@ function ping_init(App $a)
|
|||
WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and `ignore` = 0
|
||||
ORDER BY `start` ASC ",
|
||||
intval(local_user()),
|
||||
dbesc(Temporal::utc('now + 7 days')),
|
||||
dbesc(Temporal::utcNow())
|
||||
dbesc(DateTimeFormat::utc('now + 7 days')),
|
||||
dbesc(DateTimeFormat::utcNow())
|
||||
);
|
||||
if (DBM::is_result($ev)) {
|
||||
Cache::set($cachekey, $ev, CACHE_HOUR);
|
||||
|
@ -237,7 +237,7 @@ function ping_init(App $a)
|
|||
$all_events = count($ev);
|
||||
|
||||
if ($all_events) {
|
||||
$str_now = Temporal::timezoneNow($a->timezone, 'Y-m-d');
|
||||
$str_now = DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d');
|
||||
foreach ($ev as $x) {
|
||||
$bd = false;
|
||||
if ($x['type'] === 'birthday') {
|
||||
|
@ -246,7 +246,7 @@ function ping_init(App $a)
|
|||
} else {
|
||||
$events ++;
|
||||
}
|
||||
if (Temporal::convert($x['start'], ((intval($x['adjust'])) ? $a->timezone : 'UTC'), 'UTC', 'Y-m-d') === $str_now) {
|
||||
if (DateTimeFormat::convert($x['start'], ((intval($x['adjust'])) ? $a->timezone : 'UTC'), 'UTC', 'Y-m-d') === $str_now) {
|
||||
$all_events_today ++;
|
||||
if ($bd) {
|
||||
$birthdays_today ++;
|
||||
|
@ -362,7 +362,7 @@ function ping_init(App $a)
|
|||
$notif['photo'] = proxy_url($notif['photo'], false, PROXY_SIZE_MICRO);
|
||||
}
|
||||
|
||||
$local_time = Temporal::local($notif['date']);
|
||||
$local_time = DateTimeFormat::local($notif['date']);
|
||||
|
||||
$notifications[] = [
|
||||
'id' => $notif['id'],
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
// See here for a documentation for portable contacts:
|
||||
// https://web.archive.org/web/20160405005550/http://portablecontacts.net/draft-spec.html
|
||||
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Protocol\PortableContact;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
function poco_init(App $a) {
|
||||
$system_mode = false;
|
||||
|
@ -44,7 +45,7 @@ function poco_init(App $a) {
|
|||
if ($a->argc > 1 && $a->argv[1] === '@global') {
|
||||
// List of all profiles that this server recently had data from
|
||||
$global = true;
|
||||
$update_limit = date(Temporal::MYSQL, time() - 30 * 86400);
|
||||
$update_limit = date(DateTimeFormat::MYSQL, time() - 30 * 86400);
|
||||
}
|
||||
if ($a->argc > 2 && $a->argv[2] === '@me') {
|
||||
$justme = true;
|
||||
|
@ -81,7 +82,7 @@ function poco_init(App $a) {
|
|||
$sql_extra = sprintf(" AND `contact`.`id` = %d ", intval($cid));
|
||||
}
|
||||
if (x($_GET, 'updatedSince')) {
|
||||
$update_limit = date(Temporal::MYSQL, strtotime($_GET['updatedSince']));
|
||||
$update_limit = date(DateTimeFormat::MYSQL, strtotime($_GET['updatedSince']));
|
||||
}
|
||||
if ($global) {
|
||||
$contacts = q("SELECT count(*) AS `total` FROM `gcontact` WHERE `updated` >= '%s' AND `updated` >= `last_failure` AND NOT `hide` AND `network` IN ('%s', '%s', '%s')",
|
||||
|
|
|
@ -16,7 +16,7 @@ use Friendica\Model\Group;
|
|||
use Friendica\Model\Profile;
|
||||
use Friendica\Module\Login;
|
||||
use Friendica\Protocol\DFRN;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
function profile_init(App $a)
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ function profile_content(App $a, $update = 0)
|
|||
if ($is_owner || !$last_updated) {
|
||||
$sql_extra4 = " AND `item`.`unseen`";
|
||||
} else {
|
||||
$gmupdate = gmdate(Temporal::MYSQL, $last_updated);
|
||||
$gmupdate = gmdate(DateTimeFormat::MYSQL, $last_updated);
|
||||
$sql_extra4 = " AND `item`.`received` > '" . $gmupdate . "'";
|
||||
}
|
||||
|
||||
|
@ -272,10 +272,10 @@ function profile_content(App $a, $update = 0)
|
|||
}
|
||||
|
||||
if ($datequery) {
|
||||
$sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` <= '%s' ", dbesc(Temporal::convert($datequery, 'UTC', date_default_timezone_get()))));
|
||||
$sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` <= '%s' ", dbesc(DateTimeFormat::convert($datequery, 'UTC', date_default_timezone_get()))));
|
||||
}
|
||||
if ($datequery2) {
|
||||
$sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` >= '%s' ", dbesc(Temporal::convert($datequery2, 'UTC', date_default_timezone_get()))));
|
||||
$sql_extra2 .= protect_sprintf(sprintf(" AND `thread`.`created` >= '%s' ", dbesc(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get()))));
|
||||
}
|
||||
|
||||
// Belongs the profile page to a forum?
|
||||
|
|
|
@ -12,7 +12,7 @@ use Friendica\Database\DBM;
|
|||
use Friendica\Model\Photo;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
function profile_photo_init(App $a)
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ function profile_photo_post(App $a) {
|
|||
// so that browsers will do a cache update unconditionally
|
||||
|
||||
$r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
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",
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ use Friendica\Model\GContact;
|
|||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
function profiles_init(App $a) {
|
||||
|
||||
|
@ -220,9 +220,9 @@ function profiles_post(App $a) {
|
|||
}
|
||||
|
||||
if ($ignore_year) {
|
||||
$dob = '0000-' . Temporal::utc('1900-' . $dob, 'm-d');
|
||||
$dob = '0000-' . DateTimeFormat::utc('1900-' . $dob, 'm-d');
|
||||
} else {
|
||||
$dob = Temporal::utc($dob, 'Y-m-d');
|
||||
$dob = DateTimeFormat::utc($dob, 'Y-m-d');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ function profiles_post(App $a) {
|
|||
if (! strlen($howlong)) {
|
||||
$howlong = NULL_DATE;
|
||||
} else {
|
||||
$howlong = Temporal::convert($howlong, 'UTC', date_default_timezone_get());
|
||||
$howlong = DateTimeFormat::convert($howlong, 'UTC', date_default_timezone_get());
|
||||
}
|
||||
// linkify the relationship target if applicable
|
||||
|
||||
|
@ -488,7 +488,7 @@ function profiles_post(App $a) {
|
|||
if ($namechanged && $is_default) {
|
||||
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
|
||||
dbesc($name),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
intval(local_user())
|
||||
);
|
||||
$r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
|
||||
|
@ -725,7 +725,7 @@ function profiles_content(App $a) {
|
|||
'$gender' => ContactSelector::gender($r[0]['gender']),
|
||||
'$marital' => ContactSelector::maritalStatus($r[0]['marital']),
|
||||
'$with' => ['with', L10n::t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), L10n::t('Examples: cathy123, Cathy Williams, cathy@example.com')],
|
||||
'$howlong' => ['howlong', L10n::t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : Temporal::local($r[0]['howlong']))],
|
||||
'$howlong' => ['howlong', L10n::t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : DateTimeFormat::local($r[0]['howlong']))],
|
||||
'$sexual' => ContactSelector::sexualPreference($r[0]['sexual']),
|
||||
'$about' => ['about', L10n::t('Tell us about yourself...'), $r[0]['about']],
|
||||
'$xmpp' => ['xmpp', L10n::t("XMPP \x28Jabber\x29 address:"), $r[0]['xmpp'], L10n::t("The XMPP address will be propagated to your contacts so that they can follow you.")],
|
||||
|
|
|
@ -10,8 +10,8 @@ use Friendica\Core\System;
|
|||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
define('PROXY_DEFAULT_TIME', 86400); // 1 Day
|
||||
|
||||
|
@ -188,7 +188,7 @@ function proxy_init(App $a) {
|
|||
die();
|
||||
}
|
||||
|
||||
$fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => Temporal::utcNow(), 'edited' => Temporal::utcNow(),
|
||||
$fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => DateTimeFormat::utcNow(), 'edited' => DateTimeFormat::utcNow(),
|
||||
'filename' => basename($_REQUEST['url']), 'type' => '', 'album' => '', 'height' => imagesy($image), 'width' => imagesx($image),
|
||||
'datasize' => 0, 'data' => $img_str, 'scale' => 100, 'profile' => 0,
|
||||
'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime];
|
||||
|
|
|
@ -4,8 +4,8 @@ use Friendica\App;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
function post_var($name) {
|
||||
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
|
||||
|
@ -139,7 +139,7 @@ function pubsubhubbub_init(App $a) {
|
|||
dbesc($hub_callback));
|
||||
|
||||
if ($subscribe) {
|
||||
$last_update = Temporal::utcNow();
|
||||
$last_update = DateTimeFormat::utcNow();
|
||||
$push_flag = 0;
|
||||
|
||||
// if we are just updating an old subscription, keep the
|
||||
|
|
|
@ -11,7 +11,7 @@ use Friendica\Core\PConfig;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
require_once 'include/bbcode.php';
|
||||
|
@ -118,7 +118,7 @@ function register_post(App $a)
|
|||
$hash = random_string();
|
||||
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language`, `note` ) VALUES ( '%s', '%s', %d, '%s', '%s', '%s' ) ",
|
||||
dbesc($hash),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
intval($user['uid']),
|
||||
dbesc($result['password']),
|
||||
dbesc($lang),
|
||||
|
|
|
@ -17,6 +17,7 @@ use Friendica\Model\GContact;
|
|||
use Friendica\Model\Group;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Protocol\Email;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
|
@ -631,7 +632,7 @@ function settings_post(App $a)
|
|||
if ($name_change) {
|
||||
q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self`",
|
||||
dbesc($username),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
intval(local_user())
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ use Friendica\Model\Contact;
|
|||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Protocol\DFRN;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/items.php';
|
||||
require_once 'include/acl_selectors.php';
|
||||
|
@ -170,8 +170,8 @@ function videos_post(App $a) {
|
|||
//echo "<pre>"; var_dump($i); killme();
|
||||
if (DBM::is_result($i)) {
|
||||
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(Temporal::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc(DateTimeFormat::utcNow()),
|
||||
dbesc($i[0]['uri']),
|
||||
intval(local_user())
|
||||
);
|
||||
|
|
|
@ -7,8 +7,8 @@ use Friendica\App;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Mimetype;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
require_once 'include/datetime.php';
|
||||
|
||||
|
@ -124,7 +124,7 @@ function wall_attach_post(App $a) {
|
|||
$filedata = @file_get_contents($src);
|
||||
$mimetype = Mimetype::getContentType($filename);
|
||||
$hash = get_guid(64);
|
||||
$created = Temporal::utcNow();
|
||||
$created = DateTimeFormat::utcNow();
|
||||
|
||||
$fields = ['uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
|
||||
'filesize' => $filesize, 'data' => $filedata, 'created' => $created, 'edited' => $created,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue