File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515use App \Console \PurgeSuspendedUsers ;
1616use App \Middleware \ContentSecurityPolicy ;
1717use App \Middleware \NoCacheHeader ;
18+ use App \ServiceProvider \ApcuCacheProvider ;
1819use App \ServiceProvider \ErrorLogProvider ;
1920use App \ServiceProvider \SessionServiceProvider ;
2021use Flarum \Extend ;
4142 (new Extend \Console ())
4243 ->command (PurgeSuspendedUsers::class)
4344 ->schedule (PurgeSuspendedUsers::class, fn (Event $ event ) => $ event ->daily ()),
45+ (new Extend \ServiceProvider ())->register (ApcuCacheProvider::class),
4446 (new Extend \ServiceProvider ())->register (ErrorLogProvider::class),
4547 (new Extend \ServiceProvider ())->register (SessionServiceProvider::class),
4648 (new Extend \Middleware ('forum ' ))->add (ContentSecurityPolicy::class),
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \ServiceProvider ;
4+
5+ use Flarum \Foundation \AbstractServiceProvider ;
6+ use Illuminate \Cache \ApcStore ;
7+ use Illuminate \Cache \ApcWrapper ;
8+ use Illuminate \Contracts \Cache \Store ;
9+
10+ class ApcuCacheProvider extends AbstractServiceProvider
11+ {
12+ public function register (): void
13+ {
14+ $ this ->container ->singleton ('cache.filestore ' , fn (): ApcStore => new ApcStore (new ApcWrapper (), 'flarum_ ' ));
15+ $ this ->container ->alias ('cache.filestore ' , Store::class);
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments