1<?php
2/*
3 Copyright (C) 2020 Denver Gingerich <denver@ossguy.com>
4
5 This file is part of sgx-bwmsgsv2.
6
7 sgx-bwmsgsv2 is free software: you can redistribute it and/or modify it under
8 the terms of the GNU Affero General Public License as published by the Free
9 Software Foundation, either version 3 of the License, or (at your option) any
10 later version.
11
12 sgx-bwmsgsv2 is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
15 details.
16
17 You should have received a copy of the GNU Affero General Public License along
18 with sgx-bwmsgsv2. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21$time = microtime(true);
22
23$raw_data = file_get_contents('php://input');
24
25include 'settings-h2r.php';
26$redis = new Redis();
27$redis->pconnect($redis_host, $redis_port);
28
29# TODO: check for return value of FALSE and then print raw_data and return !200
30
31if (!empty($redis_auth)) {
32 # TODO: check return value to confirm login succeeded
33 $redis->auth($redis_auth);
34}
35
36# TODO: MUST add ./tai versions of $time and $time2
37
38$time2 = microtime(true);
39
40$redis->lPush('incoming_messages-'.'test1a', # TODO: update queue name
41 '"ts_020-first_db_hit":'.$time2.',"ts_010-first_received":'.$time.',"MSG":'.$raw_data);
42
43# TODO: check for return value of FALSE and then print raw_data and return !200
44
45# TODO: test syntax error to ensure non-200 is returned
46
47print 'ok';
48
49?>