forked from StormCommerce/Storm.API-client-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpose.php
More file actions
30 lines (26 loc) · 734 Bytes
/
expose.php
File metadata and controls
30 lines (26 loc) · 734 Bytes
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
<?php
use Storm\StormClient;
use Storm\Util\Str;
define('STORM_ROOT', dirname(__FILE__));
require_once "vendor/autoload.php";
if (count($argv) != 4) {
echo "Usage: php expose.php [certifcation path] [password] [redis] \n";
die();
}
$certPath = $argv[1];
if (!file_exists($certPath)) {
$certPath = Str::trailingSlashIt(getcwd()) . $certPath;
if (!file_exists($certPath)) {
echo "Cannot find certifcation \n";
die;
}
}
$certPath = realpath($certPath);
$certPassword = $argv[2];
$redis = $argv[3];
$configuration = [
'certification_path' => $certPath,
'certification_password' => $certPassword,
'redis_path' => $redis,
];
StormClient::self($configuration)->expose()->generateClasses();