SlideShare uma empresa Scribd logo
1 de 111
Baixar para ler offline
Friday, June 15, 12
Friday, June 15, 12
ALBERT JESSURUM




Friday, June 15, 12
ALBERT JESSURUM

    • Desarrollador    en Acilia




Friday, June 15, 12
ALBERT JESSURUM

    • Desarrollador    en Acilia

    • Venezolano




Friday, June 15, 12
ALBERT JESSURUM

    • Desarrollador    en Acilia

    • Venezolano

    • @ajessu




Friday, June 15, 12
ALBERT JESSURUM

    • Desarrollador    en Acilia

    • Venezolano

    • @ajessu

    • http://github.com/ajessu




Friday, June 15, 12
ALBERT JESSURUM

    • Desarrollador         en Acilia

    • Venezolano

    • @ajessu

    • http://github.com/ajessu

    • Symfony         Fan


Friday, June 15, 12
ALBERT JESSURUM

    • Desarrollador         en Acilia

    • Venezolano

    • @ajessu

    • http://github.com/ajessu

    • Symfony         Fan


Friday, June 15, 12
PHP ESTA CAMBIANDO




Friday, June 15, 12
UN POCO DE HISTORIA




Friday, June 15, 12
PHP4 Y PRINCIPIOS DE PHP5




Friday, June 15, 12
Friday, June 15, 12
• “Framework” no   era la palabra mas bienvenida




Friday, June 15, 12
• “Framework” no        era la palabra mas bienvenida

    • “CMS” no        tan mala




Friday, June 15, 12
Y LLEGO RAILS




Friday, June 15, 12
FRAMEWORKS = ¡BIEN!




Friday, June 15, 12
Friday, June 15, 12
• La         palabra “Framework” empezó a ser “aceptada”




Friday, June 15, 12
• La         palabra “Framework” empezó a ser “aceptada”

    • Symfony, Zend, Cake, CodeIgniter




Friday, June 15, 12
• La         palabra “Framework” empezó a ser “aceptada”

    • Symfony, Zend, Cake, CodeIgniter

    • Se         satisfacen necesidades comunes de usuarios




Friday, June 15, 12
• La         palabra “Framework” empezó a ser “aceptada”

    • Symfony, Zend, Cake, CodeIgniter

    • Se         satisfacen necesidades comunes de usuarios

    • Descargadas         como un paquete entero




Friday, June 15, 12
FRAMEWORKS = ¿BIEN?




Friday, June 15, 12
Friday, June 15, 12
• ¿Quieres        usar solo una parte de un Framework?




Friday, June 15, 12
• ¿Quieres        usar solo una parte de un Framework?

    • Baja TODO         el framework e intenta usar una parte...




Friday, June 15, 12
• ¿Quieres        usar solo una parte de un Framework?

    • Baja TODO          el framework e intenta usar una parte...

    • Excepto         que tiene dependencias




Friday, June 15, 12
• ¿Quieres        usar solo una parte de un Framework?

    • Baja TODO          el framework e intenta usar una parte...

    • Excepto         que tiene dependencias

    • Se         empieza a ver un cambio de mentalidad sobre frameworks




Friday, June 15, 12
FRAMEWORKS RELOADED




Friday, June 15, 12
Friday, June 15, 12
• Componentes     de frameworks mas desacoplados




Friday, June 15, 12
• Componentes          de frameworks mas desacoplados

    • Librerías       de único uso externas




Friday, June 15, 12
• Componentes          de frameworks mas desacoplados

    • Librerías       de único uso externas

    • MicroFrameworks




Friday, June 15, 12
• Componentes          de frameworks mas desacoplados

    • Librerías       de único uso externas

    • MicroFrameworks

    • MicroPHP         Manifesto




Friday, June 15, 12
¿MICROPHP MANIFESTO?
                            http://microphp.org/




Friday, June 15, 12
SOY UN DESARROLLADOR
                       PHP




Friday, June 15, 12
SOY UN DESARROLLADOR
                       PHP


    • No              soy un desarrollador Symfony, ni Zend, ni CakePHP




Friday, June 15, 12
SOY UN DESARROLLADOR
                       PHP


    • No              soy un desarrollador Symfony, ni Zend, ni CakePHP

    • PHP              ya es suficientemente complicado




Friday, June 15, 12
ME GUSTA CONSTRUIR
                       COSAS PEQUEÑAS




Friday, June 15, 12
ME GUSTA CONSTRUIR
                        COSAS PEQUEÑAS

    • Me              gusta construir cosas pequeñas con propósitos simples




Friday, June 15, 12
ME GUSTA CONSTRUIR
                        COSAS PEQUEÑAS

    • Me              gusta construir cosas pequeñas con propósitos simples

    • Me              gusta construir cosas que resuelvan problemas




Friday, June 15, 12
ME GUSTA CONSTRUIR
                        COSAS PEQUEÑAS

    • Me              gusta construir cosas pequeñas con propósitos simples

    • Me              gusta construir cosas que resuelvan problemas

    • Me    gusta construir cosas pequeñas que trabajen juntas para
        solucionar problemas mas grandes



Friday, June 15, 12
Y MAS COSAS SOBRE MENOS
               CODIGO




Friday, June 15, 12
Y MAS COSAS SOBRE MENOS
               CODIGO


    • Quiero          escribir menos código, no mas




Friday, June 15, 12
Y MAS COSAS SOBRE MENOS
               CODIGO


    • Quiero          escribir menos código, no mas

    • Quiero          código simple y sencillo de leer




Friday, June 15, 12
¿Y TODO ESTO QUE TIENE
            QUE VER CON SYMFONY2?



Friday, June 15, 12
COMPONENTES
                      DESACOPLADOS



Friday, June 15, 12
COMPONENTES
                         LIBRERÍAS
                      DESACOPLADAS



Friday, June 15, 12
CUMPLEN UNA SOLA
                          FUNCIÓN



Friday, June 15, 12
CUMPLEN UNA SOLA
                        FUNCIÓN BIEN



Friday, June 15, 12
UNIX PHILOSOPHY




Friday, June 15, 12
UNIX PHILOSOPHY
                      “Write programs that do one thing and do it well”




Friday, June 15, 12
COMPOSER
                      Manejador de dependencias




Friday, June 15, 12
SEARCH
                      > php composer.phar search pdf

Friday, June 15, 12
PACKAGIST
                         search

Friday, June 15, 12
composer.json

                      {
                          "require": {
                              "itbz/libmergepdf": "1.0.*"
                          }
                      }




Friday, June 15, 12
php composer.phar install




Friday, June 15, 12
<?php

              $m = new itbzlibmergepdfMerger();
              $m->addFromFile('foo.pdf');
              $m->addFromFile('bar.pdf',
                    new itbzlibmergepdfPages('1-10')
                    );
              file_put_contents('foobar.pdf', $m->merge());




Friday, June 15, 12
¿FÁCIL NO?




Friday, June 15, 12
LIBRERIAS EN SYMFONY2




Friday, June 15, 12
MONOLOG




Friday, June 15, 12
composer.json

                      {
                          "require": {
                              "monolog/monolog": "1.*"
                          }
                      }




Friday, June 15, 12
<?php

          use MonologLogger;
          use MonologHandlerStreamHandler;

          // crear un canal de log
          $log = new Logger('name');
          $log->pushHandler(
              new StreamHandler(
                'direccion/a/tu.log',
                Logger::WARNING)
              );

          // añadir record al log
          $log->addWarning('Foo');
          $log->addError('Bar');

Friday, June 15, 12
MonologBundle
                      # app/config/config.yml

                      monolog:
                          handlers:
                               main:
                                   type: stream
                                   path: /direccion/a/tu.log
                                   level: warning




Friday, June 15, 12
ASSETIC




Friday, June 15, 12
<?php

      $yui = new CssCompressorFilter(
                '/direccion/a/tu/yuicompressor.jar'
              );
      $fm = new FilterManager();
      $fm->set('yui_css', $yui);

      $factory = new AssetFactory('/direccion/al/css');
      $factory->setAssetManager(new AssetManager());
      $factory->setFilterManager($fm);

      $formula = array(
          array('overall.css', 'social.css'),
          array('yui_css'),
      );
      $lazyAm = new LazyAssetManager($factory);
      $lazyAm->setFormula('main', $formula);
Friday, June 15, 12
<?php

                      $writer = new AssetWriter(
                              '/direccion/al/directorio/publico'
                            );
                      $writer->writeManagerAssets($lazyAm);

                      $css = $lazyAm->get('main')->dump();




Friday, June 15, 12
AsseticBundle
           # app/config/config.yml

           assetic:
               debug:           %kernel.debug%
               use_controller: false
               bundles:         [ ]
               #java: /usr/bin/java
               filters:
                    cssrewrite: ~
                    yui_css:
                        jar: %kernel.root_dir%/Resources/java/yuicomp.jar




Friday, June 15, 12
Twig Template
    <link href="{{ asset('css/reset.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('css/960.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('css/main.css') }}" rel="stylesheet" type="text/css" />




       {% stylesheets '@AcmeFooBundle/Resources/public/css/*' filter='yui_css' %}
           <link rel="stylesheet" type="text/css" href="{{ asset_url }}" />
       {% endstylesheets %}




Friday, June 15, 12
IMAGINE
                      Libreria de manipulacion de imagenes para PHP 5.3+




Friday, June 15, 12
Redimensionar con GD
           <?php

           $width = //anchura final
           $height = //altura final
           $src = imagecreatefrompng('/direccion/a/imagen.png');
           $dest = imagecreatetruecolor($width, $height);
           imagealphablending($dest, false);
           imagesavealpha($dest, true);
           imagecopyresampled($dest, $src, 0, 0, 0, 0,
                $width, $height, imagesx($src), imagesy($src));
           imagepng($dest,'/direccion/a/redimensionada/image.png');




Friday, June 15, 12
Redimensionar con ImageMagick

           <?php

           $width = //anchura final
           $height = //altura final
           $image = new Imagick('/direccion/a/imagen.png');
           $image->adaptiveResizeImage($width, $height);
           $image->writeImage('/direccion/a/redimensionada/imagen.png');




Friday, June 15, 12
Redimensionar con Imagine
                                (GD)
           <?php

           $width = //anchura final
           $height = //altura final
           $imagine = new ImagineGdImagine();
           $imagine->open('/direccion/a/imagen.png')
               ->resize(new ImagineBox($width, $height))
               ->save('/direccion/a/redimensionada/imagen.png');




Friday, June 15, 12
Redimensionar con Imagine
                           (ImageMagick)
           <?php

           $width = //anchura final
           $height = //altura final
           $imagine = new ImagineImagickImagine();
           $imagine->open('/direccion/a/imagen.png')
               ->resize(new ImagineBox($width, $height))
               ->save('/direccion/a/redimensionada/imagen.png');




Friday, June 15, 12
Creación de thumbs
           <?php

           $imagine = new ImagineGdImagine();

           $mode = ImagineImageInterface::THUMBNAIL_OUTBOUND;
           //o modo
           $mode = ImagineImageInterface::THUMBNAIL_INSET;

           $imagine->open('/direccion/a/logo.png')
               ->thumbnail(new ImagineBox(100, 100), $mode)
               ->save('/direccion/a/logo/thumbs/logo.png');




Friday, June 15, 12
LiipImagineBundle

      # app/config/config.yml

      liip_imagine:
          filter_sets:
              my_thumb:
                  quality: 75
                  filters:
                       thumbnail: { size: [120, 90], mode: outbound }




Friday, June 15, 12
LiipImagineBundle

      # app/config/config.yml

      liip_imagine:
          filter_sets:
              my_thumb:
                  quality: 75
                  filters:
                       thumbnail: { size: [120, 90], mode: outbound }



<img	
  src="{{	
  '/relative/path/to/image.jpg'	
  |	
  imagine_filter('my_thumb')	
  }}"/>




Friday, June 15, 12
Y MUCHAS MAS!




Friday, June 15, 12
PIMPLE
                      Contenedor de Inyección de dependencias
                          https://github.com/fabpot/Pimple




Friday, June 15, 12
GUZZLE / BUZZ
                                   Clientes HTTP
                         https://github.com/guzzle/guzzle
                      https://github.com/kriswallsmith/buzz

                       Comparación entre ambas y otras:
                      http://groups.drupal.org/node/233173

Friday, June 15, 12
GOUTTE
                                 Web scrapping
                      https://github.com/fabpot/Goutte




Friday, June 15, 12
GAUFRETTE
                       Abstraccion de sistema de archivos
                      https://github.com/KnpLabs/Gaufrette




Friday, June 15, 12
QUIERO MAS...




Friday, June 15, 12
http://microphp.org/code.html




Friday, June 15, 12
http://packagist.org/packages/




Friday, June 15, 12
http://knpbundles.com/




Friday, June 15, 12
PHP NO CAMBIA SOLO




Friday, June 15, 12
LO CAMBIAS TU




Friday, June 15, 12
¿PHP es feo?




Friday, June 15, 12
SI
                      ¿PHP es feo?




Friday, June 15, 12
¿PHP es inconsistente?




Friday, June 15, 12
SI
                      ¿PHP es inconsistente?




Friday, June 15, 12
¿Funciona?




Friday, June 15, 12
SI
                      ¿Funciona?




Friday, June 15, 12
SI
                              ¿Funciona?

                      y también nos da de comer




Friday, June 15, 12
Friday, June 15, 12
La proxima vez que tengas una necesidad.




Friday, June 15, 12
BUSCA PRIMERO! PUEDE QUE
         YA ESTE INVENTADO
                      La proxima vez que tengas una necesidad.




Friday, June 15, 12
¿No hace lo que necesitas?




Friday, June 15, 12
FORK!
                      ¿No hace lo que necesitas?




Friday, June 15, 12
¿Mejoraste alguna funcionalidad?




Friday, June 15, 12
CONTRIBUYE!
                      ¿Mejoraste alguna funcionalidad?




Friday, June 15, 12
¿Intentaste hacer algo, y estuviste medio día pegandote con ello
                     y por fin has dado con la solución?




Friday, June 15, 12
DOCUMENTA!
      ¿Intentaste hacer algo, y estuviste medio día pegandote con ello
                     y por fin has dado con la solución?




Friday, June 15, 12
PHP no mejora solo




Friday, June 15, 12
LO MEJORAS TU
                        PHP no mejora solo




Friday, June 15, 12
PHP ES UNA COMUNIDAD Y
             DEPENDE DE TODOS



Friday, June 15, 12
ES FÁCIL
     CONTRIBUYE AL ECOSISTEMA



Friday, June 15, 12
¿PREGUNTAS?




Friday, June 15, 12
• Albert          Jessurum

    • http://github.com/ajessu

    • @ajessu

    • https://connect.sensiolabs.com/profile/ajessu




Friday, June 15, 12
REFERENCIAS

    • http://www.slideshare.net/avalanche123/introduction-toimagine

    • http://www.slideshare.net/pmjones88/decoupled-libraries-for-
        php-54-the-aura-project

    • http://www.slideshare.net/kriswallsmith/introducing-assetic-
        nyphp

    • https://speakerdeck.com/u/richardmiller/p/what-do-i-get-from-
        the-full-stack-framework

Friday, June 15, 12

Mais conteúdo relacionado

Destaque

Pixelmatters and the power of Dribbble
Pixelmatters and the power of DribbblePixelmatters and the power of Dribbble
Pixelmatters and the power of DribbblePixelmatters
 
RouterOS supported hardware, sep 2012
RouterOS supported hardware, sep 2012RouterOS supported hardware, sep 2012
RouterOS supported hardware, sep 2012Tũi Wichets
 
Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?
Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?
Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?Maklaro GmbH
 
R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)
R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)
R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)Maintenance Connection
 
Revista Educ@conTIC. Número 4
Revista Educ@conTIC. Número 4Revista Educ@conTIC. Número 4
Revista Educ@conTIC. Número 4Educ@conTIC
 
Boletin Palante 91 De Andalucia
Boletin Palante 91 De AndaluciaBoletin Palante 91 De Andalucia
Boletin Palante 91 De AndaluciaMartin Triana
 
Maximino Linares Gil
Maximino Linares GilMaximino Linares Gil
Maximino Linares GilTecnimap
 
Revista sobre el encuentro de pedagogía UGC
Revista sobre el encuentro de pedagogía UGCRevista sobre el encuentro de pedagogía UGC
Revista sobre el encuentro de pedagogía UGCMao Medina
 
Influencia de los sistemas en el mundo
Influencia de los sistemas en el mundoInfluencia de los sistemas en el mundo
Influencia de los sistemas en el mundomalexandrafm
 
Metabolic Balance Weight Loss Overview
Metabolic Balance Weight Loss OverviewMetabolic Balance Weight Loss Overview
Metabolic Balance Weight Loss OverviewJane Durst Pulkys
 
Occupational balance as used in occupational therapy: A concept analysis
Occupational balance as used in occupational therapy: A concept  analysisOccupational balance as used in occupational therapy: A concept  analysis
Occupational balance as used in occupational therapy: A concept analysisGrupo OT5
 
Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...
Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...
Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...EUROsociAL II
 
2013 Audi Q5 Brochure MI | Detroit Audi Dealer
2013 Audi Q5 Brochure MI | Detroit Audi Dealer2013 Audi Q5 Brochure MI | Detroit Audi Dealer
2013 Audi Q5 Brochure MI | Detroit Audi DealerFred Lavery Company
 
Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores" Caritas Mu...
Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores"  Caritas Mu...Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores"  Caritas Mu...
Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores" Caritas Mu...Victor Alonso
 

Destaque (20)

Pixelmatters and the power of Dribbble
Pixelmatters and the power of DribbblePixelmatters and the power of Dribbble
Pixelmatters and the power of Dribbble
 
RouterOS supported hardware, sep 2012
RouterOS supported hardware, sep 2012RouterOS supported hardware, sep 2012
RouterOS supported hardware, sep 2012
 
Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?
Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?
Welche Nebenkosten kommen beim Immobilienkauf auf mich zu?
 
Pc4 s
Pc4 sPc4 s
Pc4 s
 
EYEC2014 Program
EYEC2014 ProgramEYEC2014 Program
EYEC2014 Program
 
R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)
R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)
R08 - Intermediate Reporting: Email, Schedule, and Export (MCU)
 
Revista Educ@conTIC. Número 4
Revista Educ@conTIC. Número 4Revista Educ@conTIC. Número 4
Revista Educ@conTIC. Número 4
 
Multichannel Loesung
Multichannel LoesungMultichannel Loesung
Multichannel Loesung
 
Interim Report Europe
Interim Report EuropeInterim Report Europe
Interim Report Europe
 
Boletin Palante 91 De Andalucia
Boletin Palante 91 De AndaluciaBoletin Palante 91 De Andalucia
Boletin Palante 91 De Andalucia
 
Maximino Linares Gil
Maximino Linares GilMaximino Linares Gil
Maximino Linares Gil
 
Revista sobre el encuentro de pedagogía UGC
Revista sobre el encuentro de pedagogía UGCRevista sobre el encuentro de pedagogía UGC
Revista sobre el encuentro de pedagogía UGC
 
Influencia de los sistemas en el mundo
Influencia de los sistemas en el mundoInfluencia de los sistemas en el mundo
Influencia de los sistemas en el mundo
 
Metabolic Balance Weight Loss Overview
Metabolic Balance Weight Loss OverviewMetabolic Balance Weight Loss Overview
Metabolic Balance Weight Loss Overview
 
Occupational balance as used in occupational therapy: A concept analysis
Occupational balance as used in occupational therapy: A concept  analysisOccupational balance as used in occupational therapy: A concept  analysis
Occupational balance as used in occupational therapy: A concept analysis
 
Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...
Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...
Katun. Nuestra Guatemala 2032 - Foro Internacional sobre Desarrollo Urbano y ...
 
Taekwondo
TaekwondoTaekwondo
Taekwondo
 
2013 Audi Q5 Brochure MI | Detroit Audi Dealer
2013 Audi Q5 Brochure MI | Detroit Audi Dealer2013 Audi Q5 Brochure MI | Detroit Audi Dealer
2013 Audi Q5 Brochure MI | Detroit Audi Dealer
 
Edit Decision List
Edit Decision ListEdit Decision List
Edit Decision List
 
Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores" Caritas Mu...
Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores"  Caritas Mu...Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores"  Caritas Mu...
Programa Capacitación Laboral Básica Inmigrantes - "Triunfadores" Caritas Mu...
 

Semelhante a deSymfony 2012 - El entorno de Symfony2

Código Fácil De Testear
Código Fácil De TestearCódigo Fácil De Testear
Código Fácil De TestearAlvaro Videla
 
5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) CodeJeremy Kendall
 
JS-Everywhere - LocalStorage Hands-on
JS-Everywhere - LocalStorage Hands-onJS-Everywhere - LocalStorage Hands-on
JS-Everywhere - LocalStorage Hands-onBrice Argenson
 
Real Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakReal Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakEast Bay WordPress Meetup
 
Keynote Day 1 - Atlassian Summit 2012
Keynote Day 1 - Atlassian Summit 2012Keynote Day 1 - Atlassian Summit 2012
Keynote Day 1 - Atlassian Summit 2012Atlassian
 
Maximiliano Firtman
Maximiliano FirtmanMaximiliano Firtman
Maximiliano FirtmanColombia3.0
 
Software Libraries And Numbers
Software Libraries And NumbersSoftware Libraries And Numbers
Software Libraries And NumbersRobert Reiz
 
When your code is nearly old enough to vote
When your code is nearly old enough to voteWhen your code is nearly old enough to vote
When your code is nearly old enough to votedreamwidth
 
Phpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and MinkPhpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and MinkRichard Tuin
 
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...Pablo Godel
 
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
 
Spring in-the-cloud
Spring in-the-cloudSpring in-the-cloud
Spring in-the-cloudJoshua Long
 
Becoming a Real Programmer
Becoming a Real ProgrammerBecoming a Real Programmer
Becoming a Real ProgrammerJacques Woodcock
 
JS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-onJS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-onBrice Argenson
 
OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012Theo Schlossnagle
 

Semelhante a deSymfony 2012 - El entorno de Symfony2 (18)

Código Fácil De Testear
Código Fácil De TestearCódigo Fácil De Testear
Código Fácil De Testear
 
5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code
 
JS-Everywhere - LocalStorage Hands-on
JS-Everywhere - LocalStorage Hands-onJS-Everywhere - LocalStorage Hands-on
JS-Everywhere - LocalStorage Hands-on
 
Real Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakReal Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan Didak
 
JavaScript QA Tools
JavaScript QA ToolsJavaScript QA Tools
JavaScript QA Tools
 
Keynote Day 1 - Atlassian Summit 2012
Keynote Day 1 - Atlassian Summit 2012Keynote Day 1 - Atlassian Summit 2012
Keynote Day 1 - Atlassian Summit 2012
 
impact_mapping
impact_mappingimpact_mapping
impact_mapping
 
Maximiliano Firtman
Maximiliano FirtmanMaximiliano Firtman
Maximiliano Firtman
 
Software Libraries And Numbers
Software Libraries And NumbersSoftware Libraries And Numbers
Software Libraries And Numbers
 
When your code is nearly old enough to vote
When your code is nearly old enough to voteWhen your code is nearly old enough to vote
When your code is nearly old enough to vote
 
Phpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and MinkPhpday - Automated acceptance testing with Behat and Mink
Phpday - Automated acceptance testing with Behat and Mink
 
Symfonyday Keynote
Symfonyday KeynoteSymfonyday Keynote
Symfonyday Keynote
 
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
 
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
 
Spring in-the-cloud
Spring in-the-cloudSpring in-the-cloud
Spring in-the-cloud
 
Becoming a Real Programmer
Becoming a Real ProgrammerBecoming a Real Programmer
Becoming a Real Programmer
 
JS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-onJS-Everywhere - SSE Hands-on
JS-Everywhere - SSE Hands-on
 
OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012OmniOS Motivation and Design ~ LISA 2012
OmniOS Motivation and Design ~ LISA 2012
 

deSymfony 2012 - El entorno de Symfony2

  • 4. ALBERT JESSURUM • Desarrollador en Acilia Friday, June 15, 12
  • 5. ALBERT JESSURUM • Desarrollador en Acilia • Venezolano Friday, June 15, 12
  • 6. ALBERT JESSURUM • Desarrollador en Acilia • Venezolano • @ajessu Friday, June 15, 12
  • 7. ALBERT JESSURUM • Desarrollador en Acilia • Venezolano • @ajessu • http://github.com/ajessu Friday, June 15, 12
  • 8. ALBERT JESSURUM • Desarrollador en Acilia • Venezolano • @ajessu • http://github.com/ajessu • Symfony Fan Friday, June 15, 12
  • 9. ALBERT JESSURUM • Desarrollador en Acilia • Venezolano • @ajessu • http://github.com/ajessu • Symfony Fan Friday, June 15, 12
  • 11. UN POCO DE HISTORIA Friday, June 15, 12
  • 12. PHP4 Y PRINCIPIOS DE PHP5 Friday, June 15, 12
  • 14. • “Framework” no era la palabra mas bienvenida Friday, June 15, 12
  • 15. • “Framework” no era la palabra mas bienvenida • “CMS” no tan mala Friday, June 15, 12
  • 16. Y LLEGO RAILS Friday, June 15, 12
  • 19. • La palabra “Framework” empezó a ser “aceptada” Friday, June 15, 12
  • 20. • La palabra “Framework” empezó a ser “aceptada” • Symfony, Zend, Cake, CodeIgniter Friday, June 15, 12
  • 21. • La palabra “Framework” empezó a ser “aceptada” • Symfony, Zend, Cake, CodeIgniter • Se satisfacen necesidades comunes de usuarios Friday, June 15, 12
  • 22. • La palabra “Framework” empezó a ser “aceptada” • Symfony, Zend, Cake, CodeIgniter • Se satisfacen necesidades comunes de usuarios • Descargadas como un paquete entero Friday, June 15, 12
  • 25. • ¿Quieres usar solo una parte de un Framework? Friday, June 15, 12
  • 26. • ¿Quieres usar solo una parte de un Framework? • Baja TODO el framework e intenta usar una parte... Friday, June 15, 12
  • 27. • ¿Quieres usar solo una parte de un Framework? • Baja TODO el framework e intenta usar una parte... • Excepto que tiene dependencias Friday, June 15, 12
  • 28. • ¿Quieres usar solo una parte de un Framework? • Baja TODO el framework e intenta usar una parte... • Excepto que tiene dependencias • Se empieza a ver un cambio de mentalidad sobre frameworks Friday, June 15, 12
  • 31. • Componentes de frameworks mas desacoplados Friday, June 15, 12
  • 32. • Componentes de frameworks mas desacoplados • Librerías de único uso externas Friday, June 15, 12
  • 33. • Componentes de frameworks mas desacoplados • Librerías de único uso externas • MicroFrameworks Friday, June 15, 12
  • 34. • Componentes de frameworks mas desacoplados • Librerías de único uso externas • MicroFrameworks • MicroPHP Manifesto Friday, June 15, 12
  • 35. ¿MICROPHP MANIFESTO? http://microphp.org/ Friday, June 15, 12
  • 36. SOY UN DESARROLLADOR PHP Friday, June 15, 12
  • 37. SOY UN DESARROLLADOR PHP • No soy un desarrollador Symfony, ni Zend, ni CakePHP Friday, June 15, 12
  • 38. SOY UN DESARROLLADOR PHP • No soy un desarrollador Symfony, ni Zend, ni CakePHP • PHP ya es suficientemente complicado Friday, June 15, 12
  • 39. ME GUSTA CONSTRUIR COSAS PEQUEÑAS Friday, June 15, 12
  • 40. ME GUSTA CONSTRUIR COSAS PEQUEÑAS • Me gusta construir cosas pequeñas con propósitos simples Friday, June 15, 12
  • 41. ME GUSTA CONSTRUIR COSAS PEQUEÑAS • Me gusta construir cosas pequeñas con propósitos simples • Me gusta construir cosas que resuelvan problemas Friday, June 15, 12
  • 42. ME GUSTA CONSTRUIR COSAS PEQUEÑAS • Me gusta construir cosas pequeñas con propósitos simples • Me gusta construir cosas que resuelvan problemas • Me gusta construir cosas pequeñas que trabajen juntas para solucionar problemas mas grandes Friday, June 15, 12
  • 43. Y MAS COSAS SOBRE MENOS CODIGO Friday, June 15, 12
  • 44. Y MAS COSAS SOBRE MENOS CODIGO • Quiero escribir menos código, no mas Friday, June 15, 12
  • 45. Y MAS COSAS SOBRE MENOS CODIGO • Quiero escribir menos código, no mas • Quiero código simple y sencillo de leer Friday, June 15, 12
  • 46. ¿Y TODO ESTO QUE TIENE QUE VER CON SYMFONY2? Friday, June 15, 12
  • 47. COMPONENTES DESACOPLADOS Friday, June 15, 12
  • 48. COMPONENTES LIBRERÍAS DESACOPLADAS Friday, June 15, 12
  • 49. CUMPLEN UNA SOLA FUNCIÓN Friday, June 15, 12
  • 50. CUMPLEN UNA SOLA FUNCIÓN BIEN Friday, June 15, 12
  • 52. UNIX PHILOSOPHY “Write programs that do one thing and do it well” Friday, June 15, 12
  • 53. COMPOSER Manejador de dependencias Friday, June 15, 12
  • 54. SEARCH > php composer.phar search pdf Friday, June 15, 12
  • 55. PACKAGIST search Friday, June 15, 12
  • 56. composer.json { "require": { "itbz/libmergepdf": "1.0.*" } } Friday, June 15, 12
  • 58. <?php $m = new itbzlibmergepdfMerger(); $m->addFromFile('foo.pdf'); $m->addFromFile('bar.pdf', new itbzlibmergepdfPages('1-10') ); file_put_contents('foobar.pdf', $m->merge()); Friday, June 15, 12
  • 62. composer.json { "require": { "monolog/monolog": "1.*" } } Friday, June 15, 12
  • 63. <?php use MonologLogger; use MonologHandlerStreamHandler; // crear un canal de log $log = new Logger('name'); $log->pushHandler( new StreamHandler( 'direccion/a/tu.log', Logger::WARNING) ); // añadir record al log $log->addWarning('Foo'); $log->addError('Bar'); Friday, June 15, 12
  • 64. MonologBundle # app/config/config.yml monolog: handlers: main: type: stream path: /direccion/a/tu.log level: warning Friday, June 15, 12
  • 66. <?php $yui = new CssCompressorFilter( '/direccion/a/tu/yuicompressor.jar' ); $fm = new FilterManager(); $fm->set('yui_css', $yui); $factory = new AssetFactory('/direccion/al/css'); $factory->setAssetManager(new AssetManager()); $factory->setFilterManager($fm); $formula = array( array('overall.css', 'social.css'), array('yui_css'), ); $lazyAm = new LazyAssetManager($factory); $lazyAm->setFormula('main', $formula); Friday, June 15, 12
  • 67. <?php $writer = new AssetWriter( '/direccion/al/directorio/publico' ); $writer->writeManagerAssets($lazyAm); $css = $lazyAm->get('main')->dump(); Friday, June 15, 12
  • 68. AsseticBundle # app/config/config.yml assetic: debug: %kernel.debug% use_controller: false bundles: [ ] #java: /usr/bin/java filters: cssrewrite: ~ yui_css: jar: %kernel.root_dir%/Resources/java/yuicomp.jar Friday, June 15, 12
  • 69. Twig Template <link href="{{ asset('css/reset.css') }}" rel="stylesheet" type="text/css" /> <link href="{{ asset('css/960.css') }}" rel="stylesheet" type="text/css" /> <link href="{{ asset('css/main.css') }}" rel="stylesheet" type="text/css" /> {% stylesheets '@AcmeFooBundle/Resources/public/css/*' filter='yui_css' %} <link rel="stylesheet" type="text/css" href="{{ asset_url }}" /> {% endstylesheets %} Friday, June 15, 12
  • 70. IMAGINE Libreria de manipulacion de imagenes para PHP 5.3+ Friday, June 15, 12
  • 71. Redimensionar con GD <?php $width = //anchura final $height = //altura final $src = imagecreatefrompng('/direccion/a/imagen.png'); $dest = imagecreatetruecolor($width, $height); imagealphablending($dest, false); imagesavealpha($dest, true); imagecopyresampled($dest, $src, 0, 0, 0, 0, $width, $height, imagesx($src), imagesy($src)); imagepng($dest,'/direccion/a/redimensionada/image.png'); Friday, June 15, 12
  • 72. Redimensionar con ImageMagick <?php $width = //anchura final $height = //altura final $image = new Imagick('/direccion/a/imagen.png'); $image->adaptiveResizeImage($width, $height); $image->writeImage('/direccion/a/redimensionada/imagen.png'); Friday, June 15, 12
  • 73. Redimensionar con Imagine (GD) <?php $width = //anchura final $height = //altura final $imagine = new ImagineGdImagine(); $imagine->open('/direccion/a/imagen.png') ->resize(new ImagineBox($width, $height)) ->save('/direccion/a/redimensionada/imagen.png'); Friday, June 15, 12
  • 74. Redimensionar con Imagine (ImageMagick) <?php $width = //anchura final $height = //altura final $imagine = new ImagineImagickImagine(); $imagine->open('/direccion/a/imagen.png') ->resize(new ImagineBox($width, $height)) ->save('/direccion/a/redimensionada/imagen.png'); Friday, June 15, 12
  • 75. Creación de thumbs <?php $imagine = new ImagineGdImagine(); $mode = ImagineImageInterface::THUMBNAIL_OUTBOUND; //o modo $mode = ImagineImageInterface::THUMBNAIL_INSET; $imagine->open('/direccion/a/logo.png') ->thumbnail(new ImagineBox(100, 100), $mode) ->save('/direccion/a/logo/thumbs/logo.png'); Friday, June 15, 12
  • 76. LiipImagineBundle # app/config/config.yml liip_imagine: filter_sets: my_thumb: quality: 75 filters: thumbnail: { size: [120, 90], mode: outbound } Friday, June 15, 12
  • 77. LiipImagineBundle # app/config/config.yml liip_imagine: filter_sets: my_thumb: quality: 75 filters: thumbnail: { size: [120, 90], mode: outbound } <img  src="{{  '/relative/path/to/image.jpg'  |  imagine_filter('my_thumb')  }}"/> Friday, June 15, 12
  • 78. Y MUCHAS MAS! Friday, June 15, 12
  • 79. PIMPLE Contenedor de Inyección de dependencias https://github.com/fabpot/Pimple Friday, June 15, 12
  • 80. GUZZLE / BUZZ Clientes HTTP https://github.com/guzzle/guzzle https://github.com/kriswallsmith/buzz Comparación entre ambas y otras: http://groups.drupal.org/node/233173 Friday, June 15, 12
  • 81. GOUTTE Web scrapping https://github.com/fabpot/Goutte Friday, June 15, 12
  • 82. GAUFRETTE Abstraccion de sistema de archivos https://github.com/KnpLabs/Gaufrette Friday, June 15, 12
  • 87. PHP NO CAMBIA SOLO Friday, June 15, 12
  • 88. LO CAMBIAS TU Friday, June 15, 12
  • 89. ¿PHP es feo? Friday, June 15, 12
  • 90. SI ¿PHP es feo? Friday, June 15, 12
  • 92. SI ¿PHP es inconsistente? Friday, June 15, 12
  • 94. SI ¿Funciona? Friday, June 15, 12
  • 95. SI ¿Funciona? y también nos da de comer Friday, June 15, 12
  • 97. La proxima vez que tengas una necesidad. Friday, June 15, 12
  • 98. BUSCA PRIMERO! PUEDE QUE YA ESTE INVENTADO La proxima vez que tengas una necesidad. Friday, June 15, 12
  • 99. ¿No hace lo que necesitas? Friday, June 15, 12
  • 100. FORK! ¿No hace lo que necesitas? Friday, June 15, 12
  • 102. CONTRIBUYE! ¿Mejoraste alguna funcionalidad? Friday, June 15, 12
  • 103. ¿Intentaste hacer algo, y estuviste medio día pegandote con ello y por fin has dado con la solución? Friday, June 15, 12
  • 104. DOCUMENTA! ¿Intentaste hacer algo, y estuviste medio día pegandote con ello y por fin has dado con la solución? Friday, June 15, 12
  • 105. PHP no mejora solo Friday, June 15, 12
  • 106. LO MEJORAS TU PHP no mejora solo Friday, June 15, 12
  • 107. PHP ES UNA COMUNIDAD Y DEPENDE DE TODOS Friday, June 15, 12
  • 108. ES FÁCIL CONTRIBUYE AL ECOSISTEMA Friday, June 15, 12
  • 110. • Albert Jessurum • http://github.com/ajessu • @ajessu • https://connect.sensiolabs.com/profile/ajessu Friday, June 15, 12
  • 111. REFERENCIAS • http://www.slideshare.net/avalanche123/introduction-toimagine • http://www.slideshare.net/pmjones88/decoupled-libraries-for- php-54-the-aura-project • http://www.slideshare.net/kriswallsmith/introducing-assetic- nyphp • https://speakerdeck.com/u/richardmiller/p/what-do-i-get-from- the-full-stack-framework Friday, June 15, 12