From 28cb820485798fd09dade9ea8d5e27d35a1c2aac Mon Sep 17 00:00:00 2001 From: Denys Bushulyak Date: Fri, 19 Aug 2016 14:20:05 +0300 Subject: [PATCH] expand setting to constructor arguments --- PhpRbac/src/PhpRbac/Rbac.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PhpRbac/src/PhpRbac/Rbac.php b/PhpRbac/src/PhpRbac/Rbac.php index ab18d73..259cd0b 100644 --- a/PhpRbac/src/PhpRbac/Rbac.php +++ b/PhpRbac/src/PhpRbac/Rbac.php @@ -14,16 +14,16 @@ */ class Rbac { - public function __construct($config = '') + public function __construct($_host, $db_name = null, $_user = null, $_password = null, $table_prefix = '') { - if ((string)$config === 'unit_test') { + if ((string)$_host === 'unit_test') { require_once dirname(dirname(__DIR__)) . '/tests/database/database.config'; } else { - $host = isset($config['host']) ? $config['host'] : "localhost"; - $user = isset($config['user']) ? $config['user'] : "root"; - $pass = isset($config['pass']) ? $config['pass'] : ""; - $tablePrefix = isset($config['prefix']) ? $config['prefix'] : "rbac_"; - $dbname = isset($config['db_name']) ? $config['db_name'] : 'rbac'; + $host = $_host; + $user = $_user; + $pass = $_password; + $tablePrefix = $tablePrefix; + $dbname = $db_name; } require_once 'core/lib/Jf.php';