From 12fcfa6563e5518907754624db4efe5d092f31a9 Mon Sep 17 00:00:00 2001 From: "Victor B." Date: Tue, 11 Jun 2024 22:21:55 +0200 Subject: [PATCH] chore: don't use `::f` placeholders --- .../ExtensionLibrary/Admin/BlueprintAdminLibrary.php | 2 +- .../ExtensionLibrary/Client/BlueprintClientLibrary.php | 2 +- .../PlaceholderService/BlueprintPlaceholderService.php | 2 +- blueprint.sh | 8 ++------ 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/BlueprintFramework/Libraries/ExtensionLibrary/Admin/BlueprintAdminLibrary.php b/app/BlueprintFramework/Libraries/ExtensionLibrary/Admin/BlueprintAdminLibrary.php index 6583515..a2aec01 100644 --- a/app/BlueprintFramework/Libraries/ExtensionLibrary/Admin/BlueprintAdminLibrary.php +++ b/app/BlueprintFramework/Libraries/ExtensionLibrary/Admin/BlueprintAdminLibrary.php @@ -145,7 +145,7 @@ class BlueprintAdminLibrary * [BlueprintExtensionLibrary documentation](https://blueprint.zip/docs/?page=documentation/$blueprint) */ public function extension($identifier): bool { - if(str_contains($this->fileRead("::f/.blueprint/extensions/blueprint/private/db/installed_extensions"), $identifier.',')) { + if(str_contains($this->fileRead(base_path(".blueprint/extensions/blueprint/private/db/installed_extensions")), $identifier.',')) { return true; } else { return false; diff --git a/app/BlueprintFramework/Libraries/ExtensionLibrary/Client/BlueprintClientLibrary.php b/app/BlueprintFramework/Libraries/ExtensionLibrary/Client/BlueprintClientLibrary.php index 8b37399..093e5d7 100644 --- a/app/BlueprintFramework/Libraries/ExtensionLibrary/Client/BlueprintClientLibrary.php +++ b/app/BlueprintFramework/Libraries/ExtensionLibrary/Client/BlueprintClientLibrary.php @@ -102,7 +102,7 @@ class BlueprintClientLibrary * [BlueprintExtensionLibrary documentation](https://blueprint.zip/docs/?page=documentation/$blueprint) */ public function extension($identifier): bool { - if(str_contains($this->fileRead("::f/.blueprint/extensions/blueprint/private/db/installed_extensions"), $identifier.',')) { + if(str_contains($this->fileRead(base_path(".blueprint/extensions/blueprint/private/db/installed_extensions")), $identifier.',')) { return true; } else { return false; diff --git a/app/BlueprintFramework/Services/PlaceholderService/BlueprintPlaceholderService.php b/app/BlueprintFramework/Services/PlaceholderService/BlueprintPlaceholderService.php index 5fb5e2b..5e94af8 100644 --- a/app/BlueprintFramework/Services/PlaceholderService/BlueprintPlaceholderService.php +++ b/app/BlueprintFramework/Services/PlaceholderService/BlueprintPlaceholderService.php @@ -5,7 +5,7 @@ namespace Pterodactyl\BlueprintFramework\Services\PlaceholderService; class BlueprintPlaceholderService { public function version(): string { return "::v"; } - public function folder(): string { return "::f"; } + public function folder(): string { return base_path(); } public function installed(): string { return "NOTINSTALLED"; } public function api_url(): string { return "http://api.blueprint.zip:50000"; } } diff --git a/blueprint.sh b/blueprint.sh index 5638da4..eee8d63 100644 --- a/blueprint.sh +++ b/blueprint.sh @@ -6,7 +6,8 @@ # This should allow Blueprint to run in Docker. Please note that changing the $FOLDER variable after running # the Blueprint installation script will not change anything in any files besides blueprint.sh. - FOLDER="/var/www/pterodactyl" #; + FOLDER="$(realpath $(dirname $0))" #; +# Technically shouldn't be needed now, but I'm not going to touch this for now just in case it breaks stuff on Docker. -- @itsvic-dev DOCKERFOLDER="/app" # This stores the webserver ownership user which Blueprint uses when applying webserver permissions. @@ -222,11 +223,6 @@ if [[ $1 != "-bash" ]]; then php artisan storage:link &>> $BLUEPRINT__DEBUG PRINT INFO "Replacing internal placeholders.." - # Update folder placeholder on PlaceholderService and admin layout. - # Should avoid doing stuff this way in the future! - sed -i "s~::f~$FOLDER~g" $FOLDER/app/BlueprintFramework/Services/PlaceholderService/BlueprintPlaceholderService.php - sed -i "s~::f~$FOLDER~g" $FOLDER/app/BlueprintFramework/Libraries/ExtensionLibrary/Admin/BlueprintAdminLibrary.php - sed -i "s~::f~$FOLDER~g" $FOLDER/app/BlueprintFramework/Libraries/ExtensionLibrary/Client/BlueprintClientLibrary.php # Copy "Blueprint" extension page logo from assets. cp $FOLDER/.blueprint/assets/logo.jpg $FOLDER/.blueprint/extensions/blueprint/assets/logo.jpg