PHP code example of ucp-php-sdk / symfony-bundle

1. Go to this page and download the library: Download ucp-php-sdk/symfony-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ucp-php-sdk / symfony-bundle example snippets


$container->extension('ucp_sdk', [
    'base_uri' => 'https://merchant.example',
    'allowed_profile_hosts' => ['merchant.example'],
    'allowed_agent_domains' => ['merchant.example'],
    'profile_fetching_development_mode' => false,
    'signature_policy' => 'log',
    'transports' => ['rest', 'a2a', 'embedded'],
    'enabled_capabilities' => [
        'dev.ucp.shopping.catalog',
        'dev.ucp.shopping.cart',
    ],
    'transport_endpoints' => [
        'a2a' => 'https://merchant.example/ucp/a2a',
        'embedded' => 'https://merchant.example/ucp/embedded',
    ],
    'storage' => [
        'dsn' => 'sqlite:///%kernel.project_dir%/var/ucp_sdk.sqlite',
    ],
]);

use Ucp\Sdk\Symfony\Bridge\DoctrineDbal\SchemaBootstrapper;

final readonly class InstallUcpStorage
{
    public function __construct(private SchemaBootstrapper $bootstrapper)
    {
    }

    public function __invoke(): void
    {
        $this->bootstrapper->ensureSchema();
    }
}
bash
composer