Completed
Push — master ( 622c37...dca855 )
by Christian
04:12
created

SelfTestAllowUrlFopenEnabled   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 24
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A doTest() 0 16 2
1
<?php
2
3
/**
4
 * This file is part of tenside/core.
5
 *
6
 * (c) Christian Schiffler <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * This project is provided in good faith and hope to be usable by anyone.
12
 *
13
 * @package    tenside/core
14
 * @author     Christian Schiffler <[email protected]>
15
 * @copyright  2015 Christian Schiffler <[email protected]>
16
 * @license    https://github.com/tenside/core/blob/master/LICENSE MIT
17
 * @link       https://github.com/tenside/core
18
 * @filesource
19
 */
20
21
namespace Tenside\Core\SelfTest\Php;
22
23
use Tenside\Core\SelfTest\AbstractSelfTest;
24
25
/**
26
 * This class is the abstract base for performing checks that the current environment is suitable for running tenside.
27
 */
28
class SelfTestAllowUrlFopenEnabled extends AbstractSelfTest
29
{
30
    /**
31
     * Check that allow url fopen is allowed as it is needed by composer.
32
     *
33
     * @return void
34
     */
35
    public function doTest()
36
    {
37
        $this->setMessage('Check if allow_url_fopen is enabled.');
38
39
        if (ini_get('allow_url_fopen')) {
40
            $this->markSuccess();
41
42
            return;
43
        }
44
45
        $this->markFailed(
46
            'The php setting allow_url_fopen must be enabled to allow downloading of data. ' .
47
            'Note that this does NOT imply any security risk as this is NOT the setting allow_url_include ' .
48
            '(which should be disabled).'
49
        );
50
    }
51
}
52