Fixed log (.log at the end) + fetch management to do

This commit is contained in:
xdrm-brackets 2017-01-27 21:00:06 +01:00
parent aa4d378e80
commit 70fd711003
4 changed files with 28 additions and 1 deletions

3
lib/api/deploy Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
php $(realpath $(dirname $0))/source/deploy.php;

3
lib/api/fetch Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
php $(realpath $(dirname $0))/source/fetch.php;

21
lib/api/source/fetch.php Executable file
View File

@ -0,0 +1,21 @@
<?php
require_once __DIR__.'/../../include/const';
function api_fetch(){
/* [1] Fetch & generate useful data from features
=========================================================*/
/* (1) Default data : access */
$data = [
'access' => file_get_contents(LOG_DIR.'/access.log')
];
}
echo api_fetch();
?>

View File

@ -23,7 +23,7 @@
=========================================================*/
function slog($message="unknown error...", $feature="default", $flag="daemon"){
file_put_contents(LOG_DIR."/$flag", time()." [$feature] $message\n", FILE_APPEND);
file_put_contents(LOG_DIR."/$flag.log", time()." [$feature] $message\n", FILE_APPEND);
}