-
Notifications
You must be signed in to change notification settings - Fork 0
/
Handler.php
50 lines (40 loc) · 1.21 KB
/
Handler.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
<?php
/**
* Copyright (C) Apis Networks, Inc - All Rights Reserved.
*
* Unauthorized copying of this file, via any medium, is
* strictly prohibited without consent. Any dissemination of
* material herein is prohibited.
*
* For licensing inquiries email <[email protected]>
*
* Written by Matt Saladna <[email protected]>, August 2020
*/
namespace Module\Support\Webapps\App\Type\Drupal;
use Module\Support\Webapps\App\Type\Unknown\Handler as Unknown;
class Handler extends Unknown
{
const NAME = 'Drupal';
const ADMIN_PATH = '/user';
const LINK = 'https://drupal.org';
const FEAT_ALLOW_SSL = true;
const FEAT_RECOVERY = false;
public function recover(): bool
{
return $this->drupal_disable_all_plugins($this->hostname, $this->path);
}
public function getAppRoot(): ?string
{
if (!$this->docroot) {
return $this->docroot;
}
// 9.0 may use a public dispatcher directory
$stat = $this->file_stat($this->docroot . '/../web');
if ($stat && $stat['file_type'] === 'dir') {
// @todo convert to lookup with other webapps?
$stat = $this->file_stat($this->docroot);
return dirname($stat['referent'] ?: $this->docroot);
}
return $this->docroot;
}
}