diff options
Diffstat (limited to 'public_html')
| -rw-r--r-- | public_html/class/mysql.php | 28 | ||||
| -rw-r--r-- | public_html/index.php | 3 | ||||
| -rw-r--r-- | public_html/vfs_config.php | 28 |
3 files changed, 59 insertions, 0 deletions
diff --git a/public_html/class/mysql.php b/public_html/class/mysql.php new file mode 100644 index 0000000..b2d2983 --- /dev/null +++ b/public_html/class/mysql.php @@ -0,0 +1,28 @@ +<?php + +class database { + + public $db; + private $dbhost; + private $dbuser; + private $dbpassword; + private $dbname; + private $dbprefix; + + public function __construct($dbhost, $dbuser, $dbname, $dbpassword, $dbprefix){ + $this->dbhost=$dbhost; + $this->dbuser=$dbuser; + $this->dbname=$dbname; + $this->dbpassword=$dbpassword; + $this->dbprefix=$dbprefix; + } + + public function open(){ + try { + $this->db = new mysqli($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname); + } catch (Exception $e){ + echo $e->getMessage(); + exit; + } + } +} diff --git a/public_html/index.php b/public_html/index.php new file mode 100644 index 0000000..5d705b8 --- /dev/null +++ b/public_html/index.php @@ -0,0 +1,3 @@ +<?php + +require('./vfs_config.php'); diff --git a/public_html/vfs_config.php b/public_html/vfs_config.php new file mode 100644 index 0000000..141345c --- /dev/null +++ b/public_html/vfs_config.php @@ -0,0 +1,28 @@ +<?php + +# mysql access +define('DBHOST', 'localhost'); +define('DBUSER', 'vfs-user'); +define('DBNAME', 'vfs'); +define('DBPASSWORD', 'secretpassword'); +define('DBPREFIX', 'vfs_'); + +# absolute path +define('ABSPATH', dirname(__FILE__)); + +# file directory +define('FILEPATH', ABSPATH . '/../files'); + +# scheme, set to http if set, otherwise plain http +if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') + define('SCHEME', 'https://'); +else + define('SCHEME', 'http://'); + +# hostname +define('HOST', $_SERVER['HTTP_HOST']); +define('DOMAIN', SCHEME . HOST); + +# redis access +define('REDIS_DBNAME', 1); +define('REDIS_CONNECT', '/var/run/redis/redis.sock'); |
