Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/config/check/PhabricatorExtensionsSetupCheck.php
12256 views
1
<?php
2
3
final class PhabricatorExtensionsSetupCheck extends PhabricatorSetupCheck {
4
5
public function getDefaultGroup() {
6
return self::GROUP_PHP;
7
}
8
9
public function isPreflightCheck() {
10
return true;
11
}
12
13
protected function executeChecks() {
14
// TODO: Make 'mbstring' a soft requirement.
15
16
$required = array(
17
'hash',
18
'json',
19
'openssl',
20
'mbstring',
21
'ctype',
22
23
// There is a tiny chance we might not need this, but a significant
24
// number of applications require it and it's widely available.
25
'curl',
26
);
27
28
$need = array();
29
foreach ($required as $extension) {
30
if (!extension_loaded($extension)) {
31
$need[] = $extension;
32
}
33
}
34
35
if (!extension_loaded('mysqli') && !extension_loaded('mysql')) {
36
$need[] = 'mysqli or mysql';
37
}
38
39
if (!$need) {
40
return;
41
}
42
43
$message = pht('Required PHP extensions are not installed.');
44
45
$issue = $this->newIssue('php.extensions')
46
->setIsFatal(true)
47
->setName(pht('Missing Required Extensions'))
48
->setMessage($message);
49
50
foreach ($need as $extension) {
51
$issue->addPHPExtension($extension);
52
}
53
}
54
}
55
56