Repository navigation
Expand file tree
/
Copy pathautoinstall.php
More file actions
87 lines (72 loc) · 2.07 KB
/
Copy pathautoinstall.php
File metadata and controls
87 lines (72 loc) · 2.07 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* Monitor plugin autoinstall helpers.
*
* Compatibility target for Monitor 1.5.0:
* - Geeklog 2.1.1 through 2.2.2
* - PHP 5.6 through 8.1
*
* @package Monitor
*/
function plugin_autoinstall_monitor($pi_name)
{
$pi_name = 'monitor';
$pi_display_name = 'Monitor';
$pi_admin = $pi_display_name . ' Admin';
$info = array(
'pi_name' => $pi_name,
'pi_display_name' => $pi_display_name,
'pi_version' => '1.5.0',
'pi_gl_version' => '2.1.1',
'pi_homepage' => 'https://github.com/hostellerie/monitor'
);
$groups = array(
$pi_admin => 'Users in this group can administer the '
. $pi_display_name . ' plugin'
);
$features = array(
$pi_name . '.admin' => 'Full access to ' . $pi_display_name . ' plugin'
);
$mappings = array(
$pi_name . '.admin' => array($pi_admin)
);
$tables = array(
'monitor_ban'
);
return array(
'info' => $info,
'groups' => $groups,
'features' => $features,
'mappings' => $mappings,
'tables' => $tables
);
}
function plugin_load_configuration_monitor($pi_name)
{
global $_CONF;
$base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';
require_once $_CONF['path_system'] . 'classes/config.class.php';
require_once $base_path . 'install_defaults.php';
return plugin_initconfig_monitor();
}
/**
* Check runtime compatibility before installation or upgrade.
*
* Monitor 1.5.0 deliberately uses the common PHP subset supported by PHP 5.6
* through PHP 8.1. Future PHP versions may work but are not claimed here until
* tested. We reject versions older than the supported baseline and Geeklog
* versions older than 2.1.1.
*
* @param string $pi_name
* @return bool
*/
function plugin_compatible_with_this_version_monitor($pi_name)
{
if (version_compare(PHP_VERSION, '5.6.0', '<')) {
return false;
}
if (defined('VERSION') && COM_versionCompare(VERSION, '2.1.1', '<')) {
return false;
}
return true;
}