function fbrowser_content(App $a)
{
if (!local_user()) {
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if (DI::args()->getArgc() == 1) {
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
// Needed to match the correct template in a module that uses a different theme than the user/site/default
if (!$can_post) {
notice(DI::l10n()->t('Permission denied.'));
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$owner_record = User::getOwnerDataById($page_owner_uid);
if (!$owner_record) {
notice(DI::l10n()->t('Contact information unavailable'));
DI::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$aclFormatter = DI::aclFormatter();
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
+use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
} else {
throw new \Friendica\Network\HTTPException\NotFoundException();
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
// when receiving an XML feed, always return OK
use Friendica\App;
use Friendica\Core\Logger;
+use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\PushSubscriber;
throw new \Friendica\Network\HTTPException\AcceptedException();
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
use Friendica\App;
use Friendica\Content\Text\BBCode;
+use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
if (!$post_id || !local_user()) {
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar',
$item = Post::selectFirst($fields, ['id' => $post_id]);
if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) {
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if (strpos($item['body'], "[/share]") !== false) {
}
echo $o;
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
}
notice(DI::l10n()->t('Permission denied.') . EOL );
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if (empty($_FILES['userfile'])) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$src = $_FILES['userfile']['tmp_name'];
} else {
notice($msg);
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if ($maxfilesize && $filesize > $maxfilesize) {
} else {
echo $msg . EOL;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$newid = Attach::storeFile($src, $page_owner_uid, $filename, '<' . $page_owner_cid . '>');
} else {
echo $msg . EOL;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if ($r_json) {
$lf = "\n";
echo $lf . $lf . '[attachment]' . $newid . '[/attachment]' . $lf;
- DI::page()->logRuntime();
- exit();
+ System::exit();
// NOTREACHED
}
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
}
notice(DI::l10n()->t('Permission denied.'));
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
if ($r_json) {
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$src = '';
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
}
notice(DI::l10n()->t('Invalid request.'));
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
} else {
echo $msg. EOL;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$Image->orient($src);
} else {
echo $msg. EOL;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
} else {
echo $msg. EOL;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if ($width > 640 || $height > 640) {
}
echo "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $resource_id . '][img]' . DI::baseUrl() . "/photo/{$resource_id}-{$smallest}.".$Image->getExt()."[/img][/url]\n\n";
- DI::page()->logRuntime();
- exit();
+ System::exit();
// NOTREACHED
}
$this->profiler->set(microtime(true) - $timestamp, 'content');
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
$page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig);
- $page->logRuntime();
} else {
$page->exit($response);
}
} catch (HTTPException $e) {
(new ModuleHTTPException())->rawContent($e);
}
+ $page->logRuntime();
}
/**
}
echo $response->getBody();
- $this->logRuntime();
}
/**
DI::apiResponse()->addContent(XML::fromArray(["result" => $result], $xml));
DI::page()->exit(DI::apiResponse()->generate());
- exit();
+ self::exit();
}
/**
DI::apiResponse()->addContent($content);
DI::page()->exit(DI::apiResponse()->generate());
- exit();
+ self::exit();
}
/**
DI::apiResponse()->setType($responce, $content_type);
DI::apiResponse()->addContent($content);
DI::page()->exit(DI::apiResponse()->generate());
- exit();
+
+ self::exit();
}
public static function jsonError($httpCode, $content, $content_type = 'application/json')
DI::apiResponse()->setType(Response::TYPE_JSON, $content_type);
DI::apiResponse()->addContent(json_encode($content, $options));
DI::page()->exit(DI::apiResponse()->generate());
+
+ self::exit();
+ }
+
+ /**
+ * Exit the program execution.
+ */
+ public static function exit()
+ {
+ DI::page()->logRuntime();
exit();
}
case 307:
throw new TemporaryRedirectException();
}
- DI::page()->logRuntime();
- exit();
+ self::exit();
}
/**
echo str_replace("\t", " ", $o);
echo "</section>";
echo "</body></html>\r\n";
- DI::page()->logRuntime();
- exit();
+ self::exit();
}
/**
namespace Friendica\Module\Admin;
-use Friendica\DI;
+use Friendica\Core\System;
use Friendica\Module\BaseAdmin;
class PhpInfo extends BaseAdmin
self::checkAdminAccess();
phpinfo();
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
use Friendica\BaseModule;
use Friendica\Core\Logger;
+use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Attach as MAttach;
}
echo $data;
- DI::page()->logRuntime();
- exit();
+ System::exit();
// NOTREACHED
}
}
use Friendica\BaseModule;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
+use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
]);
echo $o;
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
namespace Friendica\Module\Debug;
use Friendica\BaseModule;
+use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Post;
use Friendica\Network\HTTPException;
if (!empty($item)) {
if (DI::mode()->isAjax()) {
echo str_replace("\n", '<br />', $item['body']);
- DI::page()->logRuntime();
- exit();
+ System::exit();
} else {
return str_replace("\n", '<br />', $item['body']);
}
if ($change) {
$tpl = Renderer::getMarkupTemplate('groupeditor.tpl');
echo Renderer::replaceMacros($tpl, $context);
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
return Renderer::replaceMacros($tpl, $context);
namespace Friendica\Module\HTTPException;
use Friendica\BaseModule;
+use Friendica\Core\System;
use Friendica\DI;
use Friendica\Network\HTTPException;
use Psr\Http\Message\ResponseInterface;
$queryString = $this->server['QUERY_STRING'];
// Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit.
if (!empty($queryString) && preg_match('/{[0-9]}/', $queryString) !== 0) {
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
use Friendica\BaseModule;
use Friendica\Content;
+use Friendica\Core\System;
use Friendica\DI;
use Friendica\Util\Strings;
if (DI::args()->getArgv()[1] == 'b2h') {
$url = ["", trim(hex2bin($_REQUEST['url']))];
echo Content\OEmbed::replaceCallback($url);
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
// Unused form: /oembed/h2b?text=...
if (DI::args()->getArgv()[1] == 'h2b') {
$text = trim(hex2bin($_REQUEST['text']));
echo Content\OEmbed::HTML2BBCode($text);
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
// @TODO: Replace with parameter from router
echo $j->html;
echo '</body></html>';
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
namespace Friendica\Module;
use Friendica\Core\Hook;
+use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\APContact;
} else {
echo $o . $receivers;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
/**
use Friendica\Model\Profile;
use Friendica\Core\Storage\Type\ExternalResource;
use Friendica\Core\Storage\Type\SystemResource;
+use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Model\User;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
'output' => number_format($output, 3), 'rest' => number_format($rest, 3)]);
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
private static function getPhotoByid(int $id, $type, $customsize)
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (31536000)) . ' GMT');
header('Cache-Control: max-age=31536000');
echo $img->asString();
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\DI;
+use Friendica\Core\System;
/**
* Return the default robots.txt
foreach ($allDisalloweds as $disallowed) {
echo 'Disallow: ' . $disallowed . PHP_EOL;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
+use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI;
self::exportContactsAsCSV(local_user());
break;
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\DI;
+use Friendica\Core\System;
use Friendica\Util\Strings;
/**
if (file_exists("view/theme/$theme/style.php")) {
require_once "view/theme/$theme/style.php";
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
'credits' => $credits,
]);
}
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
}
protected function rawContent(array $request = [])
{
if (!isset($_GET['p']) || !isset($_GET['item'])) {
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$this->parseRequest($_GET);
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Logger;
use Exception;
+use Friendica\Core\System;
use Friendica\DI;
/**
if ($recursion > 5) {
Logger::error('jsonld bomb detected at: ' . $url);
- DI::page()->logRuntime();
- exit();
+ System::exit();
}
$result = DI::cache()->get('documentLoader:' . $url);