SlideShare une entreprise Scribd logo
1  sur  86
Télécharger pour lire hors ligne
martes 25 de junio de 13
Who am I
martes 25 de junio de 13
I was born in Córdoba
I work in London
Javier López
martes 25 de junio de 13
I’ve worked
IPC Media y Sensio Labs UK
I work at
TimeOut
I organize
deSymfony
martes 25 de junio de 13
Reasons to upgrade
to Symfony 2.3
martes 25 de junio de 13
#1
Stable for products and
companies
martes 25 de junio de 13
2012 2013 2014 2015 2016 2017
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7
Stabilisation
Maintenance
Development
martes 25 de junio de 13
2012 2013 2014 2015 2016 2017
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7
Estabilización
Mantenimiento
Desarrollo
First LTS of the 2.x era
martes 25 de junio de 13
2012 2013 2014 2015 2016 2017
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7
Estabilización
Mantenimiento
Desarrollo
Backwards compatibility
First LTS of the 2.x era
martes 25 de junio de 13
#2
Less coupled architecture
martes 25 de junio de 13
BrowserKit
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel
Process
Security Serializer Templating
Translation Validator
Yaml
22 components2.0
martes 25 de junio de 13
BrowserKit
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel
OptionsResolver Process
Security Serializer Templating
Translation Validator
Yaml
23 components2.12.0
martes 25 de junio de 13
BrowserKit
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel
OptionsResolver Process PropertyAccess
Security Serializer Stopwatch Templating
Translation Validator
Yaml
25 components2.22.12.0
martes 25 de junio de 13
BrowserKit
Debug
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel Intl
OptionsResolver Process PropertyAccess
Security Serializer Stopwatch Templating
Translation Validator
Yaml
2.3 27 components2.22.12.0
martes 25 de junio de 13
#3
More documentation
martes 25 de junio de 13
2.0
20
109
51
Book
Cookbook
2.1
20
118
58
Components
20
120
63
2.2
20
123
68
2.3
# pages
martes 25 de junio de 13
#4
Easier to debug
martes 25 de junio de 13
More levels of verbosity
$ php app/console foo --verbose=1 # -v
$ php app/console foo --verbose=2 # -vv
$ php app/console foo --verbose=3 # -vvv
martes 25 de junio de 13
class MyCommand extends Command
{
protected function execute($input, $output)
{
$verbosity = $output->getVerbosity();
if ($verbosity === OutputInterface::VERBOSITY_VERBOSE)
{
$output->writeln("Information");
}
if ($verbosity === OutputInterface::VERBOSITY_VERY_VERBOSE)
{
$output->writeln("More information");
}
if ($verbosity === OutputInterface::VERBOSITY_DEBUG)
{
$output->writeln("Even more information");
}
}
martes 25 de junio de 13
configuration parameters
$ console container:debug --parameters
$ console container:debug --parameter=kernel.debug
martes 25 de junio de 13
stack trace en plain text
martes 25 de junio de 13
more information in router:match
$ php app/console router:match /demo/hello/fabien
Route "_demo_hello" matches
[router] Route "_demo_hello"
Name _demo_hello
Path /demo/hello/{name}
Host ANY
Scheme ANY
Method ANY
Class SymfonyComponentRoutingRoute
Defaults _controller: AcmeDemoBundleController
DemoController::helloAction
Requirements NO CUSTOM
Options compiler_class: SymfonyComponentRoutingRouteCompiler
Path-Regex #^/demo/hello/(?P<name>[^/]++)$#s
martes 25 de junio de 13
Debug component
martes 25 de junio de 13
echo $foo
martes 25 de junio de 13
Notice: Undefined variable: foo in
index.php on line 1
martes 25 de junio de 13
use SymfonyComponentDebugDebug;
Debug::$enable();
echo $foo;
martes 25 de junio de 13
PHP Fatal error: Uncaught exception 'SymfonyComponentDebug
ExceptionContextErrorException' with message 'Notice: Undefined
variable: foo in index.php line 9' in index.php:9
Stack trace:
#0 index.php(9): SymfonyComponentDebugErrorHandler->handle(8,
'Undefined varia...', '/Users/loalf/Pr...', 9, Array)
#1 {main}
thrown in index.php on line 9
martes 25 de junio de 13
martes 25 de junio de 13
#5
A mightier console
martes 25 de junio de 13
Events
martes 25 de junio de 13
martes 25 de junio de 13
$ php app/console fooCommand
martes 25 de junio de 13
console.command
$ php app/console fooCommand
martes 25 de junio de 13
console.command
$ php app/console fooCommand
fooCommand::run()
martes 25 de junio de 13
console.command
$ php app/console fooCommand
fooCommand::run()
console.exception
martes 25 de junio de 13
console.command
$ php app/console fooCommand
fooCommand::run()
console.terminate
console.exception
martes 25 de junio de 13
martes 25 de junio de 13
Listener.php
martes 25 de junio de 13
namespace AcmeDemoBundle;
class Listener
{
public function onCommand($event)
{
// your code
}
}
Listener.php
martes 25 de junio de 13
namespace AcmeDemoBundle;
class Listener
{
public function onCommand($event)
{
// your code
}
}
Listener.php
martes 25 de junio de 13
parameters.yml
namespace AcmeDemoBundle;
class Listener
{
public function onCommand($event)
{
// your code
}
}
Listener.php
martes 25 de junio de 13
services:
acme.console.listener:
class: AcmeDemoBundleListener
tags:
-
name: kernel.event_listener
event: console.command
method: onCommand
parameters.yml
namespace AcmeDemoBundle;
class Listener
{
public function onCommand($event)
{
// your code
}
}
Listener.php
martes 25 de junio de 13
tables
martes 25 de junio de 13
+---------------+--------------------------+------------------+
| ISBN | Title | Author |
+---------------+--------------------------+------------------+
| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
+---------------+--------------------------+------------------+
martes 25 de junio de 13
$table = $app->getHelperSet()->get('table');
$table
->setHeaders(array('ISBN', 'Title', 'Author'))
->setRows(array(
array('99921-58-10-7', 'Divine Comedy', 'Dante ...'),
array('9971-5-0210-0', 'A Tale of Two Cities', '...'),
array('960-425-059-0', 'The Lord of the Rings', '...'),
array('80-902734-1-6', 'And Then There Were None', '...'),
))
;
$table->render($output);
martes 25 de junio de 13
=============== ========================== ==================
ISBN Title Author
=============== ========================== ==================
99921-58-10-7 Divine Comedy Dante Alighieri
9971-5-0210-0 A Tale of Two Cities Charles Dickens
960-425-059-0 The Lord of the Rings J. R. R. Tolkien
80-902734-1-6 And Then There Were None Agatha Christie
=============== ========================== ==================
martes 25 de junio de 13
$table = $app->getHelperSet()->get('table');
$table
->setHeaders(array('ISBN', 'Title', 'Author'))
->setLayout(TableHelper::LAYOUT_BORDERLESS)
->setRows(array(
array('99921-58-10-7', 'Divine Comedy', 'Dante ...'),
array('9971-5-0210-0', 'A Tale of Two Cities', '...'),
array('960-425-059-0', 'The Lord of the Rings', '...'),
array('80-902734-1-6', 'And Then There Were None', '...'),
))
;
$table->render($output);
->setLayout(TableHelper::LAYOUT_BORDERLESS)
martes 25 de junio de 13
|···············|··························|··················|
| ISBN | Title | Author |
|···············|··························|··················|
| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
|···············|··························|··················|
martes 25 de junio de 13
$table = $this->getHelperSet()->get('table');
$table
->setHorizontalBorderChar("·")
->setCrossingChar(
"<fg=white;bg=red>|</fg=white;bg=red>"
)
->setVerticalBorderChar(
"<fg=white;bg=red>|</fg=white;bg=red>"
)
;
martes 25 de junio de 13
#6
Better performance
martes 25 de junio de 13
class HeavyService
{
public function __construct() { sleep(10); }
public function doFoo() { echo “foo”; }
}
martes 25 de junio de 13
class LightService
{
public function __construct($service)
{
$this->service = $service;
}
public function doFoo() {
$this->service->doFoo();
}
public function doBar() { echo “bar”; }
}
martes 25 de junio de 13
services:
acme.demo.heavy_service:
class: AcmeDemoBundleHeavyService
acme.demo.light_service:
class: AcmeDemoBundleLightService
arguments: [@acme.demo.heavy_service]
martes 25 de junio de 13
class DemoController extends Controller
{
$ls = $this->get(‘acme.demo.light_service’);
$ls->doBar();
}
martes 25 de junio de 13
class DemoController extends Controller
{
$ls = $this->get(‘acme.demo.light_service’);
$ls->doBar();
}
10220ms
martes 25 de junio de 13
services:
acme.demo.heavy_service:
class: AcmeDemoBundleHeavyService
lazy: true
acme.demo.light_service:
class: AcmeDemoBundleLightService
arguments: [@acme.demo.heavy_service]
martes 25 de junio de 13
class DemoController extends Controller
{
$ls = $this->get(‘acme.demo.light_service’);
$ls->doBar();
}
martes 25 de junio de 13
220ms
class DemoController extends Controller
{
$ls = $this->get(‘acme.demo.light_service’);
$ls->doBar();
}
martes 25 de junio de 13
class DemoController extends Controller
{
$ls = $this->get(‘acme.demo.light_service’);
$ls->doFoo();
}
martes 25 de junio de 13
10220ms
class DemoController extends Controller
{
$ls = $this->get(‘acme.demo.light_service’);
$ls->doFoo();
}
martes 25 de junio de 13
composer require ocramius/proxy-manager
martes 25 de junio de 13
#7
More validators
martes 25 de junio de 13
•Currency
•IBAN - International Bank Account Number
Banking
martes 25 de junio de 13
• ISBN - International Standard Book Number
•ISSN - International Standard Serial Number
Publications
martes 25 de junio de 13
•EqualTo
•NotEqualTo
•IdenticalTo
•NotIdenticalTo
Comparison
•LessThan
•LessThanOrEqual
•GreaterThan
•GreaterThanOrEqual
martes 25 de junio de 13
#8
More HTML5 compliant
martes 25 de junio de 13
Message
Name
Surname
Email
Burritos web
Andele. Contactanos.
send
martes 25 de junio de 13
Message
Name
Surname
Email
Burritos web
Andele. Contactanos.
send
<textarea form=my_form>
martes 25 de junio de 13
$form = $crawler->selectButton('send')
->getForm();
$values = $form->getValues();
$keys = array_keys($values)
2.3<sf
martes 25 de junio de 13
$form = $crawler->selectButton('send')
->getForm();
$values = $form->getValues();
$keys = array_keys($values)
2.3<sf
#'name', 'surname', 'email'
martes 25 de junio de 13
$form = $crawler->selectButton('send')
->getForm();
$values = $form->getValues();
$keys = array_keys($values)
2.3=sf
martes 25 de junio de 13
$form = $crawler->selectButton('send')
->getForm();
$values = $form->getValues();
$keys = array_keys($values)
2.3=sf
#'name', 'surname', 'email', 'message'
martes 25 de junio de 13
#9
Easier to use
martes 25 de junio de 13
parameters.yml generation
martes 25 de junio de 13
> composer install
Generating autoload files
Creating the "app/config/parameters.yml" file.
Some parameters are missing. Please provide them.
database_driver (pdo_mysql):
database_host (127.0.0.1):
database_port (null):
database_name (symfony):
database_user (root):
database_password (null):
mailer_transport (smtp):
mailer_host (127.0.0.1):
mailer_user (null):
mailer_password (null):
locale (en):
secret (ThisTokenIsNotSoSecretChangeIt):
martes 25 de junio de 13
#*
And even more things
martes 25 de junio de 13
What we will see in
Symfony 2.4
martes 25 de junio de 13
Besides the few pull requests that
already target 2.4, I have one topic
that I want us to work on for 2.4:
**performance**
martes 25 de junio de 13
https://groups.google.com/forum/#!topic/symfony-devs/
rwN1gwuHEC4
martes 25 de junio de 13
martes 25 de junio de 13
AdminBundle
martes 25 de junio de 13
Cache
AdminBundle
martes 25 de junio de 13
Cache
RAD
AdminBundle
martes 25 de junio de 13
Cache
RADREST
AdminBundle
martes 25 de junio de 13
KEEP
CALM
AND
UPGRADE
SYMFONY
martes 25 de junio de 13
Thanks. Questions?
FYI, TimeOut is recruiting
http://joind.in/talk/view/8853
@loalf
martes 25 de junio de 13

Contenu connexe

En vedette

Workshop 1 2013 slkf workshop bijgewerkt
Workshop 1 2013 slkf workshop bijgewerktWorkshop 1 2013 slkf workshop bijgewerkt
Workshop 1 2013 slkf workshop bijgewerkt
Jacqueline Neijenhuis
 
Animations
AnimationsAnimations
Animations
guru090
 

En vedette (7)

PHP's FIG and PSRs
PHP's FIG and PSRsPHP's FIG and PSRs
PHP's FIG and PSRs
 
Workshop 1 2013 slkf workshop bijgewerkt
Workshop 1 2013 slkf workshop bijgewerktWorkshop 1 2013 slkf workshop bijgewerkt
Workshop 1 2013 slkf workshop bijgewerkt
 
Animations
AnimationsAnimations
Animations
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
 
Psr-7
Psr-7Psr-7
Psr-7
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
 

Similaire à Slides changes symfony23

Distributed Data Structures
Distributed Data StructuresDistributed Data Structures
Distributed Data Structures
PDX Web & Design
 
Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)
Sam Livingston-Gray
 
Deprecating ActiveRecord Attributes without making Zombies
Deprecating ActiveRecord Attributes without making ZombiesDeprecating ActiveRecord Attributes without making Zombies
Deprecating ActiveRecord Attributes without making Zombies
yann ARMAND
 

Similaire à Slides changes symfony23 (20)

Innovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringInnovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and Monitoring
 
JavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java DevelopersJavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java Developers
 
Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013
 
And the Greatest of These Is ... Space
And the Greatest of These Is ... SpaceAnd the Greatest of These Is ... Space
And the Greatest of These Is ... Space
 
Distributed Data Structures
Distributed Data StructuresDistributed Data Structures
Distributed Data Structures
 
Ten Groovy Little JavaScript Tips
Ten Groovy Little JavaScript TipsTen Groovy Little JavaScript Tips
Ten Groovy Little JavaScript Tips
 
Vagrant
VagrantVagrant
Vagrant
 
Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)
 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with Siesta
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2
 
Automate Your FME Server Installs, Take a Five Minute Break
Automate Your FME Server Installs, Take a Five Minute BreakAutomate Your FME Server Installs, Take a Five Minute Break
Automate Your FME Server Installs, Take a Five Minute Break
 
Getting Started with Puppet on Windows PuppetConf 2014
Getting Started with Puppet on Windows PuppetConf 2014Getting Started with Puppet on Windows PuppetConf 2014
Getting Started with Puppet on Windows PuppetConf 2014
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
A Big Look at MiniTest
A Big Look at MiniTestA Big Look at MiniTest
A Big Look at MiniTest
 
Buenos Aires Drools Expert Presentation
Buenos Aires Drools Expert PresentationBuenos Aires Drools Expert Presentation
Buenos Aires Drools Expert Presentation
 
Deprecating ActiveRecord Attributes without making Zombies
Deprecating ActiveRecord Attributes without making ZombiesDeprecating ActiveRecord Attributes without making Zombies
Deprecating ActiveRecord Attributes without making Zombies
 
Getting Started with Puppet on Windows - PuppetConf 2014
Getting Started with Puppet on Windows - PuppetConf 2014Getting Started with Puppet on Windows - PuppetConf 2014
Getting Started with Puppet on Windows - PuppetConf 2014
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Continuous Delivery for the Web Platform
Continuous Delivery for the Web PlatformContinuous Delivery for the Web Platform
Continuous Delivery for the Web Platform
 

Plus de Javier López (6)

Novedades en Symfony 2.3
Novedades en Symfony 2.3Novedades en Symfony 2.3
Novedades en Symfony 2.3
 
Shifting gears with Composer
Shifting gears with ComposerShifting gears with Composer
Shifting gears with Composer
 
Componentes, el arma secreta de Symfony2
Componentes, el arma secreta de Symfony2Componentes, el arma secreta de Symfony2
Componentes, el arma secreta de Symfony2
 
Slides components en
Slides components enSlides components en
Slides components en
 
Slides componentes
Slides componentesSlides componentes
Slides componentes
 
Symfony y Admin Generator
Symfony y Admin GeneratorSymfony y Admin Generator
Symfony y Admin Generator
 

Slides changes symfony23