slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.94k stars 1.95k forks source link

Some advices required about writing a wrapper around Slim\App #1924

Closed pyrsmk closed 8 years ago

pyrsmk commented 8 years ago

Hi!

I'm the maintainer of the Lumy framework. For its future, I've decided to drop all the code and replace it by Slim. But since I want to use the Chernozem container with its ArrayAccess writing style, I had the idea to create a wrapper around Slim.

To make it works like a charm, I'll just have a Lumy class, which will extend Chernozem. In the constructor, I'll instantiate Slim, and add Lumy (which extends Chernozem) as the container of Slim. I'll add a __call function to bind all undefined methods to Slim.

But is it enough? I've seen an __invoke method in Slim\App. Do I need to bind it too? And am I missing some other things?

Thanks a lot for your response ;)

geggleto commented 8 years ago

@pyrsmk you need to define the Continer-Interop Interface as well.

Ref: https://github.com/slimphp/Slim/blob/3.x/Slim/Container.php#L47 https://github.com/container-interop/container-interop/blob/master/src/Interop/Container/ContainerInterface.php

pyrsmk commented 8 years ago

It's already the case ^^ See at Chernozem repo ;)