-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHandler.php
43 lines (38 loc) · 1.22 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
<?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\Discourse;
use Module\Support\Webapps\App\Type\Passenger\Handler as Passenger;
use Opcenter\Versioning;
class Handler extends Passenger
{
const NAME = 'Discourse';
const ADMIN_PATH = '/admin';
const LINK = 'https://discourse.org/';
const FEAT_ALLOW_SSL = true;
const FEAT_RECOVERY = false;
const FEAT_GIT = false;
const APP_ROOT_DEPTH = 1;
const MAXMIND_KEY_PREF = 'auth.geolite2';
public function changePassword(string $password): bool
{
return $this->discourse_change_admin($this->hostname, $this->path, array('password' => $password));
}
public function getInstallableVersions(): array
{
$hasRedis6 = version_compare($this->redis_version(), '6.2', '>=');
return array_filter(
$this->discourse_get_versions(),
static fn ($version) => Versioning::asMajor($version) < 3 || $hasRedis6
);
}
}