Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Appmonitor CLI client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Appmonitor CLI client
Commits
9d3f06ec
Commit
9d3f06ec
authored
4 weeks ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
amcli v0.5 - add param to show buildinfo
parent
8258907b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/amcli.php
+47
-12
47 additions, 12 deletions
src/amcli.php
with
47 additions
and
12 deletions
src/amcli.php
+
47
−
12
View file @
9d3f06ec
...
...
@@ -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'
]))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment