diff --git a/PhpRbac/src/PhpRbac/Rbac.php b/PhpRbac/src/PhpRbac/Rbac.php index c39134c..b79571f 100644 --- a/PhpRbac/src/PhpRbac/Rbac.php +++ b/PhpRbac/src/PhpRbac/Rbac.php @@ -19,12 +19,12 @@ public function __construct($config = '') if ((string)$config === 'unit_test') { require_once dirname(dirname(__DIR__)) . '/tests/database/database.config'; } else { - $adapter = $config['adapter'] ?: "pdo_sqlite"; - $host = $config['host'] ?: "localhost"; - $user = $config['user'] ?: "root"; - $pass = $config['pass'] ?: ""; - $tablePrefix = $config['prefix'] ?: "phprbac_"; - $dbname = $config['db_name'] ?: false; + $adapter = isset($config['adapter']) ? $config['adapter'] : "pdo_sqlite"; + $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'] : "phprbac_"; + $dbname = isset($config['db_name']) ? $config['db_name'] : false; if(!$dbname){ throw new ConfigurationException("db_name",$config['db_name']);