From 7f877370163648460f6ffd8abb3ee9caa774441c Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 27 Jul 2016 23:52:00 +0200 Subject: Moved private information to conf.private.php --- .gitignore | 1 + README.md | 4 ++-- conf.php | 17 ++--------------- conf.private.example.php | 13 +++++++++++++ 4 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 conf.private.example.php diff --git a/.gitignore b/.gitignore index 6a87795..b66f503 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ files/** docs/** +conf.private.php diff --git a/README.md b/README.md index 1a3375d..c57267f 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ BusinessAdmin assumes a MySQL database is setup properly. This can be: There are two files concerned when setting the configuration options. -In conf.php you can enter your MySQL details (host, database, username, -password, server port). +In conf.private.php you can enter your MySQL details (host, database, username, +password, server port). You can use conf.private.example.php as an example. In classes/constants.php, you should at least set the following options: diff --git a/conf.php b/conf.php index 82f79fb..837016c 100644 --- a/conf.php +++ b/conf.php @@ -31,21 +31,6 @@ session_start(); error_reporting(0); ini_set('display_errors', 0); -//------------------------------------------------------------------------------ -// Start editing below this line -//------------------------------------------------------------------------------ - -// Database settings (should be mysql) -$db_host = 'localhost'; -$db_name = 'my_database'; -$db_user = 'my_database_user'; -$db_pass = 'my_password'; -$db_port = '3306'; - -//------------------------------------------------------------------------------ -// Don't edit below this line -//------------------------------------------------------------------------------ - /** * Autoload a class if it isn't loaded yet * @@ -59,6 +44,8 @@ function __autoload($pClass) { set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__)); +require_once('./conf.private.php'); + try { $_pdo = new PDO("mysql:host=$db_host;port=$db_port;dbname=$db_name;charset=utf8", $db_user, $db_pass); $_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); diff --git a/conf.private.example.php b/conf.private.example.php new file mode 100644 index 0000000..90b4c51 --- /dev/null +++ b/conf.private.example.php @@ -0,0 +1,13 @@ +