Skip to content

Conversation

@clue
Copy link
Owner

@clue clue commented Jul 1, 2022

This changeset adds support for the PSR-11 container interface by using the DI container as an adapter. This allows using custom DI containers with X for more advanced use cases. This does not otherwise break existing APIs, so this is a pure feature addition.

<?php

require __DIR__ . '/../vendor/autoload.php';

// $builder = new DI\ContainerBuilder();
// $builder->...
// $container = $builder->build();
$container = new DI\Container();

$app = new FrameworkX\App(new FrameworkX\Container($container));

$app->get('/', Acme\Todo\HelloController::class);
$app->get('/users/{name}', Acme\Todo\UserController::class);

$app->run();

Builds on top of #95
Closes #159
Refs #30

@clue clue added the new feature New feature or request label Jul 1, 2022
@clue clue requested a review from SimonFrings July 1, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants