Completed
Branch master (9dcfc4)
by Daniel
24:32
created
src/Checks/DatabaseCheck.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -13,38 +13,38 @@
 block discarded – undo
13 13
  */
14 14
 class DatabaseCheck implements EnvironmentCheck
15 15
 {
16
-    /**
17
-     * @var string
18
-     */
19
-    protected $checkTable;
20
-
21
-    /**
22
-     * By default, Member will be checked.
23
-     *
24
-     * @param string $checkTable
25
-     */
26
-    public function __construct($checkTable = 'Member')
27
-    {
28
-        $this->checkTable = $checkTable;
29
-    }
30
-
31
-    /**
32
-     * {@inheritDoc}
33
-     *
34
-     * @return array
35
-     */
36
-    public function check()
37
-    {
38
-        if (!DB::get_schema()->hasTable($this->checkTable)) {
39
-            return [EnvironmentCheck::ERROR, "$this->checkTable not present in the database"];
40
-        }
41
-
42
-        $count = DB::query("SELECT COUNT(*) FROM \"$this->checkTable\"")->value();
43
-
44
-        if ($count > 0) {
45
-            return [EnvironmentCheck::OK, ''];
46
-        }
47
-
48
-        return [EnvironmentCheck::WARNING, "$this->checkTable queried ok but has no records"];
49
-    }
16
+	/**
17
+	 * @var string
18
+	 */
19
+	protected $checkTable;
20
+
21
+	/**
22
+	 * By default, Member will be checked.
23
+	 *
24
+	 * @param string $checkTable
25
+	 */
26
+	public function __construct($checkTable = 'Member')
27
+	{
28
+		$this->checkTable = $checkTable;
29
+	}
30
+
31
+	/**
32
+	 * {@inheritDoc}
33
+	 *
34
+	 * @return array
35
+	 */
36
+	public function check()
37
+	{
38
+		if (!DB::get_schema()->hasTable($this->checkTable)) {
39
+			return [EnvironmentCheck::ERROR, "$this->checkTable not present in the database"];
40
+		}
41
+
42
+		$count = DB::query("SELECT COUNT(*) FROM \"$this->checkTable\"")->value();
43
+
44
+		if ($count > 0) {
45
+			return [EnvironmentCheck::OK, ''];
46
+		}
47
+
48
+		return [EnvironmentCheck::WARNING, "$this->checkTable queried ok but has no records"];
49
+	}
50 50
 }
Please login to merge, or discard this patch.
src/Checks/HasFunctionCheck.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -11,29 +11,29 @@
 block discarded – undo
11 11
  */
12 12
 class HasFunctionCheck implements EnvironmentCheck
13 13
 {
14
-    /**
15
-     * @var string
16
-     */
17
-    protected $functionName;
14
+	/**
15
+	 * @var string
16
+	 */
17
+	protected $functionName;
18 18
 
19
-    /**
20
-     * @param string $functionName The name of the function to look for.
21
-     */
22
-    public function __construct($functionName)
23
-    {
24
-        $this->functionName = $functionName;
25
-    }
19
+	/**
20
+	 * @param string $functionName The name of the function to look for.
21
+	 */
22
+	public function __construct($functionName)
23
+	{
24
+		$this->functionName = $functionName;
25
+	}
26 26
 
27
-    /**
28
-     * {@inheritDoc}
29
-     *
30
-     * @return array
31
-     */
32
-    public function check()
33
-    {
34
-        if (function_exists($this->functionName)) {
35
-            return [EnvironmentCheck::OK, $this->functionName . '() exists'];
36
-        }
37
-        return [EnvironmentCheck::ERROR, $this->functionName . '() doesn\'t exist'];
38
-    }
27
+	/**
28
+	 * {@inheritDoc}
29
+	 *
30
+	 * @return array
31
+	 */
32
+	public function check()
33
+	{
34
+		if (function_exists($this->functionName)) {
35
+			return [EnvironmentCheck::OK, $this->functionName . '() exists'];
36
+		}
37
+		return [EnvironmentCheck::ERROR, $this->functionName . '() doesn\'t exist'];
38
+	}
39 39
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
     public function check()
33 33
     {
34 34
         if (function_exists($this->functionName)) {
35
-            return [EnvironmentCheck::OK, $this->functionName . '() exists'];
35
+            return [EnvironmentCheck::OK, $this->functionName.'() exists'];
36 36
         }
37
-        return [EnvironmentCheck::ERROR, $this->functionName . '() doesn\'t exist'];
37
+        return [EnvironmentCheck::ERROR, $this->functionName.'() doesn\'t exist'];
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
src/Checks/URLCheck.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -14,50 +14,50 @@
 block discarded – undo
14 14
  */
15 15
 class URLCheck implements EnvironmentCheck
16 16
 {
17
-    /**
18
-     * @var string
19
-     */
20
-    protected $url;
17
+	/**
18
+	 * @var string
19
+	 */
20
+	protected $url;
21 21
 
22
-    /**
23
-     * @var string
24
-     */
25
-    protected $testString;
22
+	/**
23
+	 * @var string
24
+	 */
25
+	protected $testString;
26 26
 
27
-    /**
28
-     * @param string $url The URL to check, relative to the site (homepage is '').
29
-     * @param string $testString An optional piece of text to search for on the homepage.
30
-     */
31
-    public function __construct($url = '', $testString = '')
32
-    {
33
-        $this->url = $url;
34
-        $this->testString = $testString;
35
-    }
27
+	/**
28
+	 * @param string $url The URL to check, relative to the site (homepage is '').
29
+	 * @param string $testString An optional piece of text to search for on the homepage.
30
+	 */
31
+	public function __construct($url = '', $testString = '')
32
+	{
33
+		$this->url = $url;
34
+		$this->testString = $testString;
35
+	}
36 36
 
37
-    /**
38
-     * {@inheritDoc}
39
-     *
40
-     * @return array
41
-     * @throws HTTPResponse_Exception
42
-     */
43
-    public function check()
44
-    {
45
-        $response = Director::test($this->url);
37
+	/**
38
+	 * {@inheritDoc}
39
+	 *
40
+	 * @return array
41
+	 * @throws HTTPResponse_Exception
42
+	 */
43
+	public function check()
44
+	{
45
+		$response = Director::test($this->url);
46 46
 
47
-        if ($response->getStatusCode() != 200) {
48
-            return [
49
-                EnvironmentCheck::ERROR,
50
-                sprintf('Error retrieving "%s" (Code: %d)', $this->url, $response->getStatusCode())
51
-            ];
52
-        } elseif ($this->testString && (strpos($response->getBody(), $this->testString) === false)) {
53
-            return [
54
-                EnvironmentCheck::WARNING,
55
-                sprintf('Success retrieving "%s", but string "%s" not found', $this->url, $this->testString)
56
-            ];
57
-        }
58
-        return [
59
-            EnvironmentCheck::OK,
60
-            sprintf('Success retrieving "%s"', $this->url)
61
-        ];
62
-    }
47
+		if ($response->getStatusCode() != 200) {
48
+			return [
49
+				EnvironmentCheck::ERROR,
50
+				sprintf('Error retrieving "%s" (Code: %d)', $this->url, $response->getStatusCode())
51
+			];
52
+		} elseif ($this->testString && (strpos($response->getBody(), $this->testString) === false)) {
53
+			return [
54
+				EnvironmentCheck::WARNING,
55
+				sprintf('Success retrieving "%s", but string "%s" not found', $this->url, $this->testString)
56
+			];
57
+		}
58
+		return [
59
+			EnvironmentCheck::OK,
60
+			sprintf('Success retrieving "%s"', $this->url)
61
+		];
62
+	}
63 63
 }
Please login to merge, or discard this patch.
src/Checks/ExternalURLCheck.php 1 patch
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -16,118 +16,118 @@
 block discarded – undo
16 16
  */
17 17
 class ExternalURLCheck implements EnvironmentCheck
18 18
 {
19
-    /**
20
-     * @var array
21
-     */
22
-    protected $urls = [];
19
+	/**
20
+	 * @var array
21
+	 */
22
+	protected $urls = [];
23 23
 
24
-    /**
25
-     * @var Int Timeout in seconds.
26
-     */
27
-    protected $timeout;
24
+	/**
25
+	 * @var Int Timeout in seconds.
26
+	 */
27
+	protected $timeout;
28 28
 
29
-    /**
30
-     * @param string $urls Space-separated list of absolute URLs.
31
-     * @param int $timeout
32
-     */
33
-    public function __construct($urls, $timeout = 15)
34
-    {
35
-        if ($urls) {
36
-            $this->urls = explode(' ', $urls);
37
-        }
38
-        $this->timeout = $timeout;
39
-    }
29
+	/**
30
+	 * @param string $urls Space-separated list of absolute URLs.
31
+	 * @param int $timeout
32
+	 */
33
+	public function __construct($urls, $timeout = 15)
34
+	{
35
+		if ($urls) {
36
+			$this->urls = explode(' ', $urls);
37
+		}
38
+		$this->timeout = $timeout;
39
+	}
40 40
 
41
-    /**
42
-     * {@inheritDoc}
43
-     *
44
-     * @return array
45
-     */
46
-    public function check()
47
-    {
48
-        $urls = $this->getURLs();
41
+	/**
42
+	 * {@inheritDoc}
43
+	 *
44
+	 * @return array
45
+	 */
46
+	public function check()
47
+	{
48
+		$urls = $this->getURLs();
49 49
 
50
-        $chs = [];
51
-        foreach ($urls as $url) {
52
-            $ch = curl_init();
53
-            $chs[] = $ch;
54
-            curl_setopt_array($ch, $this->getCurlOpts($url));
55
-        }
56
-        // Parallel execution for faster performance
57
-        $mh = curl_multi_init();
58
-        foreach ($chs as $ch) {
59
-            curl_multi_add_handle($mh, $ch);
60
-        }
50
+		$chs = [];
51
+		foreach ($urls as $url) {
52
+			$ch = curl_init();
53
+			$chs[] = $ch;
54
+			curl_setopt_array($ch, $this->getCurlOpts($url));
55
+		}
56
+		// Parallel execution for faster performance
57
+		$mh = curl_multi_init();
58
+		foreach ($chs as $ch) {
59
+			curl_multi_add_handle($mh, $ch);
60
+		}
61 61
 
62
-        $active = null;
63
-        // Execute the handles
64
-        do {
65
-            $mrc = curl_multi_exec($mh, $active);
66
-            curl_multi_select($mh);
67
-        } while ($active > 0);
62
+		$active = null;
63
+		// Execute the handles
64
+		do {
65
+			$mrc = curl_multi_exec($mh, $active);
66
+			curl_multi_select($mh);
67
+		} while ($active > 0);
68 68
 
69
-        while ($active && $mrc == CURLM_OK) {
70
-            if (curl_multi_select($mh) != -1) {
71
-                do {
72
-                    $mrc = curl_multi_exec($mh, $active);
73
-                } while ($mrc == CURLM_CALL_MULTI_PERFORM);
74
-            }
75
-        }
69
+		while ($active && $mrc == CURLM_OK) {
70
+			if (curl_multi_select($mh) != -1) {
71
+				do {
72
+					$mrc = curl_multi_exec($mh, $active);
73
+				} while ($mrc == CURLM_CALL_MULTI_PERFORM);
74
+			}
75
+		}
76 76
 
77
-        $hasError = false;
78
-        $msgs = [];
79
-        foreach ($chs as $ch) {
80
-            $url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
81
-            $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
82
-            if (curl_errno($ch) || $code >= 400) {
83
-                $hasError = true;
84
-                $msgs[] = sprintf(
85
-                    'Error retrieving "%s": %s (Code: %s)',
86
-                    $url,
87
-                    curl_error($ch),
88
-                    $code
89
-                );
90
-            } else {
91
-                $msgs[] = sprintf(
92
-                    'Success retrieving "%s" (Code: %s)',
93
-                    $url,
94
-                    $code
95
-                );
96
-            }
97
-        }
77
+		$hasError = false;
78
+		$msgs = [];
79
+		foreach ($chs as $ch) {
80
+			$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
81
+			$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
82
+			if (curl_errno($ch) || $code >= 400) {
83
+				$hasError = true;
84
+				$msgs[] = sprintf(
85
+					'Error retrieving "%s": %s (Code: %s)',
86
+					$url,
87
+					curl_error($ch),
88
+					$code
89
+				);
90
+			} else {
91
+				$msgs[] = sprintf(
92
+					'Success retrieving "%s" (Code: %s)',
93
+					$url,
94
+					$code
95
+				);
96
+			}
97
+		}
98 98
 
99
-        // Close the handles
100
-        foreach ($chs as $ch) {
101
-            curl_multi_remove_handle($mh, $ch);
102
-        }
103
-        curl_multi_close($mh);
99
+		// Close the handles
100
+		foreach ($chs as $ch) {
101
+			curl_multi_remove_handle($mh, $ch);
102
+		}
103
+		curl_multi_close($mh);
104 104
 
105
-        if ($hasError) {
106
-            return [EnvironmentCheck::ERROR, implode(', ', $msgs)];
107
-        }
105
+		if ($hasError) {
106
+			return [EnvironmentCheck::ERROR, implode(', ', $msgs)];
107
+		}
108 108
 
109
-        return [EnvironmentCheck::OK, implode(', ', $msgs)];
110
-    }
109
+		return [EnvironmentCheck::OK, implode(', ', $msgs)];
110
+	}
111 111
 
112
-    /**
113
-     * @return array
114
-     */
115
-    protected function getCurlOpts($url)
116
-    {
117
-        return [
118
-            CURLOPT_URL => $url,
119
-            CURLOPT_HEADER => 0,
120
-            CURLOPT_RETURNTRANSFER => 1,
121
-            CURLOPT_FAILONERROR => 1,
122
-            CURLOPT_TIMEOUT => $this->timeout,
123
-        ];
124
-    }
112
+	/**
113
+	 * @return array
114
+	 */
115
+	protected function getCurlOpts($url)
116
+	{
117
+		return [
118
+			CURLOPT_URL => $url,
119
+			CURLOPT_HEADER => 0,
120
+			CURLOPT_RETURNTRANSFER => 1,
121
+			CURLOPT_FAILONERROR => 1,
122
+			CURLOPT_TIMEOUT => $this->timeout,
123
+		];
124
+	}
125 125
 
126
-    /**
127
-     * @return array
128
-     */
129
-    protected function getURLs()
130
-    {
131
-        return $this->urls;
132
-    }
126
+	/**
127
+	 * @return array
128
+	 */
129
+	protected function getURLs()
130
+	{
131
+		return $this->urls;
132
+	}
133 133
 }
Please login to merge, or discard this patch.
src/Checks/HasClassCheck.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -11,29 +11,29 @@
 block discarded – undo
11 11
  */
12 12
 class HasClassCheck implements EnvironmentCheck
13 13
 {
14
-    /**
15
-     * @var string
16
-     */
17
-    protected $className;
14
+	/**
15
+	 * @var string
16
+	 */
17
+	protected $className;
18 18
 
19
-    /**
20
-     * @param string $className The name of the class to look for.
21
-     */
22
-    public function __construct($className)
23
-    {
24
-        $this->className = $className;
25
-    }
19
+	/**
20
+	 * @param string $className The name of the class to look for.
21
+	 */
22
+	public function __construct($className)
23
+	{
24
+		$this->className = $className;
25
+	}
26 26
 
27
-    /**
28
-     * {@inheritDoc}
29
-     *
30
-     * @return array
31
-     */
32
-    public function check()
33
-    {
34
-        if (class_exists($this->className)) {
35
-            return [EnvironmentCheck::OK, 'Class ' . $this->className.' exists'];
36
-        }
37
-        return [EnvironmentCheck::ERROR, 'Class ' . $this->className.' doesn\'t exist'];
38
-    }
27
+	/**
28
+	 * {@inheritDoc}
29
+	 *
30
+	 * @return array
31
+	 */
32
+	public function check()
33
+	{
34
+		if (class_exists($this->className)) {
35
+			return [EnvironmentCheck::OK, 'Class ' . $this->className.' exists'];
36
+		}
37
+		return [EnvironmentCheck::ERROR, 'Class ' . $this->className.' doesn\'t exist'];
38
+	}
39 39
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
     public function check()
33 33
     {
34 34
         if (class_exists($this->className)) {
35
-            return [EnvironmentCheck::OK, 'Class ' . $this->className.' exists'];
35
+            return [EnvironmentCheck::OK, 'Class '.$this->className.' exists'];
36 36
         }
37
-        return [EnvironmentCheck::ERROR, 'Class ' . $this->className.' doesn\'t exist'];
37
+        return [EnvironmentCheck::ERROR, 'Class '.$this->className.' doesn\'t exist'];
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
src/Checks/FileWriteableCheck.php 2 patches
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -11,77 +11,77 @@
 block discarded – undo
11 11
  */
12 12
 class FileWriteableCheck implements EnvironmentCheck
13 13
 {
14
-    /**
15
-     * @var string
16
-     */
17
-    protected $path;
14
+	/**
15
+	 * @var string
16
+	 */
17
+	protected $path;
18 18
 
19
-    /**
20
-     * @param string $path The full path. If a relative path, it will relative to the BASE_PATH.
21
-     */
22
-    public function __construct($path)
23
-    {
24
-        $this->path = $path;
25
-    }
19
+	/**
20
+	 * @param string $path The full path. If a relative path, it will relative to the BASE_PATH.
21
+	 */
22
+	public function __construct($path)
23
+	{
24
+		$this->path = $path;
25
+	}
26 26
 
27
-    /**
28
-     * {@inheritDoc}
29
-     *
30
-     * @return array
31
-     */
32
-    public function check()
33
-    {
34
-        if ($this->path[0] == '/') {
35
-            $filename = $this->path;
36
-        } else {
37
-            $filename = BASE_PATH . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $this->path);
38
-        }
27
+	/**
28
+	 * {@inheritDoc}
29
+	 *
30
+	 * @return array
31
+	 */
32
+	public function check()
33
+	{
34
+		if ($this->path[0] == '/') {
35
+			$filename = $this->path;
36
+		} else {
37
+			$filename = BASE_PATH . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $this->path);
38
+		}
39 39
 
40
-        if (file_exists($filename)) {
41
-            $isWriteable = is_writeable($filename);
42
-        } else {
43
-            $isWriteable = is_writeable(dirname($filename));
44
-        }
40
+		if (file_exists($filename)) {
41
+			$isWriteable = is_writeable($filename);
42
+		} else {
43
+			$isWriteable = is_writeable(dirname($filename));
44
+		}
45 45
 
46
-        if (!$isWriteable) {
47
-            if (function_exists('posix_getgroups')) {
48
-                $userID = posix_geteuid();
49
-                $user = posix_getpwuid($userID);
46
+		if (!$isWriteable) {
47
+			if (function_exists('posix_getgroups')) {
48
+				$userID = posix_geteuid();
49
+				$user = posix_getpwuid($userID);
50 50
 
51
-                $currentOwnerID = fileowner(file_exists($filename) ? $filename : dirname($filename));
52
-                $currentOwner = posix_getpwuid($currentOwnerID);
51
+				$currentOwnerID = fileowner(file_exists($filename) ? $filename : dirname($filename));
52
+				$currentOwner = posix_getpwuid($currentOwnerID);
53 53
 
54
-                $message = "User '$user[name]' needs to be able to write to this file:\n$filename\n\nThe file is "
55
-                    . "currently owned by '$currentOwner[name]'.  ";
54
+				$message = "User '$user[name]' needs to be able to write to this file:\n$filename\n\nThe file is "
55
+					. "currently owned by '$currentOwner[name]'.  ";
56 56
 
57
-                if ($user['name'] == $currentOwner['name']) {
58
-                    $message .= 'We recommend that you make the file writeable.';
59
-                } else {
60
-                    $groups = posix_getgroups();
61
-                    $groupList = [];
62
-                    foreach ($groups as $group) {
63
-                        $groupInfo = posix_getgrgid($group);
64
-                        if (in_array($currentOwner['name'], $groupInfo['members'])) {
65
-                            $groupList[] = $groupInfo['name'];
66
-                        }
67
-                    }
68
-                    if ($groupList) {
69
-                        $message .= "	We recommend that you make the file group-writeable and change the group to "
70
-                            . "one of these groups:\n - " . implode("\n - ", $groupList)
71
-                            . "\n\nFor example:\nchmod g+w $filename\nchgrp " . $groupList[0] . " $filename";
72
-                    } else {
73
-                        $message .= "  There is no user-group that contains both the web-server user and the owner "
74
-                            . "of this file.  Change the ownership of the file, create a new group, or temporarily "
75
-                            . "make the file writeable by everyone during the install process.";
76
-                    }
77
-                }
78
-            } else {
79
-                $message = "The webserver user needs to be able to write to this file:\n$filename";
80
-            }
57
+				if ($user['name'] == $currentOwner['name']) {
58
+					$message .= 'We recommend that you make the file writeable.';
59
+				} else {
60
+					$groups = posix_getgroups();
61
+					$groupList = [];
62
+					foreach ($groups as $group) {
63
+						$groupInfo = posix_getgrgid($group);
64
+						if (in_array($currentOwner['name'], $groupInfo['members'])) {
65
+							$groupList[] = $groupInfo['name'];
66
+						}
67
+					}
68
+					if ($groupList) {
69
+						$message .= "	We recommend that you make the file group-writeable and change the group to "
70
+							. "one of these groups:\n - " . implode("\n - ", $groupList)
71
+							. "\n\nFor example:\nchmod g+w $filename\nchgrp " . $groupList[0] . " $filename";
72
+					} else {
73
+						$message .= "  There is no user-group that contains both the web-server user and the owner "
74
+							. "of this file.  Change the ownership of the file, create a new group, or temporarily "
75
+							. "make the file writeable by everyone during the install process.";
76
+					}
77
+				}
78
+			} else {
79
+				$message = "The webserver user needs to be able to write to this file:\n$filename";
80
+			}
81 81
 
82
-            return [EnvironmentCheck::ERROR, $message];
83
-        }
82
+			return [EnvironmentCheck::ERROR, $message];
83
+		}
84 84
 
85
-        return [EnvironmentCheck::OK, ''];
86
-    }
85
+		return [EnvironmentCheck::OK, ''];
86
+	}
87 87
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         if ($this->path[0] == '/') {
35 35
             $filename = $this->path;
36 36
         } else {
37
-            $filename = BASE_PATH . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $this->path);
37
+            $filename = BASE_PATH.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $this->path);
38 38
         }
39 39
 
40 40
         if (file_exists($filename)) {
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
                     }
68 68
                     if ($groupList) {
69 69
                         $message .= "	We recommend that you make the file group-writeable and change the group to "
70
-                            . "one of these groups:\n - " . implode("\n - ", $groupList)
71
-                            . "\n\nFor example:\nchmod g+w $filename\nchgrp " . $groupList[0] . " $filename";
70
+                            . "one of these groups:\n - ".implode("\n - ", $groupList)
71
+                            . "\n\nFor example:\nchmod g+w $filename\nchgrp ".$groupList[0]." $filename";
72 72
                     } else {
73 73
                         $message .= "  There is no user-group that contains both the web-server user and the owner "
74 74
                             . "of this file.  Change the ownership of the file, create a new group, or temporarily "
Please login to merge, or discard this patch.
tests/Controllers/DevHealthControllerTest.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -16,27 +16,27 @@
 block discarded – undo
16 16
  */
17 17
 class DevHealthControllerTest extends SapphireTest
18 18
 {
19
-    /**
20
-     * {@inheritDoc}
21
-     * @var array
22
-     */
23
-    protected $usesDatabase = true;
19
+	/**
20
+	 * {@inheritDoc}
21
+	 * @var array
22
+	 */
23
+	protected $usesDatabase = true;
24 24
 
25
-    public function testIndexCreatesChecker()
26
-    {
27
-        $controller = new DevHealthController();
25
+	public function testIndexCreatesChecker()
26
+	{
27
+		$controller = new DevHealthController();
28 28
 
29
-        $request = new HTTPRequest('GET', 'example.com');
29
+		$request = new HTTPRequest('GET', 'example.com');
30 30
 
31
-        // we need to fake authenticated access as BasicAuth::requireLogin doesn't like empty
32
-        // permission type strings, which is what health check uses.
31
+		// we need to fake authenticated access as BasicAuth::requireLogin doesn't like empty
32
+		// permission type strings, which is what health check uses.
33 33
 
34
-        putenv('ENVCHECK_BASICAUTH_USERNAME="foo"');
35
-        putenv('ENVCHECK_BASICAUTH_PASSWORD="bar"');
34
+		putenv('ENVCHECK_BASICAUTH_USERNAME="foo"');
35
+		putenv('ENVCHECK_BASICAUTH_PASSWORD="bar"');
36 36
 
37
-        $_SERVER['PHP_AUTH_USER'] = 'foo';
38
-        $_SERVER['PHP_AUTH_PW'] = 'bar';
37
+		$_SERVER['PHP_AUTH_USER'] = 'foo';
38
+		$_SERVER['PHP_AUTH_PW'] = 'bar';
39 39
 
40
-        $this->assertInstanceOf(EnvironmentChecker::class, $controller->index($request));
41
-    }
40
+		$this->assertInstanceOf(EnvironmentChecker::class, $controller->index($request));
41
+	}
42 42
 }
Please login to merge, or discard this patch.
tests/Controllers/DevCheckControllerTest.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,18 +16,18 @@
 block discarded – undo
16 16
  */
17 17
 class DevCheckControllerTest extends SapphireTest
18 18
 {
19
-    /**
20
-     * {@inheritDoc}
21
-     * @var array
22
-     */
23
-    protected $usesDatabase = true;
19
+	/**
20
+	 * {@inheritDoc}
21
+	 * @var array
22
+	 */
23
+	protected $usesDatabase = true;
24 24
 
25
-    public function testIndexCreatesChecker()
26
-    {
27
-        $controller = new DevCheckController();
25
+	public function testIndexCreatesChecker()
26
+	{
27
+		$controller = new DevCheckController();
28 28
 
29
-        $request = new HTTPRequest('GET', 'example.com');
29
+		$request = new HTTPRequest('GET', 'example.com');
30 30
 
31
-        $this->assertInstanceOf(EnvironmentChecker::class, $controller->index($request));
32
-    }
31
+		$this->assertInstanceOf(EnvironmentChecker::class, $controller->index($request));
32
+	}
33 33
 }
Please login to merge, or discard this patch.
tests/EnvironmentCheckerTest.php 1 patch
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -19,119 +19,119 @@
 block discarded – undo
19 19
  */
20 20
 class EnvironmentCheckerTest extends SapphireTest
21 21
 {
22
-    /**
23
-     * {@inheritDoc}
24
-     * @var bool
25
-     */
26
-    protected $usesDatabase = true;
27
-
28
-    /**
29
-     * {@inheritDoc}
30
-     */
31
-    public static function setUpBeforeClass()
32
-    {
33
-        parent::setUpBeforeClass();
34
-
35
-        Phockito::include_hamcrest();
36
-
37
-        $logger = Injector::inst()->get(LoggerInterface::class);
38
-        if ($logger instanceof \Monolog\Logger) {
39
-            // It logs to stderr by default - disable
40
-            $logger->pushHandler(new \Monolog\Handler\NullHandler);
41
-        }
42
-    }
43
-
44
-    /**
45
-     * {@inheritDoc}
46
-     */
47
-    public function setUp()
48
-    {
49
-        parent::setUp();
50
-        Config::nest();
51
-    }
52
-
53
-    /**
54
-     * {@inheritDoc}
55
-     */
56
-    public function tearDown()
57
-    {
58
-        Config::unnest();
59
-        parent::tearDown();
60
-    }
61
-
62
-    public function testOnlyLogsWithErrors()
63
-    {
64
-        Config::modify()->set(EnvironmentChecker::class, 'log_results_warning', true);
65
-        Config::modify()->set(EnvironmentChecker::class, 'log_results_error', true);
66
-        EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckNoErrors());
67
-        $checker = Phockito::spy(
68
-            EnvironmentChecker::class,
69
-            'test suite',
70
-            'test'
71
-        );
72
-
73
-        $response = $checker->index();
74
-        Phockito::verify($checker, 0)->log(\anything(), \anything());
75
-        EnvironmentCheckSuite::reset();
76
-    }
77
-
78
-    public function testLogsWithWarnings()
79
-    {
80
-        Config::modify()->set(EnvironmentChecker::class, 'log_results_warning', true);
81
-        Config::modify()->set(EnvironmentChecker::class, 'log_results_error', false);
82
-        EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings());
83
-        EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors());
84
-        $checker = Phockito::spy(
85
-            EnvironmentChecker::class,
86
-            'test suite',
87
-            'test'
88
-        );
89
-
90
-        $response = $checker->index();
91
-        Phockito::verify($checker, 1)->log(containsString('warning'), \anything());
92
-        Phockito::verify($checker, 0)->log(containsString('error'), \anything());
93
-        EnvironmentCheckSuite::reset();
94
-    }
95
-
96
-    public function testLogsWithErrors()
97
-    {
98
-        Config::modify()->set(EnvironmentChecker::class, 'log_results_error', false);
99
-        Config::modify()->set(EnvironmentChecker::class, 'log_results_error', true);
100
-        EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings());
101
-        EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors());
102
-        $checker = Phockito::spy(
103
-            EnvironmentChecker::class,
104
-            'test suite',
105
-            'test'
106
-        );
107
-
108
-        $response = $checker->index();
109
-        Phockito::verify($checker, 0)->log(containsString('warning'), \anything());
110
-        Phockito::verify($checker, 1)->log(containsString('error'), \anything());
111
-        EnvironmentCheckSuite::reset();
112
-    }
22
+	/**
23
+	 * {@inheritDoc}
24
+	 * @var bool
25
+	 */
26
+	protected $usesDatabase = true;
27
+
28
+	/**
29
+	 * {@inheritDoc}
30
+	 */
31
+	public static function setUpBeforeClass()
32
+	{
33
+		parent::setUpBeforeClass();
34
+
35
+		Phockito::include_hamcrest();
36
+
37
+		$logger = Injector::inst()->get(LoggerInterface::class);
38
+		if ($logger instanceof \Monolog\Logger) {
39
+			// It logs to stderr by default - disable
40
+			$logger->pushHandler(new \Monolog\Handler\NullHandler);
41
+		}
42
+	}
43
+
44
+	/**
45
+	 * {@inheritDoc}
46
+	 */
47
+	public function setUp()
48
+	{
49
+		parent::setUp();
50
+		Config::nest();
51
+	}
52
+
53
+	/**
54
+	 * {@inheritDoc}
55
+	 */
56
+	public function tearDown()
57
+	{
58
+		Config::unnest();
59
+		parent::tearDown();
60
+	}
61
+
62
+	public function testOnlyLogsWithErrors()
63
+	{
64
+		Config::modify()->set(EnvironmentChecker::class, 'log_results_warning', true);
65
+		Config::modify()->set(EnvironmentChecker::class, 'log_results_error', true);
66
+		EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckNoErrors());
67
+		$checker = Phockito::spy(
68
+			EnvironmentChecker::class,
69
+			'test suite',
70
+			'test'
71
+		);
72
+
73
+		$response = $checker->index();
74
+		Phockito::verify($checker, 0)->log(\anything(), \anything());
75
+		EnvironmentCheckSuite::reset();
76
+	}
77
+
78
+	public function testLogsWithWarnings()
79
+	{
80
+		Config::modify()->set(EnvironmentChecker::class, 'log_results_warning', true);
81
+		Config::modify()->set(EnvironmentChecker::class, 'log_results_error', false);
82
+		EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings());
83
+		EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors());
84
+		$checker = Phockito::spy(
85
+			EnvironmentChecker::class,
86
+			'test suite',
87
+			'test'
88
+		);
89
+
90
+		$response = $checker->index();
91
+		Phockito::verify($checker, 1)->log(containsString('warning'), \anything());
92
+		Phockito::verify($checker, 0)->log(containsString('error'), \anything());
93
+		EnvironmentCheckSuite::reset();
94
+	}
95
+
96
+	public function testLogsWithErrors()
97
+	{
98
+		Config::modify()->set(EnvironmentChecker::class, 'log_results_error', false);
99
+		Config::modify()->set(EnvironmentChecker::class, 'log_results_error', true);
100
+		EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckWarnings());
101
+		EnvironmentCheckSuite::register('test suite', new EnvironmentCheckerTest_CheckErrors());
102
+		$checker = Phockito::spy(
103
+			EnvironmentChecker::class,
104
+			'test suite',
105
+			'test'
106
+		);
107
+
108
+		$response = $checker->index();
109
+		Phockito::verify($checker, 0)->log(containsString('warning'), \anything());
110
+		Phockito::verify($checker, 1)->log(containsString('error'), \anything());
111
+		EnvironmentCheckSuite::reset();
112
+	}
113 113
 }
114 114
 
115 115
 class EnvironmentCheckerTest_CheckNoErrors implements EnvironmentCheck, TestOnly
116 116
 {
117
-    public function check()
118
-    {
119
-        return [EnvironmentCheck::OK, ''];
120
-    }
117
+	public function check()
118
+	{
119
+		return [EnvironmentCheck::OK, ''];
120
+	}
121 121
 }
122 122
 
123 123
 class EnvironmentCheckerTest_CheckWarnings implements EnvironmentCheck, TestOnly
124 124
 {
125
-    public function check()
126
-    {
127
-        return [EnvironmentCheck::WARNING, 'test warning'];
128
-    }
125
+	public function check()
126
+	{
127
+		return [EnvironmentCheck::WARNING, 'test warning'];
128
+	}
129 129
 }
130 130
 
131 131
 class EnvironmentCheckerTest_CheckErrors implements EnvironmentCheck, TestOnly
132 132
 {
133
-    public function check()
134
-    {
135
-        return [EnvironmentCheck::ERROR, 'test error'];
136
-    }
133
+	public function check()
134
+	{
135
+		return [EnvironmentCheck::ERROR, 'test error'];
136
+	}
137 137
 }
Please login to merge, or discard this patch.