Bear Component
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Bear
tests/Bear/Tests
.gitignore
.travis.yml
README.md
composer.json
composer.lock
phpunit.xml

README.md

PHP Bear

Bear PHP Component Project

SensioLabsInsight Build Status Coverage Status Latest Stable Version Total Downloads

Requirements

  • PHP 7.1+

Installation

You can install bear using composer

composer require ahoulgrave/bear

Usage

<?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();

Dependency containers

As first argument, you can provide any PSR-11 Container. Here are some you can use:

Routing adapters

You need at least one routing adapter to run an application