Completed
Pull Request — master (#444)
by Yanick
15:24 queued 27s
created

LiteSpeedProxy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A start() 0 11 1
A stop() 0 9 1
A clear() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the FOSHttpCache package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\HttpCache\Test\Proxy;
13
14
class LiteSpeedProxy extends AbstractProxy
15
{
16
    protected $binary = '/usr/local/lsws/bin/lswsctrl';
17
18
    protected $port = 8080;
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function start()
24
    {
25
        $this->runCommand(
26
            $this->getBinary(),
27
            [
28
                'start',
29
            ]
30
        );
31
32
        $this->waitFor($this->getIp(), $this->getPort(), 2000);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function stop()
39
    {
40
        $this->runCommand(
41
            $this->getBinary(),
42
            [
43
                'stop',
44
            ]
45
        );
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function clear()
52
    {
53
        $this->stop();
54
        $this->start();
55
    }
56
}
57