danielpanzella/platformsh-client-php-bundle
Symfony bundle that registers the Platform.sh PHP API client as a service. Configure API token and token type in YAML, then fetch the PlatformClient from the container or inject it via Symfony 3.3+ autowiring.
symfony/dependency-injection or symfony/http-kernel).platformsh-client-php is used directly.ServiceProvider, Facade, or config/ integration). Direct integration would require:
AppServiceProvider).config/platformsh.php to the bundle’s YAML).bind() or a custom PlatformshServiceProvider).platformsh-client-php directly (more flexible, Laravel-native).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Deprecated Symfony 3.3 | High | Test compatibility with Symfony 5/6 or patch. |
| Laravel Integration Gaps | High | Build a thin Laravel adapter layer. |
| Stale Maintenance | Medium | Monitor for security updates; consider fork. |
| API Changes | Medium | Abstract Platform.sh API calls behind interfaces. |
| Configuration Rigidity | Low | Override bundle defaults via Laravel config. |
platformsh-client-php?
symfony/dependency-injection, symfony/http-kernel).platformsh-client-php directly with a custom PlatformshServiceProvider.composer require platformsh/client-php danielpanzella/platformsh-client-php-bundle
// app/Providers/PlatformshServiceProvider.php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\Config\FileLocator;
class PlatformshServiceProvider extends ServiceProvider {
public function register() {
$container = new ContainerBuilder();
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/config'));
$loader->load('platformsh.yaml'); // Map to bundle config
$this->app->instance(\Platformsh\Client\PlatformClient::class, $container->get('Platformsh\Client\PlatformClient'));
}
}
config/platformsh.php:
return [
'api_token' => env('PLATFORMSH_API_TOKEN'),
'api_token_type' => 'project',
];
use Platformsh\Client\PlatformClient;
class MyService {
public function __construct(PlatformClient $platformClient) {
// Use $platformClient
}
}
ParameterBag vs. Laravel’s env()).| Component | Compatibility Status | Notes |
|---|---|---|
| Symfony 3.3 | ❌ No | Requires Symfony 5+ patches or fork. |
| Laravel 8/9 | ⚠️ Partial | Needs bridge layer (see above). |
| PHP 7.1+ | ✅ Yes | Assuming bundle is patched. |
| Platform.sh API v1 | ✅ Yes | Risk if Platform.sh deprecates v1. |
debug:container).| Failure Scenario | Impact | Recovery Strategy |
|---|---|---|
| API Token Invalid | All Platform.sh operations fail | Use Laravel’s env() fallback + retries. |
| Symfony Container Errors | Service unavailability | Fallback to raw platformsh-client-php. |
| Platform.sh API Deprecation | Bundle breaks | Replace with official SDK or custom client. |
| Laravel Cache Corruption | Service binding fails | Clear cache (php artisan cache:clear). |
platformsh-client-php directly.How can I help you explore Laravel packages today?