Slides changes symfony23

611 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
611
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Slides changes symfony23

  1. 1. martes 25 de junio de 13
  2. 2. Who am Imartes 25 de junio de 13
  3. 3. I was born in CórdobaI work in LondonJavier Lópezmartes 25 de junio de 13
  4. 4. I’ve workedIPC Media y Sensio Labs UKI work atTimeOutI organizedeSymfonymartes 25 de junio de 13
  5. 5. Reasons to upgradeto Symfony 2.3martes 25 de junio de 13
  6. 6. #1Stable for products andcompaniesmartes 25 de junio de 13
  7. 7. 2012 2013 2014 2015 2016 20172.02.12.22.32.42.52.62.7StabilisationMaintenanceDevelopmentmartes 25 de junio de 13
  8. 8. 2012 2013 2014 2015 2016 20172.02.12.22.32.42.52.62.7EstabilizaciónMantenimientoDesarrolloFirst LTS of the 2.x eramartes 25 de junio de 13
  9. 9. 2012 2013 2014 2015 2016 20172.02.12.22.32.42.52.62.7EstabilizaciónMantenimientoDesarrolloBackwards compatibilityFirst LTS of the 2.x eramartes 25 de junio de 13
  10. 10. #2Less coupled architecturemartes 25 de junio de 13
  11. 11. BrowserKitFinderLocaleRoutingClassLoader Config Console CssSelectorDI DomCrawler EventDispatcher FilesystemForm HttpFoundation HttpKernelProcessSecurity Serializer TemplatingTranslation ValidatorYaml22 components2.0martes 25 de junio de 13
  12. 12. BrowserKitFinderLocaleRoutingClassLoader Config Console CssSelectorDI DomCrawler EventDispatcher FilesystemForm HttpFoundation HttpKernelOptionsResolver ProcessSecurity Serializer TemplatingTranslation ValidatorYaml23 components2.12.0martes 25 de junio de 13
  13. 13. BrowserKitFinderLocaleRoutingClassLoader Config Console CssSelectorDI DomCrawler EventDispatcher FilesystemForm HttpFoundation HttpKernelOptionsResolver Process PropertyAccessSecurity Serializer Stopwatch TemplatingTranslation ValidatorYaml25 components2.22.12.0martes 25 de junio de 13
  14. 14. BrowserKitDebugFinderLocaleRoutingClassLoader Config Console CssSelectorDI DomCrawler EventDispatcher FilesystemForm HttpFoundation HttpKernel IntlOptionsResolver Process PropertyAccessSecurity Serializer Stopwatch TemplatingTranslation ValidatorYaml2.3 27 components2.22.12.0martes 25 de junio de 13
  15. 15. #3More documentationmartes 25 de junio de 13
  16. 16. 2.02010951BookCookbook2.12011858Components20120632.220123682.3# pagesmartes 25 de junio de 13
  17. 17. #4Easier to debugmartes 25 de junio de 13
  18. 18. More levels of verbosity$ php app/console foo --verbose=1 # -v$ php app/console foo --verbose=2 # -vv$ php app/console foo --verbose=3 # -vvvmartes 25 de junio de 13
  19. 19. 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
  20. 20. configuration parameters$ console container:debug --parameters$ console container:debug --parameter=kernel.debugmartes 25 de junio de 13
  21. 21. stack trace en plain textmartes 25 de junio de 13
  22. 22. more information in router:match$ php app/console router:match /demo/hello/fabienRoute "_demo_hello" matches[router] Route "_demo_hello"Name _demo_helloPath /demo/hello/{name}Host ANYScheme ANYMethod ANYClass SymfonyComponentRoutingRouteDefaults _controller: AcmeDemoBundleControllerDemoController::helloActionRequirements NO CUSTOMOptions compiler_class: SymfonyComponentRoutingRouteCompilerPath-Regex #^/demo/hello/(?P<name>[^/]++)$#smartes 25 de junio de 13
  23. 23. Debug componentmartes 25 de junio de 13
  24. 24. echo $foomartes 25 de junio de 13
  25. 25. Notice: Undefined variable: foo inindex.php on line 1martes 25 de junio de 13
  26. 26. use SymfonyComponentDebugDebug;Debug::$enable();echo $foo;martes 25 de junio de 13
  27. 27. PHP Fatal error: Uncaught exception SymfonyComponentDebugExceptionContextErrorException with message Notice: Undefinedvariable: foo in index.php line 9 in index.php:9Stack trace:#0 index.php(9): SymfonyComponentDebugErrorHandler->handle(8,Undefined varia..., /Users/loalf/Pr..., 9, Array)#1 {main}thrown in index.php on line 9martes 25 de junio de 13
  28. 28. martes 25 de junio de 13
  29. 29. #5A mightier consolemartes 25 de junio de 13
  30. 30. Eventsmartes 25 de junio de 13
  31. 31. martes 25 de junio de 13
  32. 32. $ php app/console fooCommandmartes 25 de junio de 13
  33. 33. console.command$ php app/console fooCommandmartes 25 de junio de 13
  34. 34. console.command$ php app/console fooCommandfooCommand::run()martes 25 de junio de 13
  35. 35. console.command$ php app/console fooCommandfooCommand::run()console.exceptionmartes 25 de junio de 13
  36. 36. console.command$ php app/console fooCommandfooCommand::run()console.terminateconsole.exceptionmartes 25 de junio de 13
  37. 37. martes 25 de junio de 13
  38. 38. Listener.phpmartes 25 de junio de 13
  39. 39. namespace AcmeDemoBundle;class Listener{public function onCommand($event){// your code}}Listener.phpmartes 25 de junio de 13
  40. 40. namespace AcmeDemoBundle;class Listener{public function onCommand($event){// your code}}Listener.phpmartes 25 de junio de 13
  41. 41. parameters.ymlnamespace AcmeDemoBundle;class Listener{public function onCommand($event){// your code}}Listener.phpmartes 25 de junio de 13
  42. 42. services:acme.console.listener:class: AcmeDemoBundleListenertags:-name: kernel.event_listenerevent: console.commandmethod: onCommandparameters.ymlnamespace AcmeDemoBundle;class Listener{public function onCommand($event){// your code}}Listener.phpmartes 25 de junio de 13
  43. 43. tablesmartes 25 de junio de 13
  44. 44. +---------------+--------------------------+------------------+| 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
  45. 45. $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
  46. 46. =============== ========================== ==================ISBN Title Author=============== ========================== ==================99921-58-10-7 Divine Comedy Dante Alighieri9971-5-0210-0 A Tale of Two Cities Charles Dickens960-425-059-0 The Lord of the Rings J. R. R. Tolkien80-902734-1-6 And Then There Were None Agatha Christie=============== ========================== ==================martes 25 de junio de 13
  47. 47. $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
  48. 48. |···············|··························|··················|| 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
  49. 49. $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
  50. 50. #6Better performancemartes 25 de junio de 13
  51. 51. class HeavyService{public function __construct() { sleep(10); }public function doFoo() { echo “foo”; }}martes 25 de junio de 13
  52. 52. 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
  53. 53. services:acme.demo.heavy_service:class: AcmeDemoBundleHeavyServiceacme.demo.light_service:class: AcmeDemoBundleLightServicearguments: [@acme.demo.heavy_service]martes 25 de junio de 13
  54. 54. class DemoController extends Controller{$ls = $this->get(‘acme.demo.light_service’);$ls->doBar();}martes 25 de junio de 13
  55. 55. class DemoController extends Controller{$ls = $this->get(‘acme.demo.light_service’);$ls->doBar();}10220msmartes 25 de junio de 13
  56. 56. services:acme.demo.heavy_service:class: AcmeDemoBundleHeavyServicelazy: trueacme.demo.light_service:class: AcmeDemoBundleLightServicearguments: [@acme.demo.heavy_service]martes 25 de junio de 13
  57. 57. class DemoController extends Controller{$ls = $this->get(‘acme.demo.light_service’);$ls->doBar();}martes 25 de junio de 13
  58. 58. 220msclass DemoController extends Controller{$ls = $this->get(‘acme.demo.light_service’);$ls->doBar();}martes 25 de junio de 13
  59. 59. class DemoController extends Controller{$ls = $this->get(‘acme.demo.light_service’);$ls->doFoo();}martes 25 de junio de 13
  60. 60. 10220msclass DemoController extends Controller{$ls = $this->get(‘acme.demo.light_service’);$ls->doFoo();}martes 25 de junio de 13
  61. 61. composer require ocramius/proxy-managermartes 25 de junio de 13
  62. 62. #7More validatorsmartes 25 de junio de 13
  63. 63. •Currency•IBAN - International Bank Account NumberBankingmartes 25 de junio de 13
  64. 64. • ISBN - International Standard Book Number•ISSN - International Standard Serial NumberPublicationsmartes 25 de junio de 13
  65. 65. •EqualTo•NotEqualTo•IdenticalTo•NotIdenticalToComparison•LessThan•LessThanOrEqual•GreaterThan•GreaterThanOrEqualmartes 25 de junio de 13
  66. 66. #8More HTML5 compliantmartes 25 de junio de 13
  67. 67. MessageNameSurnameEmailBurritos webAndele. Contactanos.sendmartes 25 de junio de 13
  68. 68. MessageNameSurnameEmailBurritos webAndele. Contactanos.send<textarea form=my_form>martes 25 de junio de 13
  69. 69. $form = $crawler->selectButton(send)->getForm();$values = $form->getValues();$keys = array_keys($values)2.3<sfmartes 25 de junio de 13
  70. 70. $form = $crawler->selectButton(send)->getForm();$values = $form->getValues();$keys = array_keys($values)2.3<sf#name, surname, emailmartes 25 de junio de 13
  71. 71. $form = $crawler->selectButton(send)->getForm();$values = $form->getValues();$keys = array_keys($values)2.3=sfmartes 25 de junio de 13
  72. 72. $form = $crawler->selectButton(send)->getForm();$values = $form->getValues();$keys = array_keys($values)2.3=sf#name, surname, email, messagemartes 25 de junio de 13
  73. 73. #9Easier to usemartes 25 de junio de 13
  74. 74. parameters.yml generationmartes 25 de junio de 13
  75. 75. > composer installGenerating autoload filesCreating 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
  76. 76. #*And even more thingsmartes 25 de junio de 13
  77. 77. What we will see inSymfony 2.4martes 25 de junio de 13
  78. 78. Besides the few pull requests thatalready target 2.4, I have one topicthat I want us to work on for 2.4:**performance**martes 25 de junio de 13
  79. 79. https://groups.google.com/forum/#!topic/symfony-devs/rwN1gwuHEC4martes 25 de junio de 13
  80. 80. martes 25 de junio de 13
  81. 81. AdminBundlemartes 25 de junio de 13
  82. 82. CacheAdminBundlemartes 25 de junio de 13
  83. 83. CacheRADAdminBundlemartes 25 de junio de 13
  84. 84. CacheRADRESTAdminBundlemartes 25 de junio de 13
  85. 85. KEEPCALMANDUPGRADESYMFONYmartes 25 de junio de 13
  86. 86. Thanks. Questions?FYI, TimeOut is recruitinghttp://joind.in/talk/view/8853@loalfmartes 25 de junio de 13

×