Force local project database user/password setup

This commit is contained in:
Robbie Antenesse 2019-05-17 12:28:19 -06:00
parent 6a4d9be05a
commit 0f1a7d2f09
3 changed files with 10 additions and 2 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
node_modules/
.cache/
dist/
vendor/
vendor/
src/php/api/config.php

View File

@ -1,9 +1,11 @@
<?php
require_once('./config.php');
class Db {
private $dbh;
public $last_error_info;
function __construct() {
$this->dbh = new PDO('mysql:host=localhost;dbname=lexiconga;charset=utf8', 'root', '');
$this->dbh = new PDO('mysql:host=localhost;dbname=lexiconga;charset=utf8', DB_USER, DB_PASSWORD);
$this->dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
$this->last_error_info = null;
}

View File

@ -0,0 +1,4 @@
<?php
define('DB_USER', 'lexiconga_db_username');
define('DB_PASSWORD', 'user_password');