Bearsampp
2026.7.11
Toggle main menu visibility
Loading...
Searching...
No Matches
ajax.php.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2024 Bearsampp
4
* License: GNU General Public License version 3 or later; see LICENSE.txt
5
* Author: Bear
6
* Website: https://bearsampp.com
7
* Github: https://github.com/Bearsampp
8
*/
9
24
global
$bearsamppBins
,
$bearsamppLang
;
25
34
$result
= array(
35
'status'
=>
''
,
36
'versions'
=>
''
,
37
'extscount'
=>
''
,
38
'pearversion'
=>
''
,
39
'extslist'
=>
''
,
40
);
41
45
if
(
$bearsamppBins
->getPhp()->isEnable()) {
46
$result
[
'status'
] =
'<span class="float-end badge text-bg-success">'
.
$bearsamppLang
->getValue(
Lang::ENABLED
) .
'</span>'
;
47
}
else
{
48
$result
[
'status'
] =
'<span class="float-end badge text-bg-danger">'
.
$bearsamppLang
->getValue(
Lang::DISABLED
) .
'</span>'
;
49
}
50
54
foreach
(
$bearsamppBins
->getPhp()->getVersionList() as $version) {
55
if
($version !=
$bearsamppBins
->getPhp()->getVersion()) {
56
$result
[
'versions'
] .=
'<span class="m-1 badge text-bg-secondary">'
. $version .
'</span>'
;
57
}
else
{
58
$result
[
'versions'
] .=
'<span class="m-1 badge text-bg-primary">'
.
$bearsamppBins
->getPhp()->getVersion() .
'</span>'
;
59
}
60
}
61
65
$exts
= count(
$bearsamppBins
->getPhp()->getExtensions());
66
$extsLoaded
= count(
$bearsamppBins
->getPhp()->getExtensionsLoaded());
67
$result
[
'extscount'
] .=
'<span class="m-1 float-end badge text-bg-primary">'
.
$extsLoaded
.
' / '
.
$exts
.
'</span>'
;
68
72
$result
[
'pearversion'
] .=
'<span class="m-1 float-end badge text-bg-primary">'
.
$bearsamppBins
->getPhp()->getPearVersion(
true
) .
'</span>'
;
73
77
foreach
(
$bearsamppBins
->getPhp()->getExtensionsFromConf() as $extName => $extStatus) {
78
if
($extStatus ==
ActionSwitchPhpExtension::SWITCH_ON
) {
79
$result
[
'extslist'
] .=
'<span class="p-1 col-xs-12 col-md-2"><i class="fa-regular fa-circle-check"></i> <strong>'
. $extName .
' <sup>'
. phpversion(substr($extName, 4)) .
'</sup></strong></span>'
;
80
}
else
{
81
$result
[
'extslist'
] .=
'<span class="p-1 col-xs-12 col-md-2"><i class="fa-regular fa-circle"></i> '
. $extName .
'</span>'
;
82
}
83
}
84
88
echo json_encode(
$result
);
89
$result
$result
Definition
ajax.apache.php:19
$bearsamppBins
global $bearsamppBins
Definition
ajax.apache.php:16
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
$exts
foreach($bearsamppBins->getPhp() ->getVersionList() as $version) $exts
Definition
ajax.php.php:65
$extsLoaded
$extsLoaded
Definition
ajax.php.php:66
ActionSwitchPhpExtension\SWITCH_ON
const SWITCH_ON
Definition
class.action.switchPhpExtension.php:17
Lang\DISABLED
const DISABLED
Definition
class.lang.php:36
Lang\ENABLED
const ENABLED
Definition
class.lang.php:42
sandbox
core
resources
homepage
ajax
ajax.php.php
Generated by
1.17.0