Skip to content

Commit a58a54f

Browse files
committed
Merge branch 'release/0.6.36'
2 parents ae72707 + 0285488 commit a58a54f

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 6,
5-
"patch": 35,
5+
"patch": 36,
66
"build": 0
77
}

src/Mvc/Cache/Storage/FileCacheStorage.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace Neuron\Mvc\Cache\Storage;
33

4+
use Neuron\Log\Log;
45
use Neuron\Mvc\Cache\Exceptions\CacheException;
56

67
class FileCacheStorage implements ICacheStorage
@@ -29,6 +30,7 @@ public function read( string $Key ): ?string
2930
{
3031
if( $this->isExpired( $Key ) )
3132
{
33+
Log::debug( "Cache entry expired for key: $Key" );
3234
$this->delete( $Key );
3335
return null;
3436
}

src/Mvc/Cache/ViewCache.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace Neuron\Mvc\Cache;
33

4+
use Neuron\Log\Log;
45
use Neuron\Mvc\Cache\Exceptions\CacheException;
56
use Neuron\Mvc\Cache\Storage\ICacheStorage;
67

@@ -40,7 +41,17 @@ public function get( string $Key ): ?string
4041
return null;
4142
}
4243

43-
return $this->_Storage->read( $Key );
44+
$Data = $this->_Storage->read( $Key );
45+
46+
if( !$Data )
47+
{
48+
Log::debug( "Cache miss for key: $Key" );
49+
return null;
50+
}
51+
52+
Log::debug( "Cache hit for key: $Key" );
53+
54+
return $Data;
4455
}
4556

4657
/**
@@ -205,4 +216,4 @@ private function shouldRunGc(): bool
205216
// Roll the dice
206217
return mt_rand( 1, $Divisor ) <= ( $Probability * $Divisor );
207218
}
208-
}
219+
}

versionlog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.36 2025-08-05
2+
3+
* Added cache debug logging.
4+
15
## 0.6.35 2025-08-04
26

37
* Added garbage collection for view file cache.

0 commit comments

Comments
 (0)