-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbootstrap.php
41 lines (33 loc) · 1 KB
/
bootstrap.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
<?php
/**
* @author JKetelaar
*/
require_once('../vendor/autoload.php');
define('DATA_DIR', (($dir = drush_server_home()) === null ? __DIR__ : $dir) . '/.fut-bot/data/');
$creds = [
'username' => '[email protected]',
'password' => 'my_password',
'secret' => 'my_secret_answer',
'key' => 'key_generator_function_name',
'platform' => 'ps4',
];
$api = new \JKetelaar\fut\api\API(
$creds[ 'username' ], $creds[ 'password' ], $creds[ 'secret' ], $creds[ 'key' ], $creds[ 'platform' ]
);
function key_generator_function_name() {
$totp = new \OTPHP\TOTP('FIFA', 'KXVY7VWMX2IMLDIM');
return $totp->now();
}
/**
* @return null|string
*/
function drush_server_home() {
$home = getenv('HOME');
if( !empty($home)) {
$home = rtrim($home, '/');
} elseif( !empty($_SERVER[ 'HOMEDRIVE' ]) && !empty($_SERVER[ 'HOMEPATH' ])) {
$home = $_SERVER[ 'HOMEDRIVE' ] . $_SERVER[ 'HOMEPATH' ];
$home = rtrim($home, '\\/');
}
return empty($home) ? null : $home;
}