-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.php
executable file
·37 lines (34 loc) · 986 Bytes
/
server.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
<?php
date_default_timezone_set('Europe/Istanbul');
$isDebug = false;
include __DIR__ . "/vendor/autoload.php";
include __DIR__ . "/Helpers/ApiConnectionHelper.php";
include __DIR__ . "/Helpers/FlatFileDatabaseHelper.php";
include __DIR__ . "/config.php";
$apiConnection = new ApiConnectionHelper([
'host' => HOST,
'user' => USER,
'pass' => PASS,
'port' => PORT]);
$i = 0;
while (1) {
foreach (_INTERFACE_ as $val) {
$flatFile = new FlatFileDatabaseHelper();
$flatFile->setInterface($val);
$apiConnection->setInterface($val);
$i++;
$rxTx = $apiConnection->getRxTx();
print_r($rxTx);
$rxTx["date"] = $flatFile->createCollectionName($val);
$rxTx["time"] = date("H:m:s");
$flatFile->addNewRow($rxTx);
}
sleep(SLEEP_SECONDS);//performance test
echo "\n" . $i . "\n";
if ($isDebug) {
echo "--" . $i . "--";
if ($i > 15) {
die("die");
}
}
}