mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-21 00:46:27 +02:00
fix codestyle
This commit is contained in:
parent
350dbb5b59
commit
adef27f862
37 changed files with 556 additions and 488 deletions
|
@ -50,7 +50,7 @@ class Launcher extends AbstractDaemon
|
|||
$this->start_sender_daemon();
|
||||
|
||||
$this->start_webhook_daemon();
|
||||
|
||||
|
||||
$this->start_mailer_daemon();
|
||||
|
||||
$phones = $this->internal_phone->get_all();
|
||||
|
@ -76,8 +76,7 @@ class Launcher extends AbstractDaemon
|
|||
$pid = null;
|
||||
exec('php ' . PWD . '/console.php controllers/internals/Console.php sender > /dev/null 2>&1 &');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Function to start mailer daemon.
|
||||
*/
|
||||
|
|
|
@ -60,6 +60,7 @@ class Mailer extends AbstractDaemon
|
|||
{
|
||||
$this->logger->critical('Error for mailer queue reading, error code : ' . $error_code);
|
||||
$find_message = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -77,6 +78,7 @@ class Mailer extends AbstractDaemon
|
|||
if (!$success)
|
||||
{
|
||||
$this->logger->error('Failed sending email');
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ class Phone extends AbstractDaemon
|
|||
private function send_smss()
|
||||
{
|
||||
$internal_sended = new \controllers\internals\Sended($this->bdd);
|
||||
|
||||
|
||||
$find_message = true;
|
||||
while ($find_message)
|
||||
{
|
||||
|
@ -135,17 +135,17 @@ class Phone extends AbstractDaemon
|
|||
//Update last message time
|
||||
$this->last_message_at = microtime(true);
|
||||
|
||||
|
||||
//Do message sending
|
||||
//Do message sending
|
||||
$this->logger->info('Try send message : ' . json_encode($message));
|
||||
|
||||
|
||||
$response = $internal_sended->send($this->adapter, $this->phone['id_user'], $this->phone['id'], $message['text'], $message['destination'], $message['flash']);
|
||||
if ($response['error'])
|
||||
{
|
||||
$this->logger->error('Failed send message : ' . json_encode($message) . ' with error : ' . $response['error_message']);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$this->logger->info('Successfully send message : ' . json_encode($message));
|
||||
}
|
||||
}
|
||||
|
@ -161,12 +161,13 @@ class Phone extends AbstractDaemon
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$response = $this->adapter->read();
|
||||
|
||||
if ($response['error'])
|
||||
{
|
||||
$this->logger->info('Error reading received smss : ' . $response['error_message']);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -180,15 +181,15 @@ class Phone extends AbstractDaemon
|
|||
{
|
||||
$this->logger->info('Receive message : ' . json_encode($sms));
|
||||
$response = $internal_received->receive($this->phone['id_user'], $this->phone['id'], $sms['text'], $sms['origin']);
|
||||
|
||||
|
||||
if ($response['error'])
|
||||
{
|
||||
$this->logger->error('Failed receive message : ' . json_encode($sms) . ' with error : ' . $response['error_message']);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->logger->info('Message received successfully.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ class Webhook extends AbstractDaemon
|
|||
{
|
||||
$this->logger->critical('Error for webhook queue reading, error code : ' . $error_code);
|
||||
$find_message = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue