Added database support
This commit is contained in:
@@ -47,6 +47,27 @@ class Database extends Config
|
|||||||
'numberNative' => false,
|
'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
|
* This database connection is used when
|
||||||
* running PHPUnit database tests.
|
* running PHPUnit database tests.
|
||||||
|
|||||||
@@ -9,11 +9,13 @@ use Firebase\JWT\JWT;
|
|||||||
class DigiFiBVN extends BaseController
|
class DigiFiBVN extends BaseController
|
||||||
{
|
{
|
||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
|
protected $db;
|
||||||
|
public $con_name = 'digifi_db'; // 'wrench_blog';
|
||||||
var $request;
|
var $request;
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
$this->db = \Config\Database::connect($this->con_name);
|
||||||
$this->request = \Config\Services::request();
|
$this->request = \Config\Services::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +68,9 @@ class DigiFiBVN extends BaseController
|
|||||||
|
|
||||||
if ($data['bvn'] != '') {
|
if ($data['bvn'] != '') {
|
||||||
|
|
||||||
|
$sqL = "INSERT INTO bvn_checks(bvn) VALUES('".$data['bvn']."')";
|
||||||
|
$query = $this->db->query($sqL);
|
||||||
|
|
||||||
$response = [
|
$response = [
|
||||||
'message' => 'Verification text sent to user',
|
'message' => 'Verification text sent to user',
|
||||||
'call_return' => '100',
|
'call_return' => '100',
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ class Users extends BaseController
|
|||||||
|
|
||||||
public function userDash(){
|
public function userDash(){
|
||||||
|
|
||||||
return $this->respond([], 200);
|
$data = [
|
||||||
|
'firstname' => 'Olarewaju',
|
||||||
|
'lastname' => 'Jackson',
|
||||||
|
'loan_status' => '0',
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this->respond($data, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,8 @@ RUN docker-php-ext-install \
|
|||||||
pdo_pgsql \
|
pdo_pgsql \
|
||||||
pgsql
|
pgsql
|
||||||
|
|
||||||
|
RUN pecl install mongodb && docker-php-ext-enable mongodb
|
||||||
|
|
||||||
# 2. set up document root for apache
|
# 2. set up document root for apache
|
||||||
COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user