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
4c7b5746
Commit
4c7b5746
authored
2 weeks ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
workaround for ms windows dowload with wget
parent
a3719928
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc_functions.php
+42
-42
42 additions, 42 deletions
inc_functions.php
installer.php
+1
-1
1 addition, 1 deletion
installer.php
with
43 additions
and
43 deletions
inc_functions.php
+
42
−
42
View file @
4c7b5746
...
...
@@ -64,57 +64,57 @@ function _chdir(string $sDir): void
*
* @return int
*/
function
_exec
(
string
$cmd
,
bool
$bAbortOnError
=
true
):
int
function
_exec
(
string
$cmd
,
bool
$bAbortOnError
=
true
,
$bForceExec
=
false
):
int
{
global
$aCol
;
echo
"
$aCol[blue]
cmd >
$cmd$aCol[reset]
\n
"
;
$iStart
=
microtime
(
true
);
/*
exec("$cmd 2>&1", $aOut, $rc);
$iEnd=microtime(true);
if (!count($aOut)) {
$aOut = ["-- no output --"];
}
echo implode("\n", $aOut) . "\n";
*/
// show output in real-time
$descriptorspec
=
[
0
=>
[
"pipe"
,
"r"
],
// stdin
1
=>
[
"pipe"
,
"w"
],
// stdout
2
=>
[
"pipe"
,
"w"
]
// stderr
];
$process
=
proc_open
(
$cmd
,
$descriptorspec
,
$pipes
);
if
(
is_resource
(
$process
))
{
// Close stdin pipe
fclose
(
$pipes
[
0
]);
// Read stdout and stderr in real-time
while
(
$output
=
fgets
(
$pipes
[
1
]))
{
echo
" |
$output
"
;
flush
();
}
fclose
(
$pipes
[
1
]);
while
(
$error
=
fgets
(
$pipes
[
2
]))
{
echo
" 2|
$error
"
;
flush
();
}
fclose
(
$pipes
[
2
]);
// Close the process
$rc
=
proc_close
(
$process
);
if
(
$bForceExec
)
{
exec
(
"
$cmd
2>&1"
,
$aOut
,
$rc
);
$iEnd
=
microtime
(
true
);
if
(
!
count
(
$aOut
))
{
$aOut
=
[
"-- no output --"
];
}
echo
implode
(
"
\n
"
,
$aOut
)
.
"
\n
"
;
}
else
{
if
(
$bAbortOnError
){
_abort
(
"Unable to execute command."
);
// show output in real-time
$descriptorspec
=
[
0
=>
[
"pipe"
,
"r"
],
// stdin
1
=>
[
"pipe"
,
"w"
],
// stdout
2
=>
[
"pipe"
,
"w"
]
// stderr
];
$process
=
proc_open
(
$cmd
,
$descriptorspec
,
$pipes
);
if
(
is_resource
(
$process
))
{
// Close stdin pipe
fclose
(
$pipes
[
0
]);
// Read stdout and stderr in real-time
while
(
$output
=
fgets
(
$pipes
[
1
]))
{
echo
" |
$output
"
;
flush
();
}
fclose
(
$pipes
[
1
]);
while
(
$error
=
fgets
(
$pipes
[
2
]))
{
echo
" 2|
$error
"
;
flush
();
}
fclose
(
$pipes
[
2
]);
// Close the process
$rc
=
proc_close
(
$process
);
$iEnd
=
microtime
(
true
);
}
else
{
if
(
$bAbortOnError
){
_abort
(
"Unable to execute command."
);
}
_skip
(
"Unable to execute command."
);
}
_skip
(
"Unable to execute command."
);
}
$sTime
=
"... ⏱️ Time: "
.
round
(
$iEnd
-
$iStart
,
3
)
.
"s
\n
"
;
if
(
$rc
!=
0
)
{
...
...
This diff is collapsed.
Click to expand it.
installer.php
+
1
−
1
View file @
4c7b5746
...
...
@@ -163,7 +163,7 @@ _exec("php -l \"$incfile\"");
_h1
(
"Get / update spc"
);
_chdir
(
"
$selfdir
/
$dirExternal
/bin"
);
if
(
!
file_exists
(
$SPC
)){
_exec
(
"wget -O
$SPC
\"
$spcUrl
\"
"
);
_exec
(
"wget -O
$SPC
\"
$spcUrl
\"
"
,
true
,
(
$myos
==
"windows"
)
);
}
else
{
_skip
(
"download of spc."
);
}
...
...
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