Initial Ladill Hosting app with Gitea deploy pipeline.
Deploy Ladill Hosting / deploy (push) Failing after 17s
Deploy Ladill Hosting / deploy (push) Failing after 17s
Shared web hosting extracted from the platform monolith, with CI deploy to /var/www/ladill-hosting matching Bird/Domains/Email. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Hosting;
|
||||
|
||||
use App\Models\CustomerHostingOrder;
|
||||
use App\Models\HostingAccount;
|
||||
use App\Services\Hosting\Contracts\PanelRuntimeInterface;
|
||||
use App\Services\Hosting\PanelRuntimes\SharedHostingPanelRuntime;
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
|
||||
class PanelRuntimeResolver
|
||||
{
|
||||
public function __construct(
|
||||
private SharedHostingPanelRuntime $sharedHostingRuntime,
|
||||
) {}
|
||||
|
||||
public function forSubject(mixed $subject): PanelRuntimeInterface
|
||||
{
|
||||
if ($subject instanceof HostingAccount) {
|
||||
return $this->sharedHostingRuntime;
|
||||
}
|
||||
|
||||
if ($subject instanceof CustomerHostingOrder) {
|
||||
throw new RuntimeException('Server-backed hosting panel runtime is not enabled yet for this order.');
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException('Unsupported panel runtime subject.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user