Completed
Push — master ( 550846...8c8483 )
by Anton
09:53
created

AbstractServerCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getProcessId() 0 6 1
1
<?php
2
/**
3
 * @namespace
4
 */
5
6
namespace Bluzman\Command\Server;
7
8
use Bluzman\Command\AbstractCommand;
9
10
/**
11
 * AbstractServerCommand
12
 *
13
 * @package  Bluzman\Command\Server
14
 * @author   dark
15
 */
16
abstract class AbstractServerCommand extends AbstractCommand
17
{
18
    /**
19
     * @param string $host
20
     * @param integer $port
21
     * @return string
22
     */
23
    protected function getProcessId($host, $port)
24
    {
25
        return trim(
26
            shell_exec("ps aux | grep 'php -S $host:$port' | grep -v grep | grep -v BLUZ_ENV | awk '{print $2}'")
27
        );
28
    }
29
}
30