SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Zend Framework 3 
jeudi 16 janvier 14
Why a new version ? 
* PHP5.4 (performance, traits, callable type, etc.) 
* Improve the documentation 
* Improve performance 
* Improve maintainability and code design 
* Because the contributors are being bored 
jeudi 16 janvier 14
When ? 
* Nobody knows 
* But a lot of PR in progress ! 
* A lot of ideas proposed 
* Don’t repeat the same mess with the second 
version ... 
jeudi 16 janvier 14
Booooooo 
jeudi 16 janvier 14
What about components ? 
* New service locator implementation : lighter, maybe 
a compiled version ? Removal of the peering and 
abstract factories (I hope ...) 
* New event manager implementation : lighter and 
faster 
* New validators and input filter : stateless and faster 
jeudi 16 janvier 14
What else ? 
* Hydrator with their own namespace 
* Improve the code generation with the console 
* Components with few activities will move 
* Better normalization ... 
jeudi 16 janvier 14
Better normalization ... 
Zend Framework services name : 
array( 
'my_factory' 
=> 
'MyFactory', 
'my.factory' 
=> 
'MyFactory', 
'MyFactory' 
=> 
'MyFactory', 
); 
ZF3 will use probably FQCN (Fully Qualified Class 
Name) 
* Each interfaces should be finished by ‘Interface’ 
* Each module should be finished by ‘Module’ 
* Each config key should use underscores 
jeudi 16 janvier 14
Other ideas 
* Routing by annotation 
* Composer autoloader usage 
* Doctrine instead of ZendDb 
* Modularize ZF2 (Symfony style) 
* Get route parameters inside actions controllers 
jeudi 16 janvier 14
* Get route parameters inside actions controllers 
Currently : 
$this-­‐>getEvent()-­‐>getRouteMatch()-­‐>getParam('id'); 
$this-­‐>params()-­‐>fromRoute('id'); 
$this-­‐>params('id'); 
With parameters inside : 
public 
function 
editUser($id) 
Or with transformers : 
public 
function 
editUser(User 
$user) 
jeudi 16 janvier 14
Is it awesome ? 
YES ! otherwise I won’t be there ... AND : 
* Less code and more developer friendly 
* More good practice (less magical), with your 
controllers and your modules ! 
jeudi 16 janvier 14
Forget : 
class 
Module 
{ 
public 
function 
getConfig() 
{ 
return 
include 
__DIR__ 
. 
‘/config/module.config.php’; 
} 
} 
Use this : 
class 
Module 
implements 
ConfigProviderInterface 
{ 
public 
function 
getConfig() 
{ 
return 
include 
__DIR__ 
. 
‘/config/module.config.php’; 
} 
} 
* And maybe some components written in Zephir ! 
jeudi 16 janvier 14
Zephir ? 
Zephir can be seen as a hybrid language that allows to 
write code that looks like PHP, but is compiled to native 
C code, which allows to create an extension from it, 
and having a very efficient code. 
public function trigger(string event) 
{ 
var callable, listeners; 
let listeners = this->listeners; 
if array_key_exists(event, listeners) { 
let callable = listeners[event]; 
return call_user_func(callable); 
} 
} 
http://www.michaelgallego.fr/blog/2013/08/28/a-quick-introduction-to-zephir-language/ 
jeudi 16 janvier 14
Zephir ? 
* Write your code 
* Compile your code 
* Execute your code 
$eventManager = new TestEventManager(); 
$eventManager->attach('myEvent', function() { 
echo 'Okey!'; 
}); 
$eventManager->trigger('myEvent'); // outputs "Okey!" 
PHP_METHOD(Test_EventManager, trigger) { 
zval *event_param = NULL, *callable, *listeners, _0 = zval_used_for_init, *_1; 
zephir_str *event = NULL; 
ZEPHIR_MM_GROW(); 
zephir_fetch_params(1, 1, 0, &event_param); 
[...] 
http://www.michaelgallego.fr/blog/2013/08/28/a-quick-introduction-to-zephir-language/ 
jeudi 16 janvier 14
The great debates 
Migration : 
* Easier than ZF1 -> ZF2 : concept will be close, the 
major changes will concern the internal code 
* Maybe a gateway to migrate easily 
* But there will be some code to re-written 
jeudi 16 janvier 14
The great debates 
Don’t do anything with the service locator ... 
In a perfect world, you will never use your service 
locator in a controller or in a library ... 
Maybe ZF2 will remove ServiceLocatorAwareInterface 
and set all your dependences ! 
jeudi 16 janvier 14
The great debates 
But, what about memory ? 
My controller has 5 actions which use more than 8 
resources ... Why I need to set up 6 or 7 resources for 
nothing ? 
Help me please ! 
jeudi 16 janvier 14
The great debates 
No worries, you are in Australia ! 
ProxyManager is here for you ! Change nothing ! 
* Define your getter and setter in your controller 
* Don’t use the Service Locator in your controller ! 
* Define your controller factory 
* Use the ProxyManager to have lazy loading 
jeudi 16 janvier 14
class 
MemberController 
extends 
AbstractActionController 
{ 
protected 
$loginForm; 
public 
function 
loginAction() 
{ 
$form 
= 
$this-­‐>getLoginForm(); 
// 
... 
your 
action 
here 
} 
public 
function 
setLoginForm(LoginForm$loginForm) 
{ 
$this-­‐>loginForm 
= 
$loginForm; 
} 
public 
function 
getLoginForm() 
{ 
if 
(null 
=== 
$this-­‐>loginForm) 
{ 
throw 
new 
LogicException('Login 
form 
must 
be 
defined'); 
} 
return 
$this-­‐>loginForm; 
} 
} 
jeudi 16 janvier 14
class 
MemberControllerFactory 
implements 
FactoryInterface 
{ 
public 
function 
createService(ServiceLocatorInterface 
$sm) 
{ 
$factory 
= 
new 
LazyLoadingGhostFactory(); 
$proxy 
= 
$factory-­‐>createProxy( 
'MemberManagerControllerMemberController', 
function($proxy, 
$method, 
$parameters, 
&$initializer) 
use 
($sm) 
{ 
if 
($method 
== 
'getLoginForm') 
{ 
$proxy-­‐>setLoginForm( 
$sm-­‐>get('MemberManagerFormLogin') 
); 
} 
} 
); 
return 
$proxy; 
} 
} 
Lazy loading with the proxy manager : 
jeudi 16 janvier 14
The great debates 
What are the advantages ? 
Your application is more decoupled and ... 
* It’s Really REALLY easier to write your tests ! 
* No dependence with a service locator ! 
jeudi 16 janvier 14
jeudi 16 janvier 14
New validators 
Currently : 
$validator 
= 
new 
Boolean(); 
if 
(!$validator-­‐>isValid(true)) 
{ 
$error 
= 
$validator-­‐>getErrorMessages(); 
} 
Make the validator stateless : 
$validator 
= 
new 
Boolean(); 
$validationResult 
= 
$validator-­‐>validate($value); 
if 
($validationResult-­‐>isValid()) 
{ 
$error 
= 
$validationResult-­‐>getErrorMessages(); 
} 
jeudi 16 janvier 14
New router 
No route type, 5x faster : 
array( 
'path' 
=> 
'/foo', 
'action' 
=> 
'bar', 
'controller' 
=> 
'FooController', 
'methods' 
=> 
array('get', 
'post') 
); 
Easily configurable : 
array( 
'path' 
=> 
'/foo', 
'action' 
=> 
'bar', 
'controller' 
=> 
'FooController', 
'hostname' 
=> 
'login.example.com'], 
'secure' 
=> 
true 
); 
jeudi 16 janvier 14
EventManager proposals 
* 3 proposals : 
1/ use callable type hinting, faster 
2/ Listener and EventManager are merged 
3/ a simple rewrite, 6x faster 
jeudi 16 janvier 14
So, is ZF the good choice ? 
YES, but ... 
ALWAYS keep an eye on native C framework, like 
Phalcon, or more structured and code oriented 
company and framework like Symfony ! 
And don’t forget, ZF has awesome contributors (Marco 
Pivetta, Evan Coury, O'Phinney, M. Gallego, etc) and still 
probably the faster (and the biggest) MVC framework ! 
jeudi 16 janvier 14
Best plan for 4mation ? 
* Get the ZF2 certification 
* Read every week some PR on the zend framework 
repository -- best way to stay tuned 
* Add your modules on Github and contribute to most 
popular modules -- best way to become popular among 
the ZF developer and improve the company skills 
jeudi 16 janvier 14
Questions ? 
jeudi 16 janvier 14

Contenu connexe

Tendances

Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Puppet
 
Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP GeneratorsMark Baker
 
Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Oleg Zinchenko
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsMark Baker
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)julien pauli
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?Ravi Raj
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPGuilherme Blanco
 
Александр Трищенко: PHP 7 Evolution
Александр Трищенко: PHP 7 EvolutionАлександр Трищенко: PHP 7 Evolution
Александр Трищенко: PHP 7 EvolutionOleg Poludnenko
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...it-people
 

Tendances (20)

New in php 7
New in php 7New in php 7
New in php 7
 
Mojo as a_client
Mojo as a_clientMojo as a_client
Mojo as a_client
 
Php 5.6
Php 5.6Php 5.6
Php 5.6
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014
 
Slide
SlideSlide
Slide
 
Modern PHP
Modern PHPModern PHP
Modern PHP
 
Zero to SOLID
Zero to SOLIDZero to SOLID
Zero to SOLID
 
Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP Generators
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6
 
Oro meetup #4
Oro meetup #4Oro meetup #4
Oro meetup #4
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
 
PHP7 Presentation
PHP7 PresentationPHP7 Presentation
PHP7 Presentation
 
Александр Трищенко: PHP 7 Evolution
Александр Трищенко: PHP 7 EvolutionАлександр Трищенко: PHP 7 Evolution
Александр Трищенко: PHP 7 Evolution
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...
 

En vedette

code.talks2014: Zend Framework 3 - Viva la evolución!
code.talks2014: Zend Framework 3 - Viva la evolución!code.talks2014: Zend Framework 3 - Viva la evolución!
code.talks2014: Zend Framework 3 - Viva la evolución!Ralf Eggert
 
Zend framework 3 Hangout 2016
Zend framework 3 Hangout 2016Zend framework 3 Hangout 2016
Zend framework 3 Hangout 2016Flávio Lisboa
 
RESTful modules in zf2
RESTful modules in zf2RESTful modules in zf2
RESTful modules in zf2Corley S.r.l.
 
O que esperar do Zend Framework 3
O que esperar do Zend Framework 3O que esperar do Zend Framework 3
O que esperar do Zend Framework 3Flávio Lisboa
 
Intro to Angular.js & Zend2 for Front-End Web Applications
Intro to Angular.js & Zend2  for Front-End Web ApplicationsIntro to Angular.js & Zend2  for Front-End Web Applications
Intro to Angular.js & Zend2 for Front-End Web ApplicationsTECKpert, Hubdin
 
IPC14: Zend Framework 3 - Viva la evolución!
IPC14: Zend Framework 3 - Viva la evolución! IPC14: Zend Framework 3 - Viva la evolución!
IPC14: Zend Framework 3 - Viva la evolución! Ralf Eggert
 
Unit Testing einer Zend-Framework 2 Anwendung
Unit Testing einer Zend-Framework 2 AnwendungUnit Testing einer Zend-Framework 2 Anwendung
Unit Testing einer Zend-Framework 2 AnwendungRalf Eggert
 
Zend Framework 3 - porque só o que existe pode ser aprimorado
Zend Framework 3 - porque só o que existe pode ser aprimoradoZend Framework 3 - porque só o que existe pode ser aprimorado
Zend Framework 3 - porque só o que existe pode ser aprimoradoFlávio Lisboa
 
Scaling Techniques to Increase Magento Capacity
Scaling Techniques to Increase Magento CapacityScaling Techniques to Increase Magento Capacity
Scaling Techniques to Increase Magento CapacityClustrix
 
Magento 2 Frontend le novità - Meet Magento 2015
Magento 2 Frontend le novità - Meet Magento 2015Magento 2 Frontend le novità - Meet Magento 2015
Magento 2 Frontend le novità - Meet Magento 2015Andrea Saccà
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!Muhammad Ghazali
 
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Fwdays
 
PHP framework or CMS -Which one is best for website ?
PHP framework or CMS -Which one is best for website ? PHP framework or CMS -Which one is best for website ?
PHP framework or CMS -Which one is best for website ? WebConnect Pvt Ltd
 

En vedette (14)

code.talks2014: Zend Framework 3 - Viva la evolución!
code.talks2014: Zend Framework 3 - Viva la evolución!code.talks2014: Zend Framework 3 - Viva la evolución!
code.talks2014: Zend Framework 3 - Viva la evolución!
 
Zend framework 3 Hangout 2016
Zend framework 3 Hangout 2016Zend framework 3 Hangout 2016
Zend framework 3 Hangout 2016
 
RESTful modules in zf2
RESTful modules in zf2RESTful modules in zf2
RESTful modules in zf2
 
O que esperar do Zend Framework 3
O que esperar do Zend Framework 3O que esperar do Zend Framework 3
O que esperar do Zend Framework 3
 
Intro to Angular.js & Zend2 for Front-End Web Applications
Intro to Angular.js & Zend2  for Front-End Web ApplicationsIntro to Angular.js & Zend2  for Front-End Web Applications
Intro to Angular.js & Zend2 for Front-End Web Applications
 
IPC14: Zend Framework 3 - Viva la evolución!
IPC14: Zend Framework 3 - Viva la evolución! IPC14: Zend Framework 3 - Viva la evolución!
IPC14: Zend Framework 3 - Viva la evolución!
 
Unit Testing einer Zend-Framework 2 Anwendung
Unit Testing einer Zend-Framework 2 AnwendungUnit Testing einer Zend-Framework 2 Anwendung
Unit Testing einer Zend-Framework 2 Anwendung
 
Zend Framework 3 - porque só o que existe pode ser aprimorado
Zend Framework 3 - porque só o que existe pode ser aprimoradoZend Framework 3 - porque só o que existe pode ser aprimorado
Zend Framework 3 - porque só o que existe pode ser aprimorado
 
Scaling Techniques to Increase Magento Capacity
Scaling Techniques to Increase Magento CapacityScaling Techniques to Increase Magento Capacity
Scaling Techniques to Increase Magento Capacity
 
Magento 2 Frontend le novità - Meet Magento 2015
Magento 2 Frontend le novità - Meet Magento 2015Magento 2 Frontend le novità - Meet Magento 2015
Magento 2 Frontend le novità - Meet Magento 2015
 
Get Started ZF3
Get Started ZF3Get Started ZF3
Get Started ZF3
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!
 
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
 
PHP framework or CMS -Which one is best for website ?
PHP framework or CMS -Which one is best for website ? PHP framework or CMS -Which one is best for website ?
PHP framework or CMS -Which one is best for website ?
 

Similaire à ZF3 introduction

Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Lin Yo-An
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Eric Hogue
 
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...NETWAYS
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkJeremy Kendall
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowVrann Tulika
 
RESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroRESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroChristopher Pecoraro
 
Puppet Modules for Fun and Profit
Puppet Modules for Fun and ProfitPuppet Modules for Fun and Profit
Puppet Modules for Fun and ProfitPuppet
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Jacopo Romei
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP pluginsPierre MARTIN
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War StoriesJakub Zalas
 
Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Sumy PHP User Grpoup
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertorToshiaki Baba
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207patter
 

Similaire à ZF3 introduction (20)

Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014
 
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
RESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroRESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher Pecoraro
 
Puppet modules for Fun and Profit
Puppet modules for Fun and ProfitPuppet modules for Fun and Profit
Puppet modules for Fun and Profit
 
Puppet Modules for Fun and Profit
Puppet Modules for Fun and ProfitPuppet Modules for Fun and Profit
Puppet Modules for Fun and Profit
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP plugins
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War Stories
 
Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
agri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertoragri inventory - nouka data collector / yaoya data convertor
agri inventory - nouka data collector / yaoya data convertor
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
DevOps Braga #6
DevOps Braga #6DevOps Braga #6
DevOps Braga #6
 

Dernier

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 

Dernier (20)

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 

ZF3 introduction

  • 1. Zend Framework 3 jeudi 16 janvier 14
  • 2. Why a new version ? * PHP5.4 (performance, traits, callable type, etc.) * Improve the documentation * Improve performance * Improve maintainability and code design * Because the contributors are being bored jeudi 16 janvier 14
  • 3. When ? * Nobody knows * But a lot of PR in progress ! * A lot of ideas proposed * Don’t repeat the same mess with the second version ... jeudi 16 janvier 14
  • 4. Booooooo jeudi 16 janvier 14
  • 5. What about components ? * New service locator implementation : lighter, maybe a compiled version ? Removal of the peering and abstract factories (I hope ...) * New event manager implementation : lighter and faster * New validators and input filter : stateless and faster jeudi 16 janvier 14
  • 6. What else ? * Hydrator with their own namespace * Improve the code generation with the console * Components with few activities will move * Better normalization ... jeudi 16 janvier 14
  • 7. Better normalization ... Zend Framework services name : array( 'my_factory' => 'MyFactory', 'my.factory' => 'MyFactory', 'MyFactory' => 'MyFactory', ); ZF3 will use probably FQCN (Fully Qualified Class Name) * Each interfaces should be finished by ‘Interface’ * Each module should be finished by ‘Module’ * Each config key should use underscores jeudi 16 janvier 14
  • 8. Other ideas * Routing by annotation * Composer autoloader usage * Doctrine instead of ZendDb * Modularize ZF2 (Symfony style) * Get route parameters inside actions controllers jeudi 16 janvier 14
  • 9. * Get route parameters inside actions controllers Currently : $this-­‐>getEvent()-­‐>getRouteMatch()-­‐>getParam('id'); $this-­‐>params()-­‐>fromRoute('id'); $this-­‐>params('id'); With parameters inside : public function editUser($id) Or with transformers : public function editUser(User $user) jeudi 16 janvier 14
  • 10. Is it awesome ? YES ! otherwise I won’t be there ... AND : * Less code and more developer friendly * More good practice (less magical), with your controllers and your modules ! jeudi 16 janvier 14
  • 11. Forget : class Module { public function getConfig() { return include __DIR__ . ‘/config/module.config.php’; } } Use this : class Module implements ConfigProviderInterface { public function getConfig() { return include __DIR__ . ‘/config/module.config.php’; } } * And maybe some components written in Zephir ! jeudi 16 janvier 14
  • 12. Zephir ? Zephir can be seen as a hybrid language that allows to write code that looks like PHP, but is compiled to native C code, which allows to create an extension from it, and having a very efficient code. public function trigger(string event) { var callable, listeners; let listeners = this->listeners; if array_key_exists(event, listeners) { let callable = listeners[event]; return call_user_func(callable); } } http://www.michaelgallego.fr/blog/2013/08/28/a-quick-introduction-to-zephir-language/ jeudi 16 janvier 14
  • 13. Zephir ? * Write your code * Compile your code * Execute your code $eventManager = new TestEventManager(); $eventManager->attach('myEvent', function() { echo 'Okey!'; }); $eventManager->trigger('myEvent'); // outputs "Okey!" PHP_METHOD(Test_EventManager, trigger) { zval *event_param = NULL, *callable, *listeners, _0 = zval_used_for_init, *_1; zephir_str *event = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &event_param); [...] http://www.michaelgallego.fr/blog/2013/08/28/a-quick-introduction-to-zephir-language/ jeudi 16 janvier 14
  • 14. The great debates Migration : * Easier than ZF1 -> ZF2 : concept will be close, the major changes will concern the internal code * Maybe a gateway to migrate easily * But there will be some code to re-written jeudi 16 janvier 14
  • 15. The great debates Don’t do anything with the service locator ... In a perfect world, you will never use your service locator in a controller or in a library ... Maybe ZF2 will remove ServiceLocatorAwareInterface and set all your dependences ! jeudi 16 janvier 14
  • 16. The great debates But, what about memory ? My controller has 5 actions which use more than 8 resources ... Why I need to set up 6 or 7 resources for nothing ? Help me please ! jeudi 16 janvier 14
  • 17. The great debates No worries, you are in Australia ! ProxyManager is here for you ! Change nothing ! * Define your getter and setter in your controller * Don’t use the Service Locator in your controller ! * Define your controller factory * Use the ProxyManager to have lazy loading jeudi 16 janvier 14
  • 18. class MemberController extends AbstractActionController { protected $loginForm; public function loginAction() { $form = $this-­‐>getLoginForm(); // ... your action here } public function setLoginForm(LoginForm$loginForm) { $this-­‐>loginForm = $loginForm; } public function getLoginForm() { if (null === $this-­‐>loginForm) { throw new LogicException('Login form must be defined'); } return $this-­‐>loginForm; } } jeudi 16 janvier 14
  • 19. class MemberControllerFactory implements FactoryInterface { public function createService(ServiceLocatorInterface $sm) { $factory = new LazyLoadingGhostFactory(); $proxy = $factory-­‐>createProxy( 'MemberManagerControllerMemberController', function($proxy, $method, $parameters, &$initializer) use ($sm) { if ($method == 'getLoginForm') { $proxy-­‐>setLoginForm( $sm-­‐>get('MemberManagerFormLogin') ); } } ); return $proxy; } } Lazy loading with the proxy manager : jeudi 16 janvier 14
  • 20. The great debates What are the advantages ? Your application is more decoupled and ... * It’s Really REALLY easier to write your tests ! * No dependence with a service locator ! jeudi 16 janvier 14
  • 22. New validators Currently : $validator = new Boolean(); if (!$validator-­‐>isValid(true)) { $error = $validator-­‐>getErrorMessages(); } Make the validator stateless : $validator = new Boolean(); $validationResult = $validator-­‐>validate($value); if ($validationResult-­‐>isValid()) { $error = $validationResult-­‐>getErrorMessages(); } jeudi 16 janvier 14
  • 23. New router No route type, 5x faster : array( 'path' => '/foo', 'action' => 'bar', 'controller' => 'FooController', 'methods' => array('get', 'post') ); Easily configurable : array( 'path' => '/foo', 'action' => 'bar', 'controller' => 'FooController', 'hostname' => 'login.example.com'], 'secure' => true ); jeudi 16 janvier 14
  • 24. EventManager proposals * 3 proposals : 1/ use callable type hinting, faster 2/ Listener and EventManager are merged 3/ a simple rewrite, 6x faster jeudi 16 janvier 14
  • 25. So, is ZF the good choice ? YES, but ... ALWAYS keep an eye on native C framework, like Phalcon, or more structured and code oriented company and framework like Symfony ! And don’t forget, ZF has awesome contributors (Marco Pivetta, Evan Coury, O'Phinney, M. Gallego, etc) and still probably the faster (and the biggest) MVC framework ! jeudi 16 janvier 14
  • 26. Best plan for 4mation ? * Get the ZF2 certification * Read every week some PR on the zend framework repository -- best way to stay tuned * Add your modules on Github and contribute to most popular modules -- best way to become popular among the ZF developer and improve the company skills jeudi 16 janvier 14
  • 27. Questions ? jeudi 16 janvier 14