Minore Tweeks and FIxes
This commit is contained in:
parent
ceca8fc057
commit
d404afe501
@ -12,6 +12,7 @@ RewriteRule . - [e=HTTP_AUTHORIZATION:%1]
|
|||||||
# serve all files from public subfolder
|
# serve all files from public subfolder
|
||||||
RewriteCond %{REQUEST_FILENAME} !.php
|
RewriteCond %{REQUEST_FILENAME} !.php
|
||||||
RewriteCond %{REQUEST_FILENAME} !.log
|
RewriteCond %{REQUEST_FILENAME} !.log
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !.ttfnot
|
||||||
RewriteCond %{REQUEST_FILENAME} \.
|
RewriteCond %{REQUEST_FILENAME} \.
|
||||||
RewriteRule (.*) ./public/$1 [L]
|
RewriteRule (.*) ./public/$1 [L]
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ class ErrorHandler {
|
|||||||
'message' => $exception->getMessage(),
|
'message' => $exception->getMessage(),
|
||||||
'file' => $exception->getFile(),
|
'file' => $exception->getFile(),
|
||||||
'line' => $exception->getLine(),
|
'line' => $exception->getLine(),
|
||||||
|
'trace' => $exception->getTraceAsString(),
|
||||||
];
|
];
|
||||||
echo json_encode($message);
|
echo json_encode($message);
|
||||||
|
|
||||||
|
@ -186,6 +186,6 @@ class EndpointsApi extends ApiController{
|
|||||||
|
|
||||||
$this->response($jsonAnswer);
|
$this->response($jsonAnswer);
|
||||||
// this method returns response as json
|
// this method returns response as json
|
||||||
unset($logManager)
|
unset($logManager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class GoogleHomeApi{
|
|||||||
$apiLogManager->setLevel(LOGLEVEL);
|
$apiLogManager->setLevel(LOGLEVEL);
|
||||||
$apiLogManager->write("[API] request body\n" . json_encode($obj, JSON_PRETTY_PRINT), LogRecordTypes::INFO);
|
$apiLogManager->write("[API] request body\n" . json_encode($obj, JSON_PRETTY_PRINT), LogRecordTypes::INFO);
|
||||||
$apiLogManager->write("[API] GET body\n" . json_encode($_GET, JSON_PRETTY_PRINT), LogRecordTypes::INFO);
|
$apiLogManager->write("[API] GET body\n" . json_encode($_GET, JSON_PRETTY_PRINT), LogRecordTypes::INFO);
|
||||||
unset($apiLogManager)
|
unset($apiLogManager);
|
||||||
|
|
||||||
$get = [
|
$get = [
|
||||||
"access_token"=>"2222255888", //TODO: FIX
|
"access_token"=>"2222255888", //TODO: FIX
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
//TODO: Working timestamp to $title
|
//TODO: Working timestamp to $title
|
||||||
class NotificationManager
|
class NotificationManager
|
||||||
{
|
{
|
||||||
function addSubscriber($userID = '', $token = ''){
|
public static function addSubscriber($userID = '', $token = ''){
|
||||||
$notificationSubscriber = $subDeviceId = Db::loadOne('SELECT id FROM notifications WHERE token = ?;', array($token));
|
$notificationSubscriber = $subDeviceId = Db::loadOne('SELECT id FROM notifications WHERE token = ?;', array($token));
|
||||||
if ($notificationSubscriber == ''){
|
if ($notificationSubscriber == ''){
|
||||||
$notification = array (
|
$notification = array (
|
||||||
@ -16,11 +16,11 @@ class NotificationManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSubscription () {
|
public static function getSubscription () {
|
||||||
return Db::loadAll ("SELECT * FROM notifications");
|
return Db::loadAll ("SELECT * FROM notifications");
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendSimpleNotification(string $serverKey, string $to, array $data, bool $timeStamp = false){
|
public static function sendSimpleNotification(string $serverKey, string $to, array $data, bool $timeStamp = false){
|
||||||
$dataTemplate = [
|
$dataTemplate = [
|
||||||
'title' => '',
|
'title' => '',
|
||||||
'body' => '',
|
'body' => '',
|
||||||
|
@ -19,7 +19,7 @@ define('LOGTIMOUT', 5); //Deleate logfiles older than XX days
|
|||||||
LogRecordTypes::WARNING
|
LogRecordTypes::WARNING
|
||||||
LogRecordTypes::INFO
|
LogRecordTypes::INFO
|
||||||
*/
|
*/
|
||||||
define('LOGLEVEL', LogRecordTypes::WARNING);
|
define('LOGLEVEL', LogRecordTypes::INFO);
|
||||||
|
|
||||||
//Restrict acess to API
|
//Restrict acess to API
|
||||||
$allowerdIp = [
|
$allowerdIp = [
|
||||||
|
Loading…
Reference in New Issue
Block a user