Merge pull request #11528 from annando/logruntime
Log the execution time
This commit is contained in:
commit
23e5ae15e3
27 changed files with 95 additions and 53 deletions
|
@ -39,11 +39,11 @@ use Friendica\Util\Strings;
|
||||||
function fbrowser_content(App $a)
|
function fbrowser_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DI::args()->getArgc() == 1) {
|
if (DI::args()->getArgc() == 1) {
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Needed to match the correct template in a module that uses a different theme than the user/site/default
|
// Needed to match the correct template in a module that uses a different theme than the user/site/default
|
||||||
|
|
|
@ -158,7 +158,7 @@ function photos_post(App $a)
|
||||||
|
|
||||||
if (!$can_post) {
|
if (!$can_post) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
notice(DI::l10n()->t('Permission denied.'));
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$owner_record = User::getOwnerDataById($page_owner_uid);
|
$owner_record = User::getOwnerDataById($page_owner_uid);
|
||||||
|
@ -166,7 +166,7 @@ function photos_post(App $a)
|
||||||
if (!$owner_record) {
|
if (!$owner_record) {
|
||||||
notice(DI::l10n()->t('Contact information unavailable'));
|
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::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$aclFormatter = DI::aclFormatter();
|
$aclFormatter = DI::aclFormatter();
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -38,7 +39,7 @@ function hub_return($valid, $body)
|
||||||
} else {
|
} else {
|
||||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// when receiving an XML feed, always return OK
|
// when receiving an XML feed, always return OK
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\PushSubscriber;
|
use Friendica\Model\PushSubscriber;
|
||||||
|
@ -142,5 +143,5 @@ function pubsubhubbub_init(App $a) {
|
||||||
|
|
||||||
throw new \Friendica\Network\HTTPException\AcceptedException();
|
throw new \Friendica\Network\HTTPException\AcceptedException();
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -30,7 +31,7 @@ function share_init(App $a) {
|
||||||
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
||||||
|
|
||||||
if (!$post_id || !local_user()) {
|
if (!$post_id || !local_user()) {
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar',
|
$fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar',
|
||||||
|
@ -38,7 +39,7 @@ function share_init(App $a) {
|
||||||
$item = Post::selectFirst($fields, ['id' => $post_id]);
|
$item = Post::selectFirst($fields, ['id' => $post_id]);
|
||||||
|
|
||||||
if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) {
|
if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) {
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($item['body'], "[/share]") !== false) {
|
if (strpos($item['body'], "[/share]") !== false) {
|
||||||
|
@ -56,5 +57,5 @@ function share_init(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $o;
|
echo $o;
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,6 +167,5 @@ EOT;
|
||||||
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
|
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
|
||||||
|
|
||||||
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
|
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
|
||||||
|
System::exit();
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,14 +67,14 @@ function wall_attach_post(App $a) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
||||||
}
|
}
|
||||||
notice(DI::l10n()->t('Permission denied.') . EOL );
|
notice(DI::l10n()->t('Permission denied.') . EOL );
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($_FILES['userfile'])) {
|
if (empty($_FILES['userfile'])) {
|
||||||
if ($r_json) {
|
if ($r_json) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$src = $_FILES['userfile']['tmp_name'];
|
$src = $_FILES['userfile']['tmp_name'];
|
||||||
|
@ -97,7 +97,7 @@ function wall_attach_post(App $a) {
|
||||||
} else {
|
} else {
|
||||||
notice($msg);
|
notice($msg);
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($maxfilesize && $filesize > $maxfilesize) {
|
if ($maxfilesize && $filesize > $maxfilesize) {
|
||||||
|
@ -108,7 +108,7 @@ function wall_attach_post(App $a) {
|
||||||
} else {
|
} else {
|
||||||
echo $msg . EOL;
|
echo $msg . EOL;
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$newid = Attach::storeFile($src, $page_owner_uid, $filename, '<' . $page_owner_cid . '>');
|
$newid = Attach::storeFile($src, $page_owner_uid, $filename, '<' . $page_owner_cid . '>');
|
||||||
|
@ -122,7 +122,7 @@ function wall_attach_post(App $a) {
|
||||||
} else {
|
} else {
|
||||||
echo $msg . EOL;
|
echo $msg . EOL;
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($r_json) {
|
if ($r_json) {
|
||||||
|
@ -132,7 +132,6 @@ function wall_attach_post(App $a) {
|
||||||
$lf = "\n";
|
$lf = "\n";
|
||||||
|
|
||||||
echo $lf . $lf . '[attachment]' . $newid . '[/attachment]' . $lf;
|
echo $lf . $lf . '[attachment]' . $newid . '[/attachment]' . $lf;
|
||||||
|
System::exit();
|
||||||
exit();
|
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,14 +89,14 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
||||||
}
|
}
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
notice(DI::l10n()->t('Permission denied.'));
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
|
if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
|
||||||
if ($r_json) {
|
if ($r_json) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$src = '';
|
$src = '';
|
||||||
|
@ -148,7 +148,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
notice(DI::l10n()->t('Invalid request.'));
|
notice(DI::l10n()->t('Invalid request.'));
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
|
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
|
||||||
|
@ -167,7 +167,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
} else {
|
} else {
|
||||||
echo $msg. EOL;
|
echo $msg. EOL;
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$Image->orient($src);
|
$Image->orient($src);
|
||||||
|
@ -205,7 +205,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
} else {
|
} else {
|
||||||
echo $msg. EOL;
|
echo $msg. EOL;
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
} else {
|
} else {
|
||||||
echo $msg. EOL;
|
echo $msg. EOL;
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($width > 640 || $height > 640) {
|
if ($width > 640 || $height > 640) {
|
||||||
|
@ -281,6 +281,6 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
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";
|
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";
|
||||||
exit();
|
System::exit();
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
|
@ -576,6 +576,7 @@ class App
|
||||||
$this->profiler->set(microtime(true), 'classinit');
|
$this->profiler->set(microtime(true), 'classinit');
|
||||||
|
|
||||||
$moduleName = $this->args->getModuleName();
|
$moduleName = $this->args->getModuleName();
|
||||||
|
$page->setLogging($this->args->getCommand(), $this->args->getMethod());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Missing DB connection: ERROR
|
// Missing DB connection: ERROR
|
||||||
|
@ -718,6 +719,7 @@ class App
|
||||||
} catch (HTTPException $e) {
|
} catch (HTTPException $e) {
|
||||||
(new ModuleHTTPException())->rawContent($e);
|
(new ModuleHTTPException())->rawContent($e);
|
||||||
}
|
}
|
||||||
|
$page->logRuntime();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,6 +30,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Theme;
|
use Friendica\Core\Theme;
|
||||||
|
@ -78,14 +79,31 @@ class Page implements ArrayAccess
|
||||||
*/
|
*/
|
||||||
private $basePath;
|
private $basePath;
|
||||||
|
|
||||||
|
private $timestamp = 0;
|
||||||
|
private $command = '';
|
||||||
|
private $method = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $basepath The Page basepath
|
* @param string $basepath The Page basepath
|
||||||
*/
|
*/
|
||||||
public function __construct(string $basepath)
|
public function __construct(string $basepath)
|
||||||
{
|
{
|
||||||
|
$this->timestamp = microtime(true);
|
||||||
$this->basePath = $basepath;
|
$this->basePath = $basepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setLogging(string $command, string $method)
|
||||||
|
{
|
||||||
|
$this->command = $command;
|
||||||
|
$this->method = $method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function logRuntime()
|
||||||
|
{
|
||||||
|
$runtime = number_format(microtime(true) - $this->timestamp, 3);
|
||||||
|
Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether a offset exists
|
* Whether a offset exists
|
||||||
*
|
*
|
||||||
|
@ -421,6 +439,9 @@ class Page implements ArrayAccess
|
||||||
{
|
{
|
||||||
$moduleName = $args->getModuleName();
|
$moduleName = $args->getModuleName();
|
||||||
|
|
||||||
|
$this->command = $moduleName;
|
||||||
|
$this->method = $args->getMethod();
|
||||||
|
|
||||||
/* Create the page content.
|
/* Create the page content.
|
||||||
* Calls all hooks which are including content operations
|
* Calls all hooks which are including content operations
|
||||||
*
|
*
|
||||||
|
|
|
@ -295,7 +295,7 @@ class System
|
||||||
DI::apiResponse()->addContent(XML::fromArray(["result" => $result], $xml));
|
DI::apiResponse()->addContent(XML::fromArray(["result" => $result], $xml));
|
||||||
DI::page()->exit(DI::apiResponse()->generate());
|
DI::page()->exit(DI::apiResponse()->generate());
|
||||||
|
|
||||||
exit();
|
self::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -315,7 +315,7 @@ class System
|
||||||
DI::apiResponse()->addContent($content);
|
DI::apiResponse()->addContent($content);
|
||||||
DI::page()->exit(DI::apiResponse()->generate());
|
DI::page()->exit(DI::apiResponse()->generate());
|
||||||
|
|
||||||
exit();
|
self::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -331,7 +331,8 @@ class System
|
||||||
DI::apiResponse()->setType($responce, $content_type);
|
DI::apiResponse()->setType($responce, $content_type);
|
||||||
DI::apiResponse()->addContent($content);
|
DI::apiResponse()->addContent($content);
|
||||||
DI::page()->exit(DI::apiResponse()->generate());
|
DI::page()->exit(DI::apiResponse()->generate());
|
||||||
exit();
|
|
||||||
|
self::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function jsonError($httpCode, $content, $content_type = 'application/json')
|
public static function jsonError($httpCode, $content, $content_type = 'application/json')
|
||||||
|
@ -359,6 +360,16 @@ class System
|
||||||
DI::apiResponse()->setType(Response::TYPE_JSON, $content_type);
|
DI::apiResponse()->setType(Response::TYPE_JSON, $content_type);
|
||||||
DI::apiResponse()->addContent(json_encode($content, $options));
|
DI::apiResponse()->addContent(json_encode($content, $options));
|
||||||
DI::page()->exit(DI::apiResponse()->generate());
|
DI::page()->exit(DI::apiResponse()->generate());
|
||||||
|
|
||||||
|
self::exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exit the program execution.
|
||||||
|
*/
|
||||||
|
public static function exit()
|
||||||
|
{
|
||||||
|
DI::page()->logRuntime();
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,8 +459,7 @@ class System
|
||||||
case 307:
|
case 307:
|
||||||
throw new TemporaryRedirectException();
|
throw new TemporaryRedirectException();
|
||||||
}
|
}
|
||||||
|
self::exit();
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -522,7 +532,7 @@ class System
|
||||||
echo str_replace("\t", " ", $o);
|
echo str_replace("\t", " ", $o);
|
||||||
echo "</section>";
|
echo "</section>";
|
||||||
echo "</body></html>\r\n";
|
echo "</body></html>\r\n";
|
||||||
exit();
|
self::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Admin;
|
namespace Friendica\Module\Admin;
|
||||||
|
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Module\BaseAdmin;
|
use Friendica\Module\BaseAdmin;
|
||||||
|
|
||||||
class PhpInfo extends BaseAdmin
|
class PhpInfo extends BaseAdmin
|
||||||
|
@ -30,6 +31,6 @@ class PhpInfo extends BaseAdmin
|
||||||
self::checkAdminAccess();
|
self::checkAdminAccess();
|
||||||
|
|
||||||
phpinfo();
|
phpinfo();
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Attach as MAttach;
|
use Friendica\Model\Attach as MAttach;
|
||||||
|
|
||||||
|
@ -72,7 +73,7 @@ class Attach extends BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $data;
|
echo $data;
|
||||||
exit();
|
System::exit();
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ namespace Friendica\Module\Contact;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session;
|
use Friendica\Core\Session;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -107,6 +108,6 @@ class Hovercard extends BaseModule
|
||||||
]);
|
]);
|
||||||
|
|
||||||
echo $o;
|
echo $o;
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
namespace Friendica\Module\Debug;
|
namespace Friendica\Module\Debug;
|
||||||
|
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
|
@ -48,7 +49,7 @@ class ItemBody extends BaseModule
|
||||||
if (!empty($item)) {
|
if (!empty($item)) {
|
||||||
if (DI::mode()->isAjax()) {
|
if (DI::mode()->isAjax()) {
|
||||||
echo str_replace("\n", '<br />', $item['body']);
|
echo str_replace("\n", '<br />', $item['body']);
|
||||||
exit();
|
System::exit();
|
||||||
} else {
|
} else {
|
||||||
return str_replace("\n", '<br />', $item['body']);
|
return str_replace("\n", '<br />', $item['body']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -360,7 +360,7 @@ class Group extends BaseModule
|
||||||
if ($change) {
|
if ($change) {
|
||||||
$tpl = Renderer::getMarkupTemplate('groupeditor.tpl');
|
$tpl = Renderer::getMarkupTemplate('groupeditor.tpl');
|
||||||
echo Renderer::replaceMacros($tpl, $context);
|
echo Renderer::replaceMacros($tpl, $context);
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Renderer::replaceMacros($tpl, $context);
|
return Renderer::replaceMacros($tpl, $context);
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
namespace Friendica\Module\HTTPException;
|
namespace Friendica\Module\HTTPException;
|
||||||
|
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
@ -47,7 +48,7 @@ class PageNotFound extends BaseModule
|
||||||
$queryString = $this->server['QUERY_STRING'];
|
$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.
|
// 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) {
|
if (!empty($queryString) && preg_match('/{[0-9]}/', $queryString) !== 0) {
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
|
if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content;
|
use Friendica\Content;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
@ -43,14 +44,14 @@ class Oembed extends BaseModule
|
||||||
if (DI::args()->getArgv()[1] == 'b2h') {
|
if (DI::args()->getArgv()[1] == 'b2h') {
|
||||||
$url = ["", trim(hex2bin($_REQUEST['url']))];
|
$url = ["", trim(hex2bin($_REQUEST['url']))];
|
||||||
echo Content\OEmbed::replaceCallback($url);
|
echo Content\OEmbed::replaceCallback($url);
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unused form: /oembed/h2b?text=...
|
// Unused form: /oembed/h2b?text=...
|
||||||
if (DI::args()->getArgv()[1] == 'h2b') {
|
if (DI::args()->getArgv()[1] == 'h2b') {
|
||||||
$text = trim(hex2bin($_REQUEST['text']));
|
$text = trim(hex2bin($_REQUEST['text']));
|
||||||
echo Content\OEmbed::HTML2BBCode($text);
|
echo Content\OEmbed::HTML2BBCode($text);
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: Replace with parameter from router
|
// @TODO: Replace with parameter from router
|
||||||
|
@ -68,6 +69,6 @@ class Oembed extends BaseModule
|
||||||
echo $j->html;
|
echo $j->html;
|
||||||
echo '</body></html>';
|
echo '</body></html>';
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\APContact;
|
use Friendica\Model\APContact;
|
||||||
|
@ -164,8 +165,7 @@ class PermissionTooltip extends \Friendica\BaseModule
|
||||||
} else {
|
} else {
|
||||||
echo $o . $receivers;
|
echo $o . $receivers;
|
||||||
}
|
}
|
||||||
|
System::exit();
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,6 +32,7 @@ use Friendica\Model\Post;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
use Friendica\Core\Storage\Type\ExternalResource;
|
use Friendica\Core\Storage\Type\ExternalResource;
|
||||||
use Friendica\Core\Storage\Type\SystemResource;
|
use Friendica\Core\Storage\Type\SystemResource;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||||
|
@ -224,7 +225,7 @@ class Photo extends BaseModule
|
||||||
'output' => number_format($output, 3), 'rest' => number_format($rest, 3)]);
|
'output' => number_format($output, 3), 'rest' => number_format($rest, 3)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getPhotoByid(int $id, $type, $customsize)
|
private static function getPhotoByid(int $id, $type, $customsize)
|
||||||
|
|
|
@ -202,6 +202,6 @@ class Proxy extends BaseModule
|
||||||
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (31536000)) . ' GMT');
|
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (31536000)) . ' GMT');
|
||||||
header('Cache-Control: max-age=31536000');
|
header('Cache-Control: max-age=31536000');
|
||||||
echo $img->asString();
|
echo $img->asString();
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
|
use Friendica\Core\System;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the default robots.txt
|
* Return the default robots.txt
|
||||||
|
@ -44,6 +45,6 @@ class RobotsTxt extends BaseModule
|
||||||
foreach ($allDisalloweds as $disallowed) {
|
foreach ($allDisalloweds as $disallowed) {
|
||||||
echo 'Disallow: ' . $disallowed . PHP_EOL;
|
echo 'Disallow: ' . $disallowed . PHP_EOL;
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Module\Settings;
|
||||||
|
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -112,8 +113,7 @@ class UserExport extends BaseSettings
|
||||||
self::exportContactsAsCSV(local_user());
|
self::exportContactsAsCSV(local_user());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
System::exit();
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\DI;
|
use Friendica\Core\System;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +45,6 @@ class Theme extends BaseModule
|
||||||
if (file_exists("view/theme/$theme/style.php")) {
|
if (file_exists("view/theme/$theme/style.php")) {
|
||||||
require_once "view/theme/$theme/style.php";
|
require_once "view/theme/$theme/style.php";
|
||||||
}
|
}
|
||||||
|
System::exit();
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,6 @@ class ThemeDetails extends BaseModule
|
||||||
'credits' => $credits,
|
'credits' => $credits,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Network extends NetworkModule
|
||||||
protected function rawContent(array $request = [])
|
protected function rawContent(array $request = [])
|
||||||
{
|
{
|
||||||
if (!isset($_GET['p']) || !isset($_GET['item'])) {
|
if (!isset($_GET['p']) || !isset($_GET['item'])) {
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->parseRequest($_GET);
|
$this->parseRequest($_GET);
|
||||||
|
|
|
@ -24,6 +24,7 @@ namespace Friendica\Util;
|
||||||
use Friendica\Core\Cache\Enum\Duration;
|
use Friendica\Core\Cache\Enum\Duration;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,7 +70,7 @@ class JsonLD
|
||||||
|
|
||||||
if ($recursion > 5) {
|
if ($recursion > 5) {
|
||||||
Logger::error('jsonld bomb detected at: ' . $url);
|
Logger::error('jsonld bomb detected at: ' . $url);
|
||||||
exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = DI::cache()->get('documentLoader:' . $url);
|
$result = DI::cache()->get('documentLoader:' . $url);
|
||||||
|
|
Loading…
Reference in a new issue