/
PdoMysqlExtension.php
59 lines (53 loc) · 1.21 KB
/
PdoMysqlExtension.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
57
58
59
<?php
namespace Concrete\Core\Install\Preconditions;
use Concrete\Core\Install\PreconditionInterface;
use Concrete\Core\Install\PreconditionResult;
class PdoMysqlExtension implements PreconditionInterface
{
/**
* {@inheritdoc}
*
* @see PreconditionInterface::getName()
*/
public function getName()
{
return t('MySQL PDO Extension Enabled');
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::getUniqueIdentifier()
*/
public function getUniqueIdentifier()
{
return 'pdo_mysql_extension';
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::isOptional()
*/
public function isOptional()
{
return false;
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::performCheck()
*/
public function performCheck()
{
$result = new PreconditionResult();
if (!(
extension_loaded('pdo')
&& extension_loaded('pdo_mysql')
)) {
$result
->setState(PreconditionResult::STATE_FAILED)
->setMessage(t('The PDO extension is not loaded.'))
;
}
return $result;
}
}