File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change 1212 "illuminate/contracts" : " ^11.0" ,
1313 "ext-json" : " *" ,
1414 "illuminate/http" : " ^11.0" ,
15- "matomo/device-detector" : " ^6.2"
15+ "matomo/device-detector" : " ^6.2" ,
16+ "ext-apcu" : " *"
1617 },
1718 "require-dev" : {
1819 "cego/php-cs-fixer" : " 2.0.0"
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Cego \FilebeatLogging ;
4+
5+ use DeviceDetector \Cache \CacheInterface ;
6+
7+ class ApcuCache implements CacheInterface
8+ {
9+ public function fetch (string $ id )
10+ {
11+ return apcu_fetch ($ id );
12+ }
13+
14+ public function contains (string $ id ): bool
15+ {
16+ return apcu_exists ($ id );
17+ }
18+
19+ public function save (string $ id , $ data , int $ lifeTime = 0 ): bool
20+ {
21+ return apcu_store ($ id , $ data , $ lifeTime );
22+ }
23+
24+ public function delete (string $ id ): bool
25+ {
26+ return apcu_delete ($ id );
27+ }
28+
29+ public function flushAll (): bool
30+ {
31+ return apcu_clear_cache ();
32+ }
33+ }
Original file line number Diff line number Diff line change 66use Illuminate \Http \Request ;
77use DeviceDetector \ClientHints ;
88use DeviceDetector \DeviceDetector ;
9- use DeviceDetector \Cache \LaravelCache ;
109use Monolog \Processor \ProcessorInterface ;
1110
1211class RequestProcessor implements ProcessorInterface
@@ -83,7 +82,7 @@ private static function userAgentExtras(Request $request): array
8382 $ clientHints = ClientHints::factory ($ headers );
8483
8584 $ deviceDetector = new DeviceDetector ($ userAgent , $ clientHints );
86- $ deviceDetector ->setCache (new LaravelCache ());
85+ $ deviceDetector ->setCache (new ApcuCache ());
8786
8887 $ deviceDetector ->parse ();
8988
You can’t perform that action at this time.
0 commit comments