Skip to content

Commit 44367bf

Browse files
committed
updating to latest Minicli
1 parent 129ffa0 commit 44367bf

File tree

5 files changed

+1193
-480
lines changed

5 files changed

+1193
-480
lines changed

Command/Cache/ClearController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
namespace librarianphp\Cache;
44

55
use Minicli\Command\CommandController;
6-
use Minicli\Config;
76

87
class 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
}

Command/Cache/DefaultController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
namespace librarianphp\Cache;
44

5-
use Minicli\App;
65
use Minicli\Command\CommandController;
76

87
class 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
}

Command/Cache/RefreshController.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Librarian\Provider\ContentServiceProvider;
66
use Minicli\Command\CommandController;
7-
use Minicli\Config;
87

98
class 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
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
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",

0 commit comments

Comments
 (0)