mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
check for posix module in nottifications extension
This commit is contained in:
parent
7058769c96
commit
f31b97c4c7
3 changed files with 8 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ class Sender
|
|||
function __construct(array $prefs, bool $useCli = false)
|
||||
{
|
||||
$this->prefs = $prefs;
|
||||
if ($useCli && function_exists('pcntl_fork')) {
|
||||
if ($useCli && function_exists('pcntl_fork') && function_exists('posix_setsid')) {
|
||||
$this->cli = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ class Sender
|
|||
$host = parse_url(get_unsafe_mttinfo('url'), PHP_URL_HOST);
|
||||
$host = preg_replace('/^(www\.)/', '', $host);
|
||||
//$host = gethostname();
|
||||
if (function_exists('posix_getuid') && false !== ($userinfo = posix_getpwuid(posix_getuid())) ) {
|
||||
if (function_exists('posix_getpwuid') && false !== ($userinfo = posix_getpwuid(posix_getuid())) ) {
|
||||
return $userinfo['name']. '@'. $host;
|
||||
}
|
||||
return "mytinytodo@$host";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/*
|
||||
This file is a part of myTinyTodo.
|
||||
(C) Copyright 2022 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
(C) Copyright 2022-2023 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
||||
*/
|
||||
|
||||
|
|
@ -16,6 +16,10 @@ if (!function_exists('pcntl_fork')) {
|
|||
error_log("Required PHP module is not found: pcntl");
|
||||
exit(-2);
|
||||
}
|
||||
if (!function_exists('posix_setsid')) {
|
||||
error_log("Required PHP module is not found: posix");
|
||||
exit(-2);
|
||||
}
|
||||
$dontStartSession = 1;
|
||||
require(__DIR__.'/../../init.php');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"bundleId": "notifications",
|
||||
"name": "Notifications",
|
||||
"version": "1.1",
|
||||
"version": "1.2",
|
||||
"description": "Notify about new tasks and lists on e-mail or telegram"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue