From 875fbccd6e1e3bd3db4025f6f12cf9621e770d52 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Fri, 11 Oct 2019 17:49:31 +0200 Subject: [PATCH] API Clean UP --- api.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/api.php b/api.php index 62bc277..7c411ce 100644 --- a/api.php +++ b/api.php @@ -3,9 +3,7 @@ include_once('./config.php'); //Autoloader - $files = scandir('./app/class/'); - $files = array_diff($files, array( '.', '..', @@ -25,7 +23,6 @@ foreach($files as $file) { include './app/class/'. $file; } - //Allow acces only wia Curl, Ajax ETC $restAcess = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' ); if (!$restAcess){ @@ -154,12 +151,9 @@ if ($values != null || $values != "") { RecordManager::create($deviceId, $key, round($value['value'],2)); $logManager->write("[API] Device_ID " . $deviceId . " writed value " . $key . ' ' . $value['value'], LogRecordType::INFO); - //notification if ($key == 'door' || $key == 'water') { - $notificationMng = new NotificationManager; - $notificationData = []; switch ($key) { @@ -203,7 +197,6 @@ if ($values != null || $values != "") { $jsonAnswer['sleepTime'] = $device['sleep_time']; } echo json_encode($jsonAnswer); - header("HTTP/1.1 200 OK"); } else { //Vypis