get rid of get_app()

This commit is contained in:
zotlabs 2017-03-28 16:02:47 -07:00 committed by Mario Vavti
parent b2a51db14e
commit c20aa6062c
7 changed files with 3 additions and 30 deletions

View file

@ -624,7 +624,6 @@ class Setup extends \Zotlabs\Web\Controller {
* @param[out] array &$checks * @param[out] array &$checks
*/ */
function check_htaccess(&$checks) { function check_htaccess(&$checks) {
$a = get_app();
$status = true; $status = true;
$help = ''; $help = '';
$ssl_error = false; $ssl_error = false;
@ -718,7 +717,6 @@ class Setup extends \Zotlabs\Web\Controller {
* @return string with parsed HTML * @return string with parsed HTML
*/ */
function what_next() { function what_next() {
$a = get_app();
// install the standard theme // install the standard theme
set_config('system', 'allowed_themes', 'redbasic'); set_config('system', 'allowed_themes', 'redbasic');

View file

@ -84,7 +84,6 @@ class Browser extends DAV\Browser\Plugin {
require_once('include/conversation.php'); require_once('include/conversation.php');
require_once('include/text.php'); require_once('include/text.php');
if ($this->auth->owner_nick) { if ($this->auth->owner_nick) {
//$html = profile_tabs(get_app(), (($is_owner) ? true : false), $this->auth->owner_nick);
$html = ''; $html = '';
} }
@ -241,7 +240,9 @@ class Browser extends DAV\Browser\Plugin {
'$nick' => $this->auth->getCurrentUser() '$nick' => $this->auth->getCurrentUser()
)); ));
$a = get_app();
$a = false;
\App::$page['content'] = $html; \App::$page['content'] = $html;
load_pdl($a); load_pdl($a);

View file

@ -1259,18 +1259,6 @@ class App {
} // End App class } // 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. * @brief Multi-purpose function to check variable state.
* *

View file

@ -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. 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() * App::get_observer()
returns an xchan structure representing the current viewer if authenticated (locally or remotely). returns an xchan structure representing the current viewer if authenticated (locally or remotely).

View file

@ -13,10 +13,8 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
$ret = array('success' => false); $ret = array('success' => false);
$is_reply = false; $is_reply = false;
$a = get_app();
$observer_hash = get_observer_hash(); $observer_hash = get_observer_hash();
if($uid) { if($uid) {
$r = q("select * from channel where channel_id = %d limit 1", $r = q("select * from channel where channel_id = %d limit 1",
intval($uid) intval($uid)

View file

@ -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 * TestCase for the template engine
* *

View file

@ -44,8 +44,6 @@ fresh_main($argc,$argv);
function process_command($line) { function process_command($line) {
$a = get_app();
// split args // split args
App::$cmd = $line; App::$cmd = $line;