Skip to content

Commit 02c5888

Browse files
committed
2 parents 2b41c3f + e36da7f commit 02c5888

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ before_install:
1717
install:
1818
- travis_retry composer install --prefer-dist --dev --no-suggest --no-interaction
1919

20+
before_script:
21+
- export XDEBUG_MODE=coverage
22+
2023
script:
2124
- vendor/bin/phpunit --version
2225
- mkdir -p build/logs

src/adapter/DatabaseAdapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function savePolicyLine($ptype, array $rule)
4747
foreach ($rule as $key => $value) {
4848
$col['v'.strval($key).''] = $value;
4949
}
50-
$this->model->create($col);
50+
$this->model->cache('tauthz')->save($col);
5151
}
5252

5353
/**
@@ -57,7 +57,7 @@ public function savePolicyLine($ptype, array $rule)
5757
*/
5858
public function loadPolicy(Model $model): void
5959
{
60-
$rows = $this->model->select()->toArray();
60+
$rows = $this->model->cache('tauthz')->select()->toArray();
6161
foreach ($rows as $row) {
6262
$line = implode(', ', array_filter(array_slice($row, 1), function ($val) {
6363
return '' != $val && !is_null($val);
@@ -117,7 +117,7 @@ public function removePolicy(string $sec, string $ptype, array $rule): void
117117
}
118118

119119
foreach ($instance->select() as $model) {
120-
if ($model->delete()) {
120+
if ($model->cache('tauthz')->delete()) {
121121
++$count;
122122
}
123123
}
@@ -146,7 +146,7 @@ public function removeFilteredPolicy(string $sec, string $ptype, int $fieldIndex
146146
}
147147

148148
foreach ($instance->select() as $model) {
149-
if ($model->delete()) {
149+
if ($model->cache('tauthz')->delete()) {
150150
++$count;
151151
}
152152
}

0 commit comments

Comments
 (0)