Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.

Commit 83f114c

Browse files
committed
🐛 write boost index late to cache
1 parent 28c45ea commit 83f114c

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

classes/BoostIndex.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,26 @@ public function __construct()
2626
$this->isDirty = false;
2727

2828
$this->index = $this->read();
29+
30+
$cache = $this->cache();
31+
if ($cache && method_exists($cache, 'register_shutdown_function')) {
32+
$cache->register_shutdown_function(function() {
33+
$this->write();
34+
});
35+
}
36+
2937
if (option('debug') || empty($this->index)) {
3038
$this->index(true);
3139
$success = $this->write();
3240
}
3341
}
3442

43+
/** NOTE: register that with cache instead
3544
public function __destruct()
3645
{
3746
$this->write();
3847
}
48+
*/
3949

4050
private function cache()
4151
{

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby3-boost",
33
"type": "kirby-plugin",
4-
"version": "1.6.2",
4+
"version": "1.6.3",
55
"description": "Boost the speed of Kirby by having content files of pages cached, with automatic unique ID, fast lookup and Tiny-URL.",
66
"license": "MIT",
77
"authors": [

vendor/composer/installed.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php return array(
22
'root' => array(
3-
'pretty_version' => '1.6.1',
4-
'version' => '1.6.1.0',
3+
'pretty_version' => '1.6.3',
4+
'version' => '1.6.3.0',
55
'type' => 'kirby-plugin',
66
'install_path' => __DIR__ . '/../../',
77
'aliases' => array(),
@@ -20,8 +20,8 @@
2020
'dev_requirement' => false,
2121
),
2222
'bnomei/kirby3-boost' => array(
23-
'pretty_version' => '1.6.1',
24-
'version' => '1.6.1.0',
23+
'pretty_version' => '1.6.3',
24+
'version' => '1.6.3.0',
2525
'type' => 'kirby-plugin',
2626
'install_path' => __DIR__ . '/../../',
2727
'aliases' => array(),

0 commit comments

Comments
 (0)