Skip to content

Commit b3e7e52

Browse files
committed
🐛 default 60 sec for cache did not work (v2)
Signed-off-by: bnomei <[email protected]>
1 parent 1209aca commit b3e7e52

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

classes/Blueprints/Blueprint.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ public function toArray(): array
8080

8181
// some might not be cacheable like when they are class based and have dynamic fields
8282
// only set here now if they will not be written on __destruct by trait
83-
if ($this->cache && ! method_exists($this->modelClass, 'blueprintCacheKey')) {
83+
// the cacha could be null which means it will use the default value
84+
if (! in_array($this->cache, [false, 0]) && ! method_exists($this->modelClass, 'blueprintCacheKey')) {
8485
BlueprintCache::set($key, $blueprint);
8586
}
8687

classes/Blueprints/BlueprintCache.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ public static function cacheDir(): ?string
3737
$file = self::cacheDirMemoryFile();
3838
if (F::exists($file)) {
3939
$dir = F::read($file);
40+
4041
return $dir !== false ? $dir : null;
4142
}
43+
4244
return null;
4345
}
4446

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby-blueprints",
33
"type": "kirby-plugin",
4-
"version": "4.4.7",
4+
"version": "4.4.8",
55
"license": "MIT",
66
"homepage": "https://github.com/bnomei/kirby3-blueprints",
77
"description": "PHP Class-based Blueprints for Kirby CMS for better type safety and code completion",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
const KIRBY_HELPER_DUMP = false;
44
require_once __DIR__.'/../vendor/autoload.php';
5-
echo (new Kirby())->render();
5+
echo (new Kirby)->render();

tests/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
$micotime = microtime(true);
99
//\Bnomei\Blueprints\BlueprintCache::preloadFromLoadMap();
10-
$kirby = new Kirby();
10+
$kirby = new Kirby;
1111
$render = $kirby->render();
1212
$micotime = microtime(true) - $micotime;
1313
header('X-Render-Time: '.number_format($micotime, 3, '.', '').'s');

vendor/composer/installed.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'bnomei/kirby-blueprints',
4-
'pretty_version' => '4.4.7',
5-
'version' => '4.4.7.0',
4+
'pretty_version' => '4.4.8',
5+
'version' => '4.4.8.0',
66
'reference' => null,
77
'type' => 'kirby-plugin',
88
'install_path' => __DIR__ . '/../../',
@@ -11,8 +11,8 @@
1111
),
1212
'versions' => array(
1313
'bnomei/kirby-blueprints' => array(
14-
'pretty_version' => '4.4.7',
15-
'version' => '4.4.7.0',
14+
'pretty_version' => '4.4.8',
15+
'version' => '4.4.8.0',
1616
'reference' => null,
1717
'type' => 'kirby-plugin',
1818
'install_path' => __DIR__ . '/../../',

0 commit comments

Comments
 (0)