10 Years of Zend Framework
- Bound together by an MVC
Evolution of v1
- Dojo, jQuery integration
- Event-driven architecture
- Dependency injection
- First class modules
… at a cost
- Complete break in compatibility.
- Targeting expert developers == less inviting
- Components depend on integration provided by MVC
Framework Interop Group
Every framework abstracts HTTP differently.
Let's standardize that.
Frameworks must change
The job of a framework is to provide plumbing, and get out of your
- Componentization and re-use
- Focus on PSR-7 and middleware
All components are now versioned separately.
(Full story at bit.ly/zf2-split)
Standardized Package Structure
- PSR-4 structure for source and tests.
- Documentation per package
- Standard QA toolchain; per-package continuous integration.
The zendframework package now simply depends on components.
Back to Basics
ZF3 will reduce dependencies
to only what's needed for the MVC.
Use Composer to add what you need.
- Consistent interfaces.
- Performant (4X faster)!
- Mostly backwards compatible!
New method: build
public function build($name, array $options = null)
For when you need a factory; think plugins
public function __invoke(
array $options = null
- 4X–15x performance based on use case!
- BC breaks:
- Removed argument overloading for
- Aggregate attachment is moved to aggregate implementations.
trigger($eventName, $target = null, $argv = );
triggerUntil(callable $callback, $eventName, $target = null, $argv = );
triggerEventUntil(callable $callback, EventInterface $event);
- Updated to changes in zend-servicemanager.
- Updated to changes in zend-eventmanager.
- Essentially stays the same.
- But adds a
Routing to Middleware
'oauth' => [
'type' => 'Literal',
'options' => [
'route' => '/oauth',
'defaults' => [
'middleware' => OAuthMiddleware::class,
Enough with the boring stuff
Time to Reflect
Where is the PHP community headed?
Creating shared interfaces.
Users can target abstractions, not implementations.
HTTP Message Interfaces
Providing a common HTTP abstraction to program against.
function (ServerRequestInterface $request) : ResponseInterface
) : ResponseInterface
) : ResponseInterface
public function has($serviceName);
public function get($serviceName);
Frameworks should be an implementation detail
Frameworks should get out of the way of your code
PSR-7 middleware microframework
- Provides and consumes a routing interface.
- Pulls matched middleware from a
- Provides a templating interface, if you need it.
- Provides error handling, and a way to hook into
Wiring together commodity components.
ZF3 is a Movement
An end to framework silos.