@@ 40-57 (lines=18) @@ | ||
37 | * |
|
38 | * @result void |
|
39 | */ |
|
40 | public function __construct(IContainer $container, array $params = []) |
|
41 | { |
|
42 | $this->container = $container; |
|
43 | ||
44 | if (!empty($params['groupTable'])) { |
|
45 | $this->groupTable = $params['groupTable']; |
|
46 | } |
|
47 | ||
48 | if (!$this->container->db->tableExists('acl_user')) { |
|
49 | $this->container->db->createTable('acl_user', [ |
|
50 | '`id` int(10) unsigned NOT NULL AUTO_INCREMENT', |
|
51 | '`user` int(11) unsigned NOT NULL', |
|
52 | '`role` int(11) unsigned DEFAULT NULL', |
|
53 | '`perm` int(11) unsigned DEFAULT NULL', |
|
54 | 'PRIMARY KEY (`id`)' |
|
55 | ], 'ENGINE=MyISAM DEFAULT CHARSET=utf8'); |
|
56 | } |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * Get permissions in role |
@@ 39-58 (lines=20) @@ | ||
36 | * @result void |
|
37 | * @throws Exception |
|
38 | */ |
|
39 | public function __construct(IContainer $container, array $params = []) |
|
40 | { |
|
41 | parent::__construct($container, $params); |
|
42 | ||
43 | $this->tableName = !empty($params['table']) ? $params['table'] : 'logs'; |
|
44 | ||
45 | if (!$this->container->db->tableExists($this->tableName)) { |
|
46 | $this->container->db->createTable( |
|
47 | $this->tableName, |
|
48 | array( |
|
49 | '`id` INT AUTO_INCREMENT', |
|
50 | '`level` VARCHAR(20) NOT NULL', |
|
51 | '`message` TEXT NOT NULL', |
|
52 | '`date_create` INT NOT NULL', |
|
53 | 'PRIMARY KEY(id)' |
|
54 | ), |
|
55 | 'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci' |
|
56 | ); |
|
57 | } |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * Send log message into DB |