-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlib.php
33 lines (30 loc) · 880 Bytes
/
lib.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
<?php
use Aws\CloudWatch\CloudWatchClient;
function getCloudWatchClient($conf)
{
if (isset($conf->aws->profil)) {
return CloudWatchClient::factory(array(
'profil' => $conf->aws->profil,
'region' => $conf->aws->region,
'version' => '2010-08-01'
));
}
return CloudWatchClient::factory(array(
'credentials' => array(
'key' => $conf->aws->key,
'secret' => $conf->aws->secret
),
'region' => $conf->aws->region,
'version' => '2010-08-01'
));
}
function getConfigFile()
{
$longopts = array(
"required:" // Valeur requise
);
if (array_key_exists('f', $args = getopt("f:", $longopts))) {
return json_decode(file_get_contents($args['f']));
}
return json_decode(file_get_contents(APPLICATION_PATH . '/conf/config.json'));
}