aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-24 17:54:45 -0700
committerredmatrix <git@macgirvin.com>2016-05-24 17:54:45 -0700
commit516c43ba154dc43ec0ef6135fb0a9732d0185a6f (patch)
tree9e8fcfbd22f6ad8013fd48ec60090be7ccf73d11 /Zotlabs
parent84ba6393ad32406a9875044aef2d031c7d0d7a46 (diff)
downloadvolse-hubzilla-516c43ba154dc43ec0ef6135fb0a9732d0185a6f.tar.gz
volse-hubzilla-516c43ba154dc43ec0ef6135fb0a9732d0185a6f.tar.bz2
volse-hubzilla-516c43ba154dc43ec0ef6135fb0a9732d0185a6f.zip
more work associated with DBA and index.php shuffle
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Setup.php41
-rw-r--r--Zotlabs/Web/WebServer.php15
2 files changed, 14 insertions, 42 deletions
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php
index b913190b1..447f46ed6 100644
--- a/Zotlabs/Module/Setup.php
+++ b/Zotlabs/Module/Setup.php
@@ -12,7 +12,6 @@ namespace Zotlabs\Module;
/**
* @brief Initialisation for the setup module.
*
- * @param[in,out] App &$a
*/
class Setup extends \Zotlabs\Web\Controller {
@@ -54,16 +53,15 @@ class Setup extends \Zotlabs\Web\Controller {
/**
* @brief Handle the actions of the different setup steps.
*
- * @param[in,out] App &$a
*/
- function post() {
- global $db;
+
+ function post() {
switch($this->install_wizard_pass) {
case 1:
case 2:
return;
- break; // just in case return don't return :)
+ // implied break;
case 3:
$urlpath = \App::get_path();
$dbhost = trim($_POST['dbhost']);
@@ -88,33 +86,9 @@ class Setup extends \Zotlabs\Web\Controller {
if(! \DBA::$dba->connected) {
echo 'Database Connect failed: ' . DBA::$dba->error;
killme();
- \App::$data['db_conn_failed']=true;
}
- /*if(get_db_errno()) {
- unset($db);
- $db = dba_factory($dbhost, $dbport, $dbuser, $dbpass, '', true);
-
- if(! get_db_errno()) {
- $r = q("CREATE DATABASE '%s'",
- dbesc($dbdata)
- );
- if($r) {
- unset($db);
- $db = new dba($dbhost, $dbport, $dbuser, $dbpass, $dbdata, true);
- } else {
- \App::$data['db_create_failed']=true;
- }
- } else {
- \App::$data['db_conn_failed']=true;
- return;
- }
- }*/
- //if(get_db_errno()) {
-
- //}
-
return;
- break;
+ // implied break;
case 4:
$urlpath = \App::get_path();
$dbhost = notags(trim($_POST['dbhost']));
@@ -177,6 +151,8 @@ class Setup extends \Zotlabs\Web\Controller {
\App::$data['db_installed'] = true;
return;
+ // implied break;
+ default:
break;
}
}
@@ -193,11 +169,10 @@ class Setup extends \Zotlabs\Web\Controller {
*
* Depending on the state we are currently in it returns different content.
*
- * @param App &$a
* @return string parsed HTML output
*/
- function get() {
- global $db;
+
+ function get() {
$o = '';
$wizard_status = '';
diff --git a/Zotlabs/Web/WebServer.php b/Zotlabs/Web/WebServer.php
index 98bf62c9a..5237bf667 100644
--- a/Zotlabs/Web/WebServer.php
+++ b/Zotlabs/Web/WebServer.php
@@ -1,19 +1,16 @@
<?php /** @file */
+namespace Zotlabs\Web;
+
class WebServer {
public function run() {
- global $db;
/*
* Bootstrap the application, load configuration, load modules, load theme, etc.
*/
- /*
- * bootstrap the application
- */
-
require_once('boot.php');
if(file_exists('.htsite.php'))
@@ -54,8 +51,8 @@ class WebServer {
require_once('include/dba/dba_driver.php');
if(! \App::$install) {
- $db = DBA::dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, \App::$install);
- if(! $db->connected) {
+ \DBA::dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, \App::$install);
+ if(! \DBA::$dba->connected) {
system_unavailable();
}
@@ -69,7 +66,7 @@ class WebServer {
load_config('system');
load_config('feature');
- \App::$session = new Zotlabs\Web\Session();
+ \App::$session = new Session();
\App::$session->init();
load_hooks();
call_hooks('init_1');
@@ -150,7 +147,7 @@ class WebServer {
nav_set_selected('nothing');
- $Router = new Zotlabs\Web\Router($a);
+ $Router = new Router($a);
/* initialise content region */