Skip to content
Snippets Groups Projects
Commit 9d3f06ec authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

amcli v0.5 - add param to show buildinfo

parent 8258907b
No related branches found
No related tags found
No related merge requests found
......@@ -19,9 +19,14 @@ $argc = $_SERVER['argc'];
$argv = $_SERVER['argv'];
$FLAG_DEBUG = 0;
$VERSION = "0.4";
$VERSION = "0.5";
$AMCLI_BUILD_DATE = "never";
// ---MARK---INCLUDE-CHECKS---START---
@include "amcli__build.php";
if (!file_exists(__DIR__ . "/include_checks.php")) {
echo "❌ ERROR: File 'include_checks.php' does not exist yet..\n";
echo "Run the ../installer.php first!\n";
......@@ -119,12 +124,15 @@ You find example snippets in the source code of this project in tests/config/.
🔷 \e[1mOPTIONS:\e[0m
-h, --help Print this help and exit
-i, --ini Set an INI File to parse
-l, --list list available checks and exit
-m, --modules list available Php modules in this binary and exit
-v, --verbose Enable verbose output (written to STDERR)
-V, --version Show version and exit
-h, --help Print this help and exit
-i, --ini Set an INI File to parse
-v, --verbose Enable verbose output (written to STDERR)
-b, --buildinfos show build information and exit
-l, --list list available checks and exit
-m, --modules list available Php modules in this binary and exit
-V, --version Show version and exit
👉 \e[1mEXAMPLES:\e[0m
......@@ -158,10 +166,41 @@ if (isset($ARGS['-v']) || isset($ARGS['--verbose'])) {
}
_wd("CLI ARGS: " . print_r($ARGS ?? [], 1));
_wd("Initializing appmonitor class");
$oMonitor = new appmonitor();
$sPreSpace = " - ";
// show version
if (isset($ARGS['-V']) || isset($ARGS['--version'])) {
_wd("Showing version");
echo "$VERSION\n";
echo "amcli $VERSION\n";
exit(0);
}
// show build infos
if (isset($ARGS['-b']) || isset($ARGS['--buildinfos'])) {
$aMods = get_loaded_extensions();
sort($aMods);
_wd("Showing build infos");
echo "amcli v$VERSION (".PHP_OS.")\n\n";
echo "Build date: $AMCLI_BUILD_DATE\n";
echo "\n";
echo "Compiled with PHP ".PHP_VERSION."\n";
echo "Including these modules:\n";
$sModules=" ";
$i=0;
foreach($aMods as $sModulename){
$i++;
$sModules.="$sModulename ";
if($i % 10 == 0){
$sModules.="\n ";
}
}
echo "$sModules\n\n";
exit(0);
}
......@@ -174,10 +213,6 @@ if (isset($ARGS['-h']) || isset($ARGS['--help'])) {
// ----------------------------------------------------------------------
_wd("Initializing appmonitor class");
$oMonitor = new appmonitor();
$sPreSpace = " - ";
// show builtin checks
if (isset($ARGS['-l']) || isset($ARGS['--list'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment