Skip to content

u/igorw

In this archive from Jun 2012 to Dec 2014

8
posts
116
comments
0
media
553
score

Top posts

Top comments

Full disclosure: I co-created silex.

I don't really get the fear from installing 4 symfony components. Sure, I would mind 10 or 20 needless dependencies. But 4 of them, really? And if you look at what they do, then they actually make a lot of sense:

  • routing: core routing logic
  • http-foundation: sensible http interface
  • event-dispatcher: core event logic (you wanted before/after, didn't you?)
  • http-kernel: request lifecycle, routing (via event listener), actual before/after events
  • silex: ties the parts together and provides a nice API

If you're still not convinced that they are lightweight and harmless, I suggest you take only the routing component and build your own framework with it.

Part 4 of Fabien's "Create your own framework" series should give you a good starting point.

29 points

I can't speak for ZF2, but this is a very common misconception about Symfony2. Likely that is because the docs are lacking in that area. I have discussed this with Ryan, and hopefully it will be improved.

While Symfony2 does allow the container to be injected and used as a service locator, this is not required. Instead of extending the optional base controller, you can simply have a controller that is an orphan (no parent class) and then define that controller as a service.

See also:

I would assume that ZF2 allows for something similar.

Now, as to why there is a service locator based base controller to begin with, that is mostly to make the framework approachable at all for newcomers. Learning about DI and containers before you can even display a "hello world" page is a bit much to ask and will likely scare people off. By having a less pure base controller, you can get started more easily, and switch to cleaner, more advanced practices once you're comfortable with them.

24 points

A lot of VMs these days use a JIT (just-in-time compiler) that will actually compile the language opcodes to machine code. The JVM that runs Java is most notable for this, and it is also what V8 (used by chrome and node.js) and HHVM (the new PHP runtime from facebook) do. It is very performant and also compiles rather quickly.

14 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.