From 11d8a116c70cd5eb49edb8afce34a0aaac49f35e Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 18 Sep 2014 16:40:44 +0200 Subject: setup.php --- public_html/class/mysql.php | 13 +++++++------ public_html/setup.php | 12 ++++++++++++ public_html/vfs_bootstrap.php | 3 +++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 public_html/setup.php diff --git a/public_html/class/mysql.php b/public_html/class/mysql.php index 167c8a9..0031eec 100644 --- a/public_html/class/mysql.php +++ b/public_html/class/mysql.php @@ -5,7 +5,7 @@ class vfsdb { public $db; public function __construct(){ - return true; + $this->open(); } public function open(){ @@ -24,7 +24,7 @@ class vfsdb { } if ( ! $this->db->set_charset(DBCHARSET) ){ - failure("
Can't set UTF-8 as a charset on your MySQL server." , '500 Server Failure', false, "
Can't set UTF-8 as a charset on your MySQL server.
" , '500 Server Failure', false, "Setting up the database failed.
", '500 Server Failure', false, "Successfully created the database."; + +# rename this file to avoid setting up the tables twice +rename(ABSPATH . 'setup.php', ABSPATH . '_setup.php'); diff --git a/public_html/vfs_bootstrap.php b/public_html/vfs_bootstrap.php index 341b0aa..4f0e05d 100644 --- a/public_html/vfs_bootstrap.php +++ b/public_html/vfs_bootstrap.php @@ -8,3 +8,6 @@ if ( ! defined(VFS_CLASS) ) require(ABSPATH . 'functions.php'); require(ABSPATH . VFS_CLASS . 'mysql.php'); + +if ( file_exists(ABSPATH . 'setup.php') ) + require(ABSPATh . 'setup.php'); -- cgit v1.2.3