1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Changed the way settings are loaded

This new method batch-loads them from the database, and removes the
cache-layer with the intention that a couple of batch fetches from the
DB is more efficient than hitting the cache each time.
This commit is contained in:
Dan Brown
2023-02-23 22:14:47 +00:00
parent 6545afacd6
commit 8bebea4cca
2 changed files with 90 additions and 61 deletions

View File

@@ -39,6 +39,8 @@ class UpdateUrlCommandTest extends TestCase
setting()->put('my-custom-item', 'https://example.com/donkey/cat');
$this->runUpdate('https://example.com', 'https://cats.example.com');
setting()->flushCache();
$settingVal = setting('my-custom-item');
$this->assertEquals('https://cats.example.com/donkey/cat', $settingVal);
}
@@ -47,6 +49,9 @@ class UpdateUrlCommandTest extends TestCase
{
setting()->put('my-custom-array-item', [['name' => 'a https://example.com/donkey/cat url']]);
$this->runUpdate('https://example.com', 'https://cats.example.com');
setting()->flushCache();
$settingVal = setting('my-custom-array-item');
$this->assertEquals('a https://cats.example.com/donkey/cat url', $settingVal[0]['name']);
}