diff --git a/include/conversation.php b/include/conversation.php index 7025cf4cab..bf1f5645b1 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -480,7 +480,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ */ $live_update_div = '
' . "\r\n" . "\r\n"; } } elseif ($mode === 'contacts') { @@ -549,7 +549,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ if (!$update) { $live_update_div = '
' . "\r\n" - . "\r\n"; } } elseif ($mode === 'search') { diff --git a/mod/api.php b/mod/api.php index b6a2c0b59f..842c1a74dc 100644 --- a/mod/api.php +++ b/mod/api.php @@ -45,7 +45,7 @@ function api_post(App $a) function api_content(App $a) { - if ($a->cmd == 'api/oauth/authorize') { + if (DI::args()->getCommand() == 'api/oauth/authorize') { /* * api/oauth/authorize interact with the user. return a standard page */ diff --git a/mod/cal.php b/mod/cal.php index 5a4f0a9c51..62508fbef7 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -221,7 +221,7 @@ function cal_content(App $a) foreach ($r as $rr) { $j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j'); if (empty($links[$j])) { - $links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j; + $links[$j] = System::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j; } } } diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index f7dc5f55cd..7f0ad805a7 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -335,19 +335,19 @@ function dfrn_request_post(App $a) $url = Network::isUrlValid($url); if (!$url) { notice(L10n::t('Invalid profile URL.') . EOL); - DI::baseUrl()->redirect($a->cmd); + DI::baseUrl()->redirect(DI::args()->getCommand()); return; // NOTREACHED } if (!Network::isUrlAllowed($url)) { notice(L10n::t('Disallowed profile URL.') . EOL); - DI::baseUrl()->redirect($a->cmd); + DI::baseUrl()->redirect(DI::args()->getCommand()); return; // NOTREACHED } if (Network::isUrlBlocked($url)) { notice(L10n::t('Blocked domain') . EOL); - DI::baseUrl()->redirect($a->cmd); + DI::baseUrl()->redirect(DI::args()->getCommand()); return; // NOTREACHED } @@ -355,7 +355,7 @@ function dfrn_request_post(App $a) if (!count($parms)) { notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL); - DI::baseUrl()->redirect($a->cmd); + DI::baseUrl()->redirect(DI::args()->getCommand()); } else { if (empty($parms['fn'])) { notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL); diff --git a/mod/events.php b/mod/events.php index ddcac1bd15..991d0cef7b 100644 --- a/mod/events.php +++ b/mod/events.php @@ -217,7 +217,7 @@ function events_content(App $a) } if ($a->argc == 1) { - $_SESSION['return_path'] = $a->cmd; + $_SESSION['return_path'] = DI::args()->getCommand(); } if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) { @@ -350,7 +350,7 @@ function events_content(App $a) foreach ($r as $rr) { $j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j'); if (empty($links[$j])) { - $links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j; + $links[$j] = System::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j; } } } diff --git a/mod/match.php b/mod/match.php index 41346bc89d..189210f4b5 100644 --- a/mod/match.php +++ b/mod/match.php @@ -11,6 +11,7 @@ use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Profile; use Friendica\Util\Network; @@ -38,7 +39,7 @@ function match_content(App $a) $a->page['aside'] .= Widget::findPeople(); $a->page['aside'] .= Widget::follow(); - $_SESSION['return_path'] = $a->cmd; + $_SESSION['return_path'] = DI::args()->getCommand(); $profile = Profile::getByUID(local_user()); diff --git a/mod/message.php b/mod/message.php index 46ed9b0c12..4c6aa3d848 100644 --- a/mod/message.php +++ b/mod/message.php @@ -89,7 +89,7 @@ function message_post(App $a) $a->argc = 2; $a->argv[1] = 'new'; } else { - DI::baseUrl()->redirect($a->cmd . '/' . $ret); + DI::baseUrl()->redirect(DI::args()->getCommand() . '/' . $ret); } } diff --git a/mod/network.php b/mod/network.php index adc315a548..be121540c1 100644 --- a/mod/network.php +++ b/mod/network.php @@ -914,7 +914,7 @@ function network_tabs(App $a) $all_active = 'active'; } - $cmd = $a->cmd; + $cmd = DI::args()->getCommand(); // tabs $tabs = [ diff --git a/mod/photos.php b/mod/photos.php index 6398211c9b..a0a1be9327 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -846,7 +846,7 @@ function photos_content(App $a) $phototypes = Images::supportedTypes(); - $_SESSION['photo_return'] = $a->cmd; + $_SESSION['photo_return'] = DI::args()->getCommand(); // Parse arguments $datum = null; @@ -1362,7 +1362,7 @@ function photos_content(App $a) if (!empty($link_item['id']) && !empty($link_item['uri'])) { $cmnt_tpl = Renderer::getMarkupTemplate('comment_item.tpl'); $tpl = Renderer::getMarkupTemplate('photo_item.tpl'); - $return_path = $a->cmd; + $return_path = DI::args()->getCommand(); if ($cmd === 'view' && ($can_post || Security::canWriteToUserWall($owner_uid))) { $like_tpl = Renderer::getMarkupTemplate('like_noshare.tpl'); diff --git a/mod/pubsub.php b/mod/pubsub.php index c008fb09da..4c1c2759d8 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -86,7 +86,7 @@ function pubsub_post(App $a) { $xml = Network::postdata(); - Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']); + Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']); Logger::log('Data: ' . $xml, Logger::DATA); $nick = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : ''); diff --git a/mod/suggest.php b/mod/suggest.php index daf5de00fc..15370d25a9 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -41,7 +41,7 @@ function suggest_content(App $a) return; } - $_SESSION['return_path'] = $a->cmd; + $_SESSION['return_path'] = DI::args()->getCommand(); $a->page['aside'] .= Widget::findPeople(); $a->page['aside'] .= Widget::follow(); diff --git a/mod/videos.php b/mod/videos.php index 6d136d7de5..b6f6b1d8e7 100644 --- a/mod/videos.php +++ b/mod/videos.php @@ -124,7 +124,7 @@ function videos_content(App $a) //$phototypes = Photo::supportedTypes(); - $_SESSION['video_return'] = $a->cmd; + $_SESSION['video_return'] = DI::args()->getCommand(); // // Parse arguments diff --git a/src/App.php b/src/App.php index c028f9d9d8..892039dc5a 100644 --- a/src/App.php +++ b/src/App.php @@ -53,8 +53,6 @@ class App public $page_contact; public $content; public $data = []; - /** @deprecated 2019.09 - use App\Arguments->getCommand() */ - public $cmd = ''; /** @deprecated 2019.09 - use App\Arguments->getArgv() or Arguments->get() */ public $argv; /** @deprecated 2019.09 - use App\Arguments->getArgc() */ @@ -170,7 +168,6 @@ class App $this->args = $args; $this->process = $process; - $this->cmd = $args->getCommand(); $this->argv = $args->getArgv(); $this->argc = $args->getArgc(); $this->module = $module->getName(); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 69ec447951..a08cdade12 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -1047,7 +1047,7 @@ class Profile $addr = $_GET['addr'] ?? $my_url; - $arr = ['zrl' => $my_url, 'url' => $a->cmd]; + $arr = ['zrl' => $my_url, 'url' => DI::args()->getCommand()]; Hook::callAll('zrl_init', $arr); // Try to find the public contact entry of the visitor. diff --git a/src/Module/Contact.php b/src/Module/Contact.php index c45a27c88a..d307652b63 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -819,7 +819,7 @@ class Contact extends BaseModule '$desc' => L10n::t('Search your contacts'), '$finding' => $searching ? L10n::t('Results for: %s', $search) : '', '$submit' => L10n::t('Find'), - '$cmd' => $a->cmd, + '$cmd' => DI::args()->getCommand(), '$contacts' => $contacts, '$contact_drop_confirm' => L10n::t('Do you really want to delete this contact?'), 'multiselect' => 1, diff --git a/src/Object/Post.php b/src/Object/Post.php index 032c7ea4d0..fd99a206de 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -453,7 +453,7 @@ class Post 'received' => $item['received'], 'commented' => $item['commented'], 'created_date' => $item['created'], - 'return' => ($a->cmd) ? bin2hex($a->cmd) : '', + 'return' => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '', 'delivery' => [ 'queue_count' => $item['delivery_queue_count'], 'queue_done' => $item['delivery_queue_done'] + $item['delivery_queue_failed'], /// @todo Possibly display it separately in the future