- PHP 7.1+
You can install bear using composer
composer require ahoulgrave/bear
<?php
require 'vendor/autoload.php';
use Bear\App;
use Bear\Routing\SymfonyRoutingAdapter;
use Zend\ServiceManager\ServiceManager;
$config = [
'services' => [
MyController::class => new MyController(),
],
'factories' => [
'routingAdapter' => function () {
$loader = ...;
$resource = ...;
return new SymfonyRoutingAdapter($loader, $resource);
},
],
];
$app = new App(new ServiceManager($config), 'routingAdapter');
$app->run();
As first argument, you can provide any PSR-11 Container. Here are some you can use:
You need at least one routing adapter to run an application