PHP code example of application-manager-tools / am-driver

1. Go to this page and download the library: Download application-manager-tools/am-driver 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/ */

    

application-manager-tools / am-driver example snippets


// config/bundles.php
ApplicationManagerTools\AmDriver\Bridge\Symfony\AmDriverBundle::class => ['all' => true],

use ApplicationManagerTools\AmDriver\Core\Contract\CreateInstanceHandlerInterface;
use ApplicationManagerTools\AmDriver\Core\Dto\CreateInstanceHandlerResult;
use ApplicationManagerTools\AmDriver\Core\Dto\OrchestrationCommand;

final class MyCreateInstanceHandler implements CreateInstanceHandlerInterface
{
    public function handle(OrchestrationCommand $command): CreateInstanceHandlerResult
    {
        // provision tenant / DB / storage
        return new CreateInstanceHandlerResult('https://tenant.example/login');
    }
}

$publisher->pushResourceConsumption($tenantId, 'proof_storage_mo');
bash
./install          # composer install + répertoires var/
./build            # image PHP (optionnel si BUILD_WHEN_INSTALL=true dans .env.local)
./bin/php -v
./bin/composer install
./bin/phpunit
./codecheck        # php-cs-fixer + phpstan + phpunit
bash
docker compose run --rm -p ${RECEPTACLE_PORT:-18099}:8099 php \
  php bin/am-driver serve --host=0.0.0.0 --port=8099 --data-dir=var/am-driver/receptacle