* wip

* fix plugin uninstall

* marketplace
This commit is contained in:
Saeed Vaziry
2025-06-19 14:07:15 +02:00
committed by GitHub
parent 131b828807
commit 342a3aa4c6
35 changed files with 1973 additions and 934 deletions

View File

@ -227,3 +227,41 @@ function user(): User
return $user;
}
function plugins_path(?string $path = null): string
{
if ($path === null) {
$path = storage_path('plugins');
if (! file_exists($path)) {
mkdir($path, 0755, true);
}
return $path;
}
return storage_path('plugins'.'/'.$path);
}
function composer_path(): ?string
{
$paths = [
'/usr/local/bin/composer',
'/usr/bin/composer',
'/opt/homebrew/bin/composer',
trim((string) shell_exec('which composer')),
];
return array_find($paths, fn ($path) => is_executable($path));
}
function php_path(): ?string
{
$paths = [
'/usr/local/bin/php',
'/usr/bin/php',
'/opt/homebrew/bin/php',
trim((string) shell_exec('which php')),
];
return array_find($paths, fn ($path) => is_executable($path));
}