File tree Expand file tree Collapse file tree 5 files changed +1193
-480
lines changed
Expand file tree Collapse file tree 5 files changed +1193
-480
lines changed Original file line number Diff line number Diff line change 33namespace librarianphp \Cache ;
44
55use Minicli \Command \CommandController ;
6- use Minicli \Config ;
76
87class ClearController extends CommandController
98{
109 public function handle (): void
1110 {
12- /** @var Config $config */
1311 $ config = $ this ->getApp ()->config ;
1412 if (!$ config ->has ('cache_path ' )) {
15- $ this ->getPrinter ()-> error ("Missing cache_path configuration. " );
13+ $ this ->error ("Missing cache_path configuration. " );
1614 }
1715
1816 $ cache_path = $ config ->cache_path ;
@@ -21,6 +19,6 @@ public function handle(): void
2119 unlink ($ filename );
2220 }
2321
24- $ this ->getPrinter ()-> success ("Cache cleared. " );
22+ $ this ->success ("Cache cleared. " );
2523 }
2624}
Original file line number Diff line number Diff line change 22
33namespace librarianphp \Cache ;
44
5- use Minicli \App ;
65use Minicli \Command \CommandController ;
76
87class DefaultController extends CommandController
98{
109 public function handle (): void
1110 {
12- $ this ->getPrinter ()-> info ("./librarian cache [subcommand] " , true );
13- $ this ->getPrinter ()-> info ("Run \"./librarian cache clear \" to clear cached tags and pages. " );
14- $ this ->getPrinter ()-> info ("Run \"./librarian cache refresh \" to refresh the cache (clear and reload). " );
11+ $ this ->info ("./librarian cache [subcommand] " , true );
12+ $ this ->info ("Run \"./librarian cache clear \" to clear cached tags and pages. " );
13+ $ this ->info ("Run \"./librarian cache refresh \" to refresh the cache (clear and reload). " );
1514 }
1615}
Original file line number Diff line number Diff line change 44
55use Librarian \Provider \ContentServiceProvider ;
66use Minicli \Command \CommandController ;
7- use Minicli \Config ;
87
98class RefreshController extends CommandController
109{
@@ -13,21 +12,20 @@ public function handle(): void
1312 /** @var ContentServiceProvider $content_provider */
1413 $ content_provider = $ this ->getApp ()->content ;
1514
16- /** @var Config $config */
1715 $ config = $ this ->getApp ()->config ;
1816 if (!$ config ->has ('cache_path ' )) {
19- $ this ->getPrinter ()-> error ("Missing cache_path configuration. " );
17+ $ this ->error ("Missing cache_path configuration. " );
2018 }
2119
2220 $ cache_path = $ config ->cache_path ;
2321
24- $ this ->getPrinter ()-> info ("Clearing cache... " );
22+ $ this ->info ("Clearing cache... " );
2523 foreach (glob ($ cache_path . "/*.json " ) as $ filename ) {
2624 unlink ($ filename );
2725 }
2826
2927 $ content_provider ->fetchTagList ();
3028
31- $ this ->getPrinter ()-> success ("Cache updated. " );
29+ $ this ->success ("Cache updated. " );
3230 }
3331}
Original file line number Diff line number Diff line change 1111 }
1212 },
1313 "require" : {
14- "minicli/minicli" : " ^4.0"
14+ "minicli/minicli" : " ^4.0" ,
15+ "librarianphp/librarian-core" : " ^4.0"
1516 },
1617 "require-dev" : {
1718 "pestphp/pest" : " ^2.4" ,
You can’t perform that action at this time.
0 commit comments