update libraries and run php-cs-fixer.

This commit is contained in:
2024-01-30 18:35:21 +09:00
parent b2617cd48c
commit 0e188c0380
8 changed files with 440 additions and 628 deletions

View File

@ -6,8 +6,8 @@ require_once APPDIR.'/vendor/autoload.php';
$config = json_decode(file_get_contents(APPDIR.'/etc/config.json'), true);
$digitemp = new \Orrisroot\DigiTemp($config['digitemp'], APPDIR.'/'.$config['digitemp_config']);
$rrdtemp = new \Orrisroot\Rrd\Temperature(APPDIR.'/'.$config['database_dir']);
$digitemp = new Orrisroot\DigiTemp($config['digitemp'], APPDIR.'/'.$config['digitemp_config']);
$rrdtemp = new Orrisroot\Rrd\Temperature(APPDIR.'/'.$config['database_dir']);
$num = $digitemp->getNumSensors();
$sensors = [];
for ($i = 0; $i < $num; ++$i) {
@ -20,8 +20,8 @@ $from = $config['mail_from'];
$from_name = $config['mail_from_name'];
$to = $config['mail_info_to'];
$subject = $config['mail_info_subject'];
$loader = new \Twig\Loader\FilesystemLoader(APPDIR.'/'.$config['templates_dir']);
$twig = new \Twig\Environment($loader);
$loader = new Twig\Loader\FilesystemLoader(APPDIR.'/'.$config['templates_dir']);
$twig = new Twig\Environment($loader);
$data = [
'from' => [
'name' => $from_name,
@ -32,6 +32,6 @@ $data = [
];
$body = $twig->render($config['mail_info_template'], $data);
$from = new \Orrisroot\Mail\Address($from_name, $from);
$tos = [new \Orrisroot\Mail\Address($to, $to)];
\Orrisroot\Mail\UTF8_Mailer::sendMail($from, $tos, $subject, $body);
$from = new Orrisroot\Mail\Address($from_name, $from);
$tos = [new Orrisroot\Mail\Address($to, $to)];
Orrisroot\Mail\UTF8_Mailer::sendMail($from, $tos, $subject, $body);