We’re going to implement a set of REST web services in PHP. We’ve selected 2 frameworks to do that: Symfony 2 and Silex (micro-framework as a phar archive, based on Symfony2).
For now, there will be only a few services, with a few resources returned as GET, but the set of method will eventually grow and include other rest actions (put/post/delete).
here is the list of pros and cons I’ve got so far for these 2 frameworks
Symfony2
Pros:
- more powerful
- Doctrine ORM
- can debug with XDebug
- config in YML
- more used in the community
- more support
- autocompletion in IDE
- fast
cons:
- Need FOSBundle to do REST (?) (actually, I’d like to know if this is really useful)
Silex
Pros:
- lightweight
- seems easier to create REST urls (?)
- easier to deploy (phar archive)
Cons:
- no Doctrine ORM
- cannot debug (phar archive)
- no autocompletion in IDE
- config must be hardcoded
- may be a bit slower, as it’s in a phar archive ?
Which one do you think is the best?
Thanks
Personally I really like symfony 2, its easy to create REST urls using the annotations syntax, in your controller you put something like