aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-07-27 23:52:00 +0200
committerCamil Staps2016-07-27 23:52:00 +0200
commit7f877370163648460f6ffd8abb3ee9caa774441c (patch)
treea41d3d8dbf310ffdbc484cf0a3992126845e9d8e
parentChangelog cleanup (diff)
Moved private information to conf.private.php
-rw-r--r--.gitignore1
-rw-r--r--README.md4
-rw-r--r--conf.php17
-rw-r--r--conf.private.example.php13
4 files changed, 18 insertions, 17 deletions
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 @@
+<?php
+// Database settings (should be mysql)
+$db_host = 'localhost';
+$db_name = 'my_database';
+$db_user = 'my_database_user';
+$db_pass = 'my_password';
+$db_port = '3306';
+
+// Braintree settings
+define('BRAINTREE_ENABLED', true);
+define('BRAINTREE_MERCHANT', ...);
+define('BRAINTREE_KEY_PUBLIC', ...);
+define('BRAINTREE_KEY_PRIVATE', ...);