use Friendica\Network\HTTPException\UnauthorizedException;
use Friendica\Object\Image;
use Friendica\Protocol\Diaspora;
+use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
-use Friendica\Util\Temporal;
use Friendica\Util\XML;
require_once 'include/bbcode.php';
function api_date($str)
{
// Wed May 23 06:01:13 +0000 2007
- return Temporal::utc($str, "D M d H:i:s +0000 Y");
+ return DateTimeFormat::utc($str, "D M d H:i:s +0000 Y");
}
/**
'self' => System::baseUrl() . "/" . $a->query_string,
'base' => System::baseUrl(),
'updated' => api_date(null),
- 'atom_updated' => Temporal::utcNow(Temporal::ATOM),
+ 'atom_updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
'language' => $user_info['language'],
'logo' => System::baseUrl() . "/images/friendica-32.png",
];
// Check for throttling (maximum posts per day, week and month)
$throttle_day = Config::get('system', 'throttle_limit_day');
if ($throttle_day > 0) {
- $datefrom = date(Temporal::MYSQL, time() - 24*60*60);
+ $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60);
$r = q(
"SELECT COUNT(*) AS `posts_day` FROM `item` WHERE `uid`=%d AND `wall`
$throttle_week = Config::get('system', 'throttle_limit_week');
if ($throttle_week > 0) {
- $datefrom = date(Temporal::MYSQL, time() - 24*60*60*7);
+ $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*7);
$r = q(
"SELECT COUNT(*) AS `posts_week` FROM `item` WHERE `uid`=%d AND `wall`
$throttle_month = Config::get('system', 'throttle_limit_month');
if ($throttle_month > 0) {
- $datefrom = date(Temporal::MYSQL, time() - 24*60*60*30);
+ $datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*30);
$r = q(
"SELECT COUNT(*) AS `posts_month` FROM `item` WHERE `uid`=%d AND `wall`
'@attributes' => ["type" => "integer"],
'hourly-limit' => '150',
'@attributes2' => ["type" => "integer"],
- 'reset-time' => Temporal::utc('now + 1 hour', Temporal::ATOM),
+ 'reset-time' => DateTimeFormat::utc('now + 1 hour', DateTimeFormat::ATOM),
'@attributes3' => ["type" => "datetime"],
'reset_time_in_seconds' => strtotime('now + 1 hour'),
'@attributes4' => ["type" => "integer"],
'reset_time_in_seconds' => strtotime('now + 1 hour'),
'remaining_hits' => '150',
'hourly_limit' => '150',
- 'reset_time' => api_date(Temporal::utc('now + 1 hour', Temporal::ATOM)),
+ 'reset_time' => api_date(DateTimeFormat::utc('now + 1 hour', DateTimeFormat::ATOM)),
];
}
$result = q(
"UPDATE `photo` SET %s, `edited`='%s' WHERE `uid` = %d AND `resource-id` = '%s' AND `album` = '%s'",
$sql_extra,
- Temporal::utcNow(), // update edited timestamp
+ DateTimeFormat::utcNow(), // update edited timestamp
intval(api_user()),
dbesc($photo_id),
dbesc($album)
q(
"UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
- dbesc(Temporal::utcNow()),
+ dbesc(DateTimeFormat::utcNow()),
intval(local_user())
);