• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IlyasDeckers / ody-core / 13568209044

27 Feb 2025 02:03PM UTC coverage: 28.467% (-0.7%) from 29.138%
13568209044

push

github

IlyasDeckers
run websockets as daemon

0 of 52 new or added lines in 4 files covered. (0.0%)

544 of 1911 relevant lines covered (28.47%)

8.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Console/Commands/Websockets/StopCommand.php
1
<?php
2
declare(strict_types=1);
3

4
namespace Ody\Core\Console\Commands\Websockets;
5

6
use Ody\Core\Console\Style;
7
use Symfony\Component\Console\Attribute\AsCommand;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11

12
#[AsCommand(
NEW
13
    name: 'websocket:stop' ,
×
NEW
14
    description: 'stop websocket server')
×
NEW
15
]
×
16
class StopCommand extends Command
17
{
NEW
18
    protected function execute(InputInterface $input, OutputInterface $output): int
×
19
    {
NEW
20
        $io = new Style($input, $output);
×
21

NEW
22
        if (!websocketServerIsRunning()){
×
NEW
23
            $io->error('server is not running...' , true);
×
NEW
24
            return self::FAILURE;
×
25
        }
26

NEW
27
        if (posix_kill(getWebsocketMasterProcessId(), SIG_DFL)){
×
NEW
28
            posix_kill(getWebsocketMasterProcessId(), SIGTERM);
×
29
        }
30

NEW
31
        if (posix_kill(getWebsocketManagerProcessId(), SIG_DFL)){
×
NEW
32
            posix_kill(getWebsocketManagerProcessId(), SIGTERM);
×
33
        }
34

NEW
35
        if (posix_kill(getWatcherProcessId(), SIG_DFL)){
×
36
            /** @psalm-suppress PossiblyNullArgument */
NEW
37
            posix_kill(getWatcherProcessId(), SIGTERM);
×
38
        }
39

NEW
40
        foreach (getWebsocketWorkerProcessIds() as $processId) {
×
NEW
41
            if (posix_kill($processId, SIG_DFL)){
×
NEW
42
                posix_kill($processId, SIGTERM);
×
43
            }
44
        }
45

NEW
46
        sleep(1);
×
47

NEW
48
        $io->success('Stopped websocket server...' , true);
×
NEW
49
        return self::SUCCESS;
×
50
    }
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc