Skip to content

Commit 045ee05

Browse files
authored
Merge pull request #4 from Mamuph/2.2
2.2
2 parents dd5e447 + 4d9fc87 commit 045ee05

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

Core/Apprunner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class Core_Apprunner
1717

1818

1919
// Mamuph core version
20-
const VERSION = '2.0';
20+
const VERSION = '2.2';
2121

2222

2323
// Environment constants as bitmask

Core/Hook.php

+41-41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
// It is required for unix signaling
2+
// It is required for IPC signaling
33
if (function_exists('pcntl_async_signals')) {
44
pcntl_async_signals(true);
55
} else {
@@ -15,7 +15,7 @@
1515
* @package Mamuph Hooks
1616
* @category Hook
1717
* @author Mamuph Team
18-
* @copyright (c) 2015-2017 Mamuph Team
18+
* @copyright (c) 2015-2018 Mamuph Team
1919
*/
2020
abstract class Core_Hook
2121
{
@@ -34,41 +34,41 @@ abstract class Core_Hook
3434
* @var array Hook list
3535
*/
3636
protected $hooks = [
37-
'UNIX_SIGHUP' => [],
38-
'UNIX_SIGINT' => [],
39-
'UNIX_SIGQUIT' => [],
40-
'UNIX_SIGILL' => [],
41-
'UNIX_SIGTRAP' => [],
42-
'UNIX_SIGABRT' => [],
43-
//'UNIX_SIGIOT' => [],
44-
'UNIX_SIGBUS' => [],
45-
'UNIX_SIGFPE' => [],
46-
//'UNIX_SIGKILL' => [],
47-
'UNIX_SIGUSR1' => [],
48-
'UNIX_SIGSEGV' => [],
49-
'UNIX_SIGUSR2' => [],
50-
'UNIX_SIGPIPE' => [],
51-
'UNIX_SIGALRM' => [],
52-
'UNIX_SIGTERM' => [],
53-
'UNIX_SIGSTKFLT' => [],
54-
'UNIX_SIGCLD' => [],
55-
'UNIX_SIGCHLD' => [],
56-
'UNIX_SIGCONT' => [],
57-
//'UNIX_SIGSTOP' => [],
58-
'UNIX_SIGTSTP' => [],
59-
'UNIX_SIGTTIN' => [],
60-
'UNIX_SIGTTOU' => [],
61-
'UNIX_SIGURG' => [],
62-
'UNIX_SIGXCPU' => [],
63-
'UNIX_SIGXFSZ' => [],
64-
'UNIX_SIGVTALRM' => [],
65-
'UNIX_SIGPROF' => [],
66-
'UNIX_SIGWINCH' => [],
67-
'UNIX_SIGPOLL' => [],
68-
'UNIX_SIGIO' => [],
69-
'UNIX_SIGPWR' => [],
70-
'UNIX_SIGSYS' => [],
71-
'UNIX_SIGBABY' => [],
37+
'IPC_SIGHUP' => [],
38+
'IPC_SIGINT' => [],
39+
'IPC_SIGQUIT' => [],
40+
'IPC_SIGILL' => [],
41+
'IPC_SIGTRAP' => [],
42+
'IPC_SIGABRT' => [],
43+
//'IPC_SIGIOT' => [],
44+
'IPC_SIGBUS' => [],
45+
'IPC_SIGFPE' => [],
46+
//'IPC_SIGKILL' => [],
47+
'IPC_SIGUSR1' => [],
48+
'IPC_SIGSEGV' => [],
49+
'IPC_SIGUSR2' => [],
50+
'IPC_SIGPIPE' => [],
51+
'IPC_SIGALRM' => [],
52+
'IPC_SIGTERM' => [],
53+
'IPC_SIGSTKFLT' => [],
54+
'IPC_SIGCLD' => [],
55+
'IPC_SIGCHLD' => [],
56+
'IPC_SIGCONT' => [],
57+
//'IPC_SIGSTOP' => [],
58+
'IPC_SIGTSTP' => [],
59+
'IPC_SIGTTIN' => [],
60+
'IPC_SIGTTOU' => [],
61+
'IPC_SIGURG' => [],
62+
'IPC_SIGXCPU' => [],
63+
'IPC_SIGXFSZ' => [],
64+
'IPC_SIGVTALRM' => [],
65+
'IPC_SIGPROF' => [],
66+
'IPC_SIGWINCH' => [],
67+
'IPC_SIGPOLL' => [],
68+
'IPC_SIGIO' => [],
69+
'IPC_SIGPWR' => [],
70+
'IPC_SIGSYS' => [],
71+
'IPC_SIGBABY' => [],
7272

7373
'MAMUPH_INITIALIZED' => [],
7474
'MAMUPH_TERMINATED' => []
@@ -91,9 +91,9 @@ public function __construct(bool $attach_signals = true)
9191
foreach (array_keys($this->hooks) as $hookname)
9292
{
9393

94-
if (strpos($hookname, 'UNIX_') !== false)
94+
if (strpos($hookname, 'IPC_') !== false)
9595
{
96-
$signal = str_replace('UNIX_', '', $hookname);
96+
$signal = str_replace('IPC_', '', $hookname);
9797

9898
if (defined($signal))
9999
pcntl_signal(constant($signal), [$this, '_notifySignal']);
@@ -143,9 +143,9 @@ public function _notifySignal(int $signal) : void
143143
foreach (array_keys($this->hooks) as $hookname)
144144
{
145145

146-
if (strpos($hookname, 'UNIX_') !== false)
146+
if (strpos($hookname, 'IPC_') !== false)
147147
{
148-
$signal_cons = str_replace('UNIX_', '', $hookname);
148+
$signal_cons = str_replace('IPC_', '', $hookname);
149149

150150
if (defined($signal_cons) && constant($signal_cons) === $signal)
151151
{

0 commit comments

Comments
 (0)