/
ZipSupport.php
57 lines (50 loc) · 1.2 KB
/
ZipSupport.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
<?php
namespace Concrete\Core\Install\Preconditions;
use Concrete\Core\Install\PreconditionInterface;
use Concrete\Core\Install\PreconditionResult;
class ZipSupport implements PreconditionInterface
{
/**
* {@inheritdoc}
*
* @see PreconditionInterface::getName()
*/
public function getName()
{
return t('Zip Support');
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::getUniqueIdentifier()
*/
public function getUniqueIdentifier()
{
return 'zip_support';
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::isOptional()
*/
public function isOptional()
{
return true;
}
/**
* {@inheritdoc}
*
* @see PreconditionInterface::performCheck()
*/
public function performCheck()
{
$result = new PreconditionResult();
if (!class_exists('ZipArchive')) {
$result
->setState(PreconditionResult::STATE_FAILED)
->setMessage(t('Downloading zipped files from the file manager, remote updating and marketplace integration requires the Zip extension.'))
;
}
return $result;
}
}