21

I'm wondering if there are any completely event-drive frameworks out there for PHP which are based around dependency injection for decoupling. I know there are some frameworks that make use of these patterns - but in the end the entire life-cycle of the application is still pre-defined and linear in style.

For example, most frameworks are built to receive, process, and return results from HTTP requests. An event drive framework would have handlers for that, but also be able to be used for new purposes like background processing, command line interaction, or other non-standard use cases.

1
  • 4
    What do you mean with event driven? Like NodeJS, Twisted or EventMachine? Since PHP executes per request it will always be kind of linear. And I wouldn't want to have programs with not pre-defined behaviour. Commented Jan 13, 2012 at 20:05

9 Answers 9

14

It sounds to me like the Photon framework fits closest to your description - the key point is that you can't have event-driven code without php running in a daemon-like process. Your choice of webserver in fact dictates whether what you ask is possible or not - photon is dependent on mongrel2.

Sign up to request clarification or add additional context in comments.

Comments

9
+50

I have never used it for a project personally, but I believe that Prado covers what you are asking. It is componentised, but I cannot be sure about the dependency injection aspect.

From their site:

PRADOTM is a component-based and event-driven programming framework for developing Web applications in PHP 5. PRADO stands for PHP Rapid Application Development Object-oriented.

I know of it because one of my university class mates designed the logo and website for the project.

1 Comment

Prado website is not working but this works github.com/pradosoft/prado
6

Not used it, but I believe in addition to Prado, which Treffynnon has mentioned, Qcodo is a pure event-driven framework.

1 Comment

Good memory! I had it in my mind it was Qdoco rather than Qcodo and couldn't find it when mentioning Prado below!
1

I was looking what is around as well and i came across p4e which is based on zend framework,and nette, hope it can help!

Comments

0

Off the bat there are these 2 as well:
Zend Framework 2 (still in beta)
symfony 2

Both have all the things you are looking for I believe.

2 Comments

Are you sure that zf2 is event driven?
Not in the classical low-level sense like nginx or anything using an event-loop to underpin language execution. However in userland, ZF2 modules/classes etc are designed to able to work in an event driven fashion with each other, which is what I think the OP is after.
0

Symfony2. Simple as that. http://symfony.com/

Comments

0

Yii ,It is a component based and event-driven framework, Pure OOP and MVC. It is very clean and neat. Check it out.

http://www.yiiframework.com

Comments

0

The Qbix Platform is heavily event-driven in PHP, although it does not use dependency injection.

Comments

0

Reactphp is what you are looking for.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.