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

fix spc build detection with done file

parent 7e1315d0
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ require("inc_functions.php");
$gitAppmonitor="https://github.com/iml-it/appmonitor.git";
$spcUrl="https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-$myos-$myarchitecture";
$doneBuild="__done_build-micro__".md5($php_version.$php_libs).".txt";
$doneBuild="__done_build-micro__.txt";
/*
Filename Last Modified Size Download Count
......@@ -39,7 +39,7 @@ echo "
- gets appmonitor sources
- gets spc binary
- spc downloads PHP and libs
- spc builds micro (1..2 min)
- spc builds micro (~2 min)
";
......@@ -132,16 +132,25 @@ if (PHP_OS == "Linux") {
_h1("Spc - prepare environment");
_chdir("$selfdir/$dirBuild");
if(!file_exists("$doneBuild")){
$bDoBild=true;
$sDoneData="PHP version $php_version\nExtensions: $php_libs";
if(file_exists($doneBuild)){
$sDone=file_get_contents($doneBuild);
if (strstr($sDone, $sDoneData)>=0){
$bDoBild=false;
}
}
if ($bDoBild){
_exec("$SPC --no-interaction doctor");
_exec("$SPC download --no-interaction --with-php=$php_version --for-extensions '$php_libs'");
echo "💡 Hint: this can take 2 minutes ...\n";
_exec("$SPC build --no-interaction --build-micro '$php_libs'");
touch("$doneBuild");
file_put_contents("$doneBuild", date("Y-m-d H:i:s") . "\n$sDoneData\n");
} else {
_skip("Micro already built - php $php_version - extensions '$php_libs'");
}
_h1("Done.");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment