Bearsampp
2025.8.29
Loading...
Searching...
No Matches
ajax.nodejs.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
10
global
$bearsamppBins
,
$bearsamppLang
;
11
23
$result
= array(
24
'status'
=>
''
,
25
'versions'
=>
''
26
);
27
28
// Status
34
if
(
$bearsamppBins
->getNodejs()->isEnable()) {
35
$result
[
'status'
] =
'<span class="float-end badge text-bg-success">'
.
$bearsamppLang
->getValue(
Lang::ENABLED
) .
'</span>'
;
36
}
else
{
37
$result
[
'status'
] =
'<span class="float-end badge text-bg-danger">'
.
$bearsamppLang
->getValue(
Lang::DISABLED
) .
'</span>'
;
38
}
39
40
// Versions
45
foreach
(
$bearsamppBins
->getNodejs()->getVersionList() as $version) {
46
if
($version !=
$bearsamppBins
->getNodejs()->getVersion()) {
47
$result
[
'versions'
] .=
'<span class="m-1 badge text-bg-secondary">'
. $version .
'</span>'
;
48
}
else
{
49
$result
[
'versions'
] .=
'<span class="m-1 badge text-bg-primary">'
.
$bearsamppBins
->getNodejs()->getVersion() .
'</span>'
;
50
}
51
}
52
53
// Output the result as a JSON-encoded string
54
echo json_encode(
$result
);
$result
$result
Definition
ajax.apache.php:19
$bearsamppBins
global $bearsamppBins
Definition
ajax.apache.php:16
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
Lang\DISABLED
const DISABLED
Definition
class.lang.php:36
Lang\ENABLED
const ENABLED
Definition
class.lang.php:42
Bearsampp-development
sandbox
core
resources
homepage
ajax
ajax.nodejs.php
Generated by
1.14.0