2024.8.23
Loading...
Searching...
No Matches
ajax.nodejs.php File Reference

Go to the source code of this file.

Variables

global $bearsamppBins
 
global $bearsamppLang
 
 $result
 
if($bearsamppBins->getNodejs() ->isEnable()) else
 
 foreach ( $bearsamppBins->getNodejs() ->getVersionList() as $version)
 

Variable Documentation

◆ $bearsamppBins

global $bearsamppBins

Definition at line 10 of file ajax.nodejs.php.

◆ $bearsamppLang

global $bearsamppLang

Definition at line 10 of file ajax.nodejs.php.

◆ $result

$result
Initial value:
= array(
'status' => '',
'versions' => ''
)

This script generates a JSON-encoded array containing the status and versions of Node.js. It checks if Node.js is enabled and sets the status accordingly. Then, it loops through the Node.js version list, adding versions to the 'versions' key. Finally, it encodes the result array into a JSON format and echoes it.

@global object $bearsamppBins Provides access to various binaries including Node.js. @global object $bearsamppLang Provides access to language strings for localization.

Returns
void

Definition at line 23 of file ajax.nodejs.php.

◆ else

if ( $bearsamppBins->getNodejs() ->isEnable()) else
Initial value:
{
$result['status'] = '<span class="float-end badge text-bg-danger">' . $bearsamppLang->getValue(Lang::DISABLED) . '</span>'
$result
global $bearsamppLang
const DISABLED

Checks if Node.js is enabled and sets the status in the result array. If enabled, sets the status to a success badge with the 'ENABLED' label. If disabled, sets the status to a danger badge with the 'DISABLED' label.

Definition at line 36 of file ajax.nodejs.php.

◆ foreach

foreach($bearsamppBins->getNodejs() ->getVersionList() as $version) ( $bearsamppBins->getNodejs() ->getVersionList() as)

Loops through the list of Node.js versions and adds them to the 'versions' key in the result array. The current version is highlighted with a primary badge, while other versions are shown with a secondary badge.

Definition at line 45 of file ajax.nodejs.php.