From c20aa6062c38d81d19d53bad3a65f78e95b126c9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 28 Mar 2017 16:02:47 -0700 Subject: get rid of get_app() --- Zotlabs/Module/Setup.php | 2 -- Zotlabs/Storage/Browser.php | 5 +++-- boot.php | 12 ------------ doc/dev-function-overview.md | 4 ---- include/message.php | 2 -- tests/unit/template_test.php | 6 ------ util/fresh | 2 -- 7 files changed, 3 insertions(+), 30 deletions(-) diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index 9c688af01..593ba643f 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -624,7 +624,6 @@ class Setup extends \Zotlabs\Web\Controller { * @param[out] array &$checks */ function check_htaccess(&$checks) { - $a = get_app(); $status = true; $help = ''; $ssl_error = false; @@ -718,7 +717,6 @@ class Setup extends \Zotlabs\Web\Controller { * @return string with parsed HTML */ function what_next() { - $a = get_app(); // install the standard theme set_config('system', 'allowed_themes', 'redbasic'); diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index 3fdc8e9d4..c501379d8 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -84,7 +84,6 @@ class Browser extends DAV\Browser\Plugin { require_once('include/conversation.php'); require_once('include/text.php'); if ($this->auth->owner_nick) { - //$html = profile_tabs(get_app(), (($is_owner) ? true : false), $this->auth->owner_nick); $html = ''; } @@ -241,7 +240,9 @@ class Browser extends DAV\Browser\Plugin { '$nick' => $this->auth->getCurrentUser() )); - $a = get_app(); + + $a = false; + \App::$page['content'] = $html; load_pdl($a); diff --git a/boot.php b/boot.php index da5d571b2..e0546d049 100755 --- a/boot.php +++ b/boot.php @@ -1259,18 +1259,6 @@ class App { } // End App class -/** - * @brief Retrieve the App structure. - * - * Useful in functions which require it but don't get it passed to them - * - * @return App - */ -function get_app() { - return $a; -} - - /** * @brief Multi-purpose function to check variable state. * diff --git a/doc/dev-function-overview.md b/doc/dev-function-overview.md index fa8a98ff3..cd2526ead 100644 --- a/doc/dev-function-overview.md +++ b/doc/dev-function-overview.md @@ -15,10 +15,6 @@ Returns authenticated numeric channel_id if authenticated and connected to a cha Returns authenticated string hash of Red global identifier, if authenticated via remote auth, or an empty string. -* get_app() - -Returns the global app structure ($a). No longer used as App is a static class - * App::get_observer() returns an xchan structure representing the current viewer if authenticated (locally or remotely). diff --git a/include/message.php b/include/message.php index bde07afd8..da3514184 100644 --- a/include/message.php +++ b/include/message.php @@ -13,10 +13,8 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep $ret = array('success' => false); $is_reply = false; - $a = get_app(); $observer_hash = get_observer_hash(); - if($uid) { $r = q("select * from channel where channel_id = %d limit 1", intval($uid) diff --git a/tests/unit/template_test.php b/tests/unit/template_test.php index 1f9f80531..dfaecb4a1 100644 --- a/tests/unit/template_test.php +++ b/tests/unit/template_test.php @@ -25,12 +25,6 @@ function x($s,$k = NULL) { } } -if(!function_exists('get_app')) { -function get_app() { - return new TemplateMockApp(); -} -} - /** * TestCase for the template engine * diff --git a/util/fresh b/util/fresh index 7f57931aa..0482d1215 100755 --- a/util/fresh +++ b/util/fresh @@ -44,8 +44,6 @@ fresh_main($argc,$argv); function process_command($line) { - $a = get_app(); - // split args App::$cmd = $line; -- cgit v1.2.3