<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
- * @license GNU AGPL version 3 or any later version
+ * @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
+use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI;
* @throws HTTPException\ForbiddenException
* @throws HTTPException\InternalServerErrorException
*/
- public static function content()
+ protected function content(array $request = []): string
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
*
* @throws HTTPException\ForbiddenException
*/
- public static function rawContent()
+ protected function rawContent(array $request = [])
{
if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
self::exportContactsAsCSV(local_user());
break;
}
-
- exit();
+ System::exit();
}
}
*/
private static function exportMultiRow(string $query)
{
- $dbStructure = DBStructure::definition(DI::app()->getBasePath(), false);
+ $dbStructure = DI::dbaDefinition()->getAll();
preg_match("/\s+from\s+`?([a-z\d_]+)`?/i", $query, $match);
$table = $match[1];
*/
private static function exportRow(string $query)
{
- $dbStructure = DBStructure::definition(DI::app()->getBasePath(), false);
+ $dbStructure = DI::dbaDefinition()->getAll();
preg_match("/\s+from\s+`?([a-z\d_]+)`?/i", $query, $match);
$table = $match[1];