This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
bh_check_php_version.php
95 lines (69 loc) · 2.29 KB
/
bh_check_php_version.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
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
88
89
90
91
92
93
94
95
<?php
/*======================================================================
Copyright Project BeehiveForum 2002
This file is part of BeehiveForum.
BeehiveForum is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
BeehiveForum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Beehive; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
======================================================================*/
require 'Bartlett/PHP/CompatInfo/Autoload.php';
require 'Bartlett/PHP/CompatInfo.php';
set_time_limit(0);
header('Content-Type: text/plain');
echo "Please wait checking Minimum PHP Version...\n\n";
$pci = new PHP_CompatInfo();
$minimum_version = "0";
$versions_array = array();
$extensions_array = array();
$ignore_result_keys = array(
'ignored_files',
'ignored_functions',
'ignored_extensions',
'ignored_constants',
'max_version',
'version',
'classes',
'functions',
'extensions',
'constants',
'tokens',
'cond_code'
);
if (isset($_SERVER['argc']) && ($_SERVER['argc'] > 1)) {
$pci->parse(array_splice($_SERVER['argv'], 1));
} else {
$options = array(
'debug' => false,
'recurse_dir' => true,
'ignore_dirs' => array(
'forum/ckeditor',
'forum/include/htmlpurifier',
'forum/include/locale',
'forum/include/swift',
),
);
$pci->parse('forum');
}
$results = $pci->toArray();
foreach ($results[0]['extensions'] as $extension_name => $extension_info) {
if (in_array($extension_name, array('Core', 'standard'))) {
continue;
}
$extensions_array[] = $extension_name;
}
$minimum_version = $results[0]['versions'][0];
sort($extensions_array);
printf(
"PHP Minimum Version = %s\nExtensions required : %s\n\n",
$minimum_version,
implode(", ", $extensions_array)
);