Skip to content

Commit

Permalink
expand setting to constructor arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Bushulyak committed Aug 19, 2016
1 parent caca994 commit 28cb820
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PhpRbac/src/PhpRbac/Rbac.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 28cb820

Please sign in to comment.