/
DomExtension.php
56 lines (50 loc) · 1.13 KB
/
DomExtension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace Concrete\Core\Install\Preconditions;
use Concrete\Core\Install\PreconditionInterface;
use Concrete\Core\Install\PreconditionResult;
class DomExtension implements PreconditionInterface
{
/**
* {@inheritdoc}
*
* @see PreconditionInterface::getName()
*/
public function getName()
{
return t('DOM Extension Enabled');
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::getUniqueIdentifier()
*/
public function getUniqueIdentifier()
{
return 'dom_extension';
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::isOptional()
*/
public function isOptional()
{
return false;
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::performCheck()
*/
public function performCheck()
{
$result = new PreconditionResult();
if (!extension_loaded('dom')) {
$result
->setState(PreconditionResult::STATE_FAILED)
->setMessage(t("You must enable PHP's DOM support."))
;
}
return $result;
}
}