debug presence
This commit is contained in:
16
moha.php
16
moha.php
@ -35,7 +35,7 @@ $included = false; // flag indicate scripts are loaded
|
||||
$nSubscribed = 0; // Number of topics subsribed
|
||||
$logFh = null; // filehandle of log file
|
||||
$curlErr = 0; // Number of errors returned by curl
|
||||
$configDir = "./config"; // default config dir (production value is /etc/moha/)
|
||||
//$configDir = "./config"; // default config dir (production value is /etc/moha/)
|
||||
$hooksInitialized = 0; // are all hooks initialized ? false/true
|
||||
$flagHooks = false;
|
||||
$devicesRequest = false; // set to true when publishing device request to zigbee2mqtt
|
||||
@ -59,11 +59,12 @@ if ($testMode)
|
||||
$httpServerIp = "127.0.0.1";
|
||||
}
|
||||
|
||||
require "/etc/moha/liste_telephones.php";
|
||||
|
||||
|
||||
if (!init()) exit(1);
|
||||
|
||||
// (re)démarre le démon de présence
|
||||
system("systemctl restart presenceD");
|
||||
system("sudo /usr/bin/systemctl restart presenceD.service");
|
||||
|
||||
// gettext
|
||||
bindtextdomain("moha", "./locale");
|
||||
@ -122,10 +123,6 @@ function init()
|
||||
echo _("error opening log file in ") . getcwd();
|
||||
return false;
|
||||
}
|
||||
foreach($macAddresses as $key => $value)
|
||||
{
|
||||
$presence[$key] = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -224,6 +221,9 @@ require "config/liste_telephones.php";
|
||||
require "presence.php";
|
||||
require "apiserver/apiserver.php";
|
||||
require "configWatch.php";
|
||||
require $configDir . "/liste_telephones.php";
|
||||
|
||||
|
||||
|
||||
logger(DEBUG, _("Loading stored events datas from ") . $dataPath . "events.db", __FILE__ . ":" . __LINE__);
|
||||
if (file_exists($dataPath . "events.db"))
|
||||
@ -390,9 +390,9 @@ while (true)
|
||||
{
|
||||
foreach ($input as $event)
|
||||
{
|
||||
logger(DEBUG, _("configWatch : inclus ") . $configDir . "/" . $event["name"], __FILE__ . ":" . __LINE__);
|
||||
if (pathinfo($event["name"], PATHINFO_EXTENSION) == "php")
|
||||
{
|
||||
logger(DEBUG, _("configWatch : inclus ") . $configDir . "/" . $event["name"], __FILE__ . ":" . __LINE__);
|
||||
include $configDir . "/" . $event["name"];
|
||||
}else
|
||||
{
|
||||
|
Reference in New Issue
Block a user