-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex-1.php
31 lines (23 loc) · 838 Bytes
/
index-1.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
<?php
use Bolt\App;
use Bolt\Encryption;
require_once './vendor/autoload.php';
if (php_sapi_name() !== 'cli') {
exit;
}
$app = new App();
$app->registerCommand('-encrypt', function (array $argv) use ($app) {
if( empty($argv[2]) || empty($argv[3]) || empty($argv[4])){
$app->getPrinter()->display("usage: bolt -encrypt [source-folder] [key] [output-folder]");
return;
}
$enc = new Encryption;
$enc->encrypt($argv[2], $argv[3], $argv[4]);
});
$app->registerCommand('-help', function (array $argv) use ($app) {
$app->getPrinter()->display("usage: bolt -encrypt [source-folder] [key] [output-folder]");
});
$app->registerCommand('-h', function (array $argv) use ($app) {
$app->getPrinter()->display("usage: bolt -encrypt [source-folder] [key] [output-folder]");
});
$app->runCommand($argv);