Fix indentation on VariableService and fix installation check.

Now the installation will be marked as installed after the installation script ends.
This commit is contained in:
purple 2023-06-20 18:08:25 +02:00
parent 9243e01498
commit a52ec1a3c1
4 changed files with 45 additions and 35 deletions

View file

@ -22,4 +22,10 @@ class BlueprintPlaceholderService
$v = "&bp.folder&";
return $v;
}
// installed()
public function installed(): string {
$v = "NOTINSTALLED";
return $v;
}
}

View file

@ -15,6 +15,7 @@ class BlueprintVariableService
// $bp->serve()
// $bp->isInstalled()
// $bp->version()
// $bp->dbGet('db::record')
// $bp->dbSet('db::record', 'value')
@ -27,6 +28,10 @@ class BlueprintVariableService
return $this->blueprintplaceholderservice->version();
}
public function isInstalled(): string {
return $this->blueprintplaceholderservice->installed();
}
public function dbGet($key): string {
$a = $this->settings->get("blueprint::".$key);
if (!$a) {
@ -36,14 +41,12 @@ class BlueprintVariableService
};
}
public function dbSet($key, $value): void
{
public function dbSet($key, $value): void {
$this->settings->set('blueprint::' . $key, $value);
return;
}
public function exec($arg): string|null
{
public function exec($arg): string|null {
return shell_exec("cd /var/www/".$this->blueprintplaceholderservice->folder().";bash blueprint.sh -exec ".$arg);
}
}

View file

@ -127,6 +127,7 @@ if [[ $1 != "-bash" ]]; then
fi;
dbAdd "blueprint.setupFinished";
sed -i "s!NOTINSTALLED!INSTALLED!g" /var/www/$FOLDER/app/Services/Helpers/BlueprintPlaceholderService.php;
exit 1;
fi;
fi;

View file

@ -13,7 +13,7 @@
@endsection
@section('content')
@if($bp->version() != "&bp.version&")
@if($bp->isInstalled() != "NOTINSTALLED")
<div class="col-xs-6 col-sm-3 text-center">
<a href="{{ route('admin.extensions.blueprint.index') }}"><button class="btn btn-gray" style="width:100%;margin-bottom:17px;"><img src="/assets/extensions/blueprint/logo.jpg" alt="logo" class="img-btn"> Blueprint <small>{{ $bp->version() }}</small></button></a>