-
Notifications
You must be signed in to change notification settings - Fork 1
/
fire.php
executable file
·51 lines (41 loc) · 1.52 KB
/
fire.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/php
<?php
/*
use CLI to cache config files for speed and update rules, etc.
*/
if (php_sapi_name() !== 'cli') {
exit;
}
require "cliautoload.php";
require "./cli/Cli/clihelpers.php";
use Cli\Commands\CacheCompares;
use Cli\Cli;
$cli = new Cli();
//$cli->registerCommand('cache:data', function (array $argv) use ($cli) {
// (new CacheCompares)->go();
//});
//$cli->registerCommand('cache:clear', function (array $argv) use ($cli) {
// $cached = (new CacheCompares)->clear();
// $cli->getPrinter()->display($cached);
//});
//$cli->registerCommand('cache:check', function (array $argv) use ($cli) {
// $checked = (new CacheCompares)->check();
// if ($checked) {
// $cli->getPrinter()->display("Files are cached.");
// } else {
// $cli->getPrinter()->display("Files are not cached.");
// }
//});
$cli->registerCommand('help', function (array $argv) use ($cli) {
$menu = "+--------------+-------------------------------------------+
| usage: ./fireline.php [options] |
+--------------+-------------------------------------------+
| cache:data | Will cache your .txt definition files. |
+--------------+-------------------------------------------+
| cache:check | Will check if your files are cached. |
+--------------+-------------------------------------------+
| cache:clear | Will delete the cached files. |
+--------------+-------------------------------------------+";
$cli->getPrinter()->display( $menu );
});
$cli->runCommand($argv);