Added database support

This commit is contained in:
CHIEFSOFT\ameye
2024-04-28 06:20:38 -04:00
parent 7a654be81c
commit d7fb7b6050
4 changed files with 36 additions and 2 deletions
+21
View File
@@ -47,6 +47,27 @@ class Database extends Config
'numberNative' => false,
];
public array $digifi_db = [
'DSN' => '',
'hostname' => '10.10.10.48',
'username' => 'digifi',
'password' => 'digifi',
'database' => 'digifi_db',
'DBDriver' => 'postgre',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => true,
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 5432,
'numberNative' => false,
];
/**
* This database connection is used when
* running PHPUnit database tests.
+6 -1
View File
@@ -9,11 +9,13 @@ use Firebase\JWT\JWT;
class DigiFiBVN extends BaseController
{
use ResponseTrait;
protected $db;
public $con_name = 'digifi_db'; // 'wrench_blog';
var $request;
function __construct()
{
$this->db = \Config\Database::connect($this->con_name);
$this->request = \Config\Services::request();
}
@@ -66,6 +68,9 @@ class DigiFiBVN extends BaseController
if ($data['bvn'] != '') {
$sqL = "INSERT INTO bvn_checks(bvn) VALUES('".$data['bvn']."')";
$query = $this->db->query($sqL);
$response = [
'message' => 'Verification text sent to user',
'call_return' => '100',
+7 -1
View File
@@ -18,7 +18,13 @@ class Users extends BaseController
public function userDash(){
return $this->respond([], 200);
$data = [
'firstname' => 'Olarewaju',
'lastname' => 'Jackson',
'loan_status' => '0',
];
return $this->respond($data, 200);
}
}
+2
View File
@@ -29,6 +29,8 @@ RUN docker-php-ext-install \
pdo_pgsql \
pgsql
RUN pecl install mongodb && docker-php-ext-enable mongodb
# 2. set up document root for apache
COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf