SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
PHP Reset
                         Jordi Boggiano @seldaek
                              http://nelm.io/

Jordi Boggiano                                     Company http://nelm.io
http://twitter.com/seldaek                             Blog http://seld.be
Disclaimer
                             This is not about REST




Jordi Boggiano                                        Company http://nelm.io
http://twitter.com/seldaek                                Blog http://seld.be
About Me
               Belgian living in Zürich
               Weby stuff for 10 years
               http://seld.be
               Symfony2 core dev and other OSS contributions
               http://github.com/Seldaek
               Recently started Nelmio
               http://nelm.io
               We do Symfony2 & Frontend Performance consulting




Jordi Boggiano                                               Company http://nelm.io
http://twitter.com/seldaek                                       Blog http://seld.be
Planning
                       Small Rant
                       New Frameworks & Libraries
                       GitHub Commercial Break
                       Best Practices
                       Composer
                       Wishful Thinking




Jordi Boggiano                                      Company http://nelm.io
http://twitter.com/seldaek                              Blog http://seld.be
A bit of history




Jordi Boggiano                                  Company http://nelm.io
http://twitter.com/seldaek                          Blog http://seld.be
PHP4 - 22-May-2000
               01 class Foo_Bar_Baz
               02 {
               03     var $foo;
               04
               05     function Foo_Bar_Baz()
               06     {
               07     }
               08
               09     function bar()
               10     {
               11     }
               12 }




Jordi Boggiano                                             Company http://nelm.io
http://twitter.com/seldaek                                     Blog http://seld.be
PHP5 - 13-Jul-2004
               01 class Foo_Bar_Baz
               02 {
               03     public $foo;
               04
               05     public function __construct()
               06     {
               07     }
               08
               09     private function bar()
               10     {
               11     }
               12 }




Jordi Boggiano                                              Company http://nelm.io
http://twitter.com/seldaek                                      Blog http://seld.be
Could you spot the differences?




Jordi Boggiano                              Company http://nelm.io
http://twitter.com/seldaek                      Blog http://seld.be
Yet seven years later
                ~20% of servers still run PHP4




                             Source: @iliaa's PHP Advent article, December 2010.




Jordi Boggiano                                                                     Company http://nelm.io
http://twitter.com/seldaek                                                             Blog http://seld.be
PHP5.3 - 30-Jun-2009
               01   namespace FooBar;
               02
               03   class Baz
               04   {
               05       public $foo;
               06
               07            public function __construct()
               08            {
               09            }
               10
               11            private function bar()
               12            {
               13            }
               14   }




Jordi Boggiano                                                     Company http://nelm.io
http://twitter.com/seldaek                                             Blog http://seld.be
Again, not much has changed.
                   But it changes everything.
                             BackslashMeansNoBackwardsCompatibility




Jordi Boggiano                                                            Company http://nelm.io
http://twitter.com/seldaek                                                    Blog http://seld.be
We've been sitting on our asses
                          for too long.
                    It's time for a change.




Jordi Boggiano                              Company http://nelm.io
http://twitter.com/seldaek                      Blog http://seld.be
New Frameworks




Jordi Boggiano                                Company http://nelm.io
http://twitter.com/seldaek                        Blog http://seld.be
Symfony2
                              Lithium
                               Silex
                                ZF2
                                 ...
                                  .


Jordi Boggiano                          Company http://nelm.io
http://twitter.com/seldaek                  Blog http://seld.be
New Libraries




Jordi Boggiano                               Company http://nelm.io
http://twitter.com/seldaek                       Blog http://seld.be
Assetic
               Asset management & processing
                       Combine & Compress JS, CSS
                       Compile CoffeeScript, SASS, LESS, ..
                       Re-encode images
                       All on the fly with cache or pre-processed
                       Inspired by Python's WebAssets
                       Shipped with Symfony2
               http://github.com/kriswallsmith/assetic




Jordi Boggiano                                                Company http://nelm.io
http://twitter.com/seldaek                                        Blog http://seld.be
Doctrine2
               DBAL, ORM, ODMs
                       Document stores (MongoDB, CouchDB,
                       PHPCR, XML)
                       Common interfaces allow for interop and
                       knowledge re-use
                       Propel2 builds on top of it
                       Shipped with Symfony2
               http://github.com/doctrine




Jordi Boggiano                                              Company http://nelm.io
http://twitter.com/seldaek                                      Blog http://seld.be
Monolog
               Logging
                       FingersCrossedHandler for production
                       Log to files, FirePHP, emails, etc.
                       Inspired by Python's Logbook
                       Shipped with Symfony2
               http://github.com/Seldaek/monolog




Jordi Boggiano                                                Company http://nelm.io
http://twitter.com/seldaek                                        Blog http://seld.be
Twig
               Template engine
                       Automatic escaping
                       Separation of concerns
                       (Readability)
                       Inspired by Python's Jinja2
                       Shipped with Symfony2
               http://github.com/fabpot/Twig




Jordi Boggiano                                       Company http://nelm.io
http://twitter.com/seldaek                               Blog http://seld.be
Gaufrette
               Filesystem abstraction
                       Code once, store files anywhere
                       S3, Memory, FTP, Rackspace, ..
                       Transparently cache calls to slow backends
               http://github.com/knplabs/Gaufrette




Jordi Boggiano                                               Company http://nelm.io
http://twitter.com/seldaek                                       Blog http://seld.be
Snappy
               Generates PDF/images from webpages
                       Uses wkhtmltopdf/wkhtmltoimage
                       Good example of a small single-purpose
                       library
               http://github.com/knplabs/snappy




Jordi Boggiano                                              Company http://nelm.io
http://twitter.com/seldaek                                      Blog http://seld.be
Imagine
               Image manipulation
                       API that doesn't suck
                       Supports GD2, Imagick, Gmagick
                       Easily resize, crop, and more
                       Inspired by Python's PIL & others
               http://github.com/avalanche123/Imagine




Jordi Boggiano                                             Company http://nelm.io
http://twitter.com/seldaek                                     Blog http://seld.be
Buzz
               HTTP requests
                       API that doesn't suck
                       Wraps around CURL
               http://github.com/kriswallsmith/Buzz




Jordi Boggiano                                        Company http://nelm.io
http://twitter.com/seldaek                                Blog http://seld.be
Goutte
               Web Crawler
                       Supports CSS3 selectors to extract content
                       Easily follow links, submit forms, etc.
                       Good example of code re-use (Sf2/ZF2
                       components)
               http://github.com/fabpot/Goutte




Jordi Boggiano                                               Company http://nelm.io
http://twitter.com/seldaek                                       Blog http://seld.be
I can't list them all.




Jordi Boggiano                                        Company http://nelm.io
http://twitter.com/seldaek                                Blog http://seld.be
GitHub




Jordi Boggiano                        Company http://nelm.io
http://twitter.com/seldaek                Blog http://seld.be
Git will hurt you
                             Read http://progit.org - it's free.




Jordi Boggiano                                                     Company http://nelm.io
http://twitter.com/seldaek                                             Blog http://seld.be
GitHub is your friend
                       No need to track down a developer's
                       email. Hit fork, create a branch, then send
                       a pull request
                       Push code, get immediate attention and
                       contributors
                       README.mdown in every repository
                       200 Symfony2 contributors, still in beta!




Jordi Boggiano                                                Company http://nelm.io
http://twitter.com/seldaek                                        Blog http://seld.be
Best Practices




Jordi Boggiano                                Company http://nelm.io
http://twitter.com/seldaek                        Blog http://seld.be
MIT License
               Free as in free.




Jordi Boggiano                                  Company http://nelm.io
http://twitter.com/seldaek                          Blog http://seld.be
Autoload with PSR-0
               01   //   One class per file
               02   //   First bit should be a vendor name (your project, company, ..)
               03   //   This should sit in <project>/Nelmio/Bar/Baz.php
               04   //   WATCH THE CASE!
               05
               06   namespace NelmioBar;
               07
               08   class Baz
               09   {
               10   }

               http://tinyurl.com/psr0-standard




Jordi Boggiano                                                                           Company http://nelm.io
http://twitter.com/seldaek                                                                   Blog http://seld.be
PEAR-style Coding Standards
               01   namespace FooBar;
               02
               03   class Baz
               04   {
               05       public $foo;
               06
               07            public function __construct()
               08            {
               09                $stuff = array('Coding Style');
               10                if (true) {
               11                    foreach ($stuff as $blob) {
               12                        echo "happy $blob!";
               13                    }
               14                } else {
               15                    echo "dead kittens";
               16                }
               17            }
               18   }

               http://pear.php.net/manual/en/standards.php



Jordi Boggiano                                                     Company http://nelm.io
http://twitter.com/seldaek                                             Blog http://seld.be
Remember, kids, standards
                               are NOT about taste




Jordi Boggiano                                           Company http://nelm.io
http://twitter.com/seldaek                                   Blog http://seld.be
Testing
                       Tests are always good, but for libraries
                       they're a must.
                       Typing phpunit in <project>/ is all I want
                       to know.




Jordi Boggiano                                                Company http://nelm.io
http://twitter.com/seldaek                                        Blog http://seld.be
Composer




Jordi Boggiano                          Company http://nelm.io
http://twitter.com/seldaek                  Blog http://seld.be
Package Management for PHP
                       Mostly inspired by npm and bundler
                       Advanced dependency resolving
                       Install project dependencies locally




Jordi Boggiano                                                Company http://nelm.io
http://twitter.com/seldaek                                        Blog http://seld.be
Compose great things with small libraries
                       Rely on proven code to do common tasks
                       Simplify old APIs (e.g. Imagine, Buzz)




Jordi Boggiano                                                 Company http://nelm.io
http://twitter.com/seldaek                                         Blog http://seld.be
composer.json (lib)
               01 {
               02            "name": "Monolog",
               03            "description": "Logging for PHP 5.3",
               04            "keywords": ["log","logging"],
               05            "homepage": "http://github.com/Seldaek/monolog",
               06            "version": "1.0.0",
               07            "license": "MIT",
               08            "authors": [
               09                {
               10                    "name": "Jordi Boggiano",
               11                    "email": "j.boggiano@seld.be",
               12                    "homepage": "http://seld.be"
               13                }
               14            ],
               15            "require": {
               16                "php": ">=5.3.0"
               17            }
               18 }




Jordi Boggiano                                                                  Company http://nelm.io
http://twitter.com/seldaek                                                          Blog http://seld.be
composer.json (project)
               01 {
               02            "repositories": {
               03                "AwesomeLib": {
               04                    "git": "git://github.com/Jim/AwesomeLib.git"
               05                },
               06                "GreatLib": {
               07                    "git-bare": {
               08                        "url": "git://github.com/Bob/GreatLib.git",
               09                        "version": "1.0.0"
               10                    }
               11                }
               12            },
               13            "require": {
               14                "Twig": ">=1.0.0",
               15                "AwesomeLib": "latest",
               16                "GreatLib": "1.0.0",
               17                "Monolog": "latest"
               18            }
               19 }




Jordi Boggiano                                                                         Company http://nelm.io
http://twitter.com/seldaek                                                                 Blog http://seld.be
Demo, kind of.
                             (blame @naderman :)




Jordi Boggiano                                     Company http://nelm.io
http://twitter.com/seldaek                             Blog http://seld.be
Fear code re-use no more.




Jordi Boggiano                                       Company http://nelm.io
http://twitter.com/seldaek                               Blog http://seld.be
Last words




Jordi Boggiano                            Company http://nelm.io
http://twitter.com/seldaek                    Blog http://seld.be
Namespace adoption, in effect,
                     opens up a world of
                        possibilities.




Jordi Boggiano                               Company http://nelm.io
http://twitter.com/seldaek                       Blog http://seld.be
Open up your mind,
                              we're not alone.




Jordi Boggiano                                    Company http://nelm.io
http://twitter.com/seldaek                            Blog http://seld.be
Share your code
                             and collaborate.




Jordi Boggiano                                  Company http://nelm.io
http://twitter.com/seldaek                          Blog http://seld.be
Thank you.




Jordi Boggiano                            Company http://nelm.io
http://twitter.com/seldaek                    Blog http://seld.be
Feedback please on:
                         http://joind.in/3489
                                Slides:
                         http://slides.seld.be
                             Contact me:
                       @seldaek || jordi@nelm.io


Jordi Boggiano                                 Company http://nelm.io
http://twitter.com/seldaek                         Blog http://seld.be

Weitere ähnliche Inhalte

Ähnlich wie international PHP2011_Jordi Boggiano_PHP Reset

Dependency Management with Composer
Dependency Management with ComposerDependency Management with Composer
Dependency Management with ComposerJordi Boggiano
 
Of metacello, git, scripting and things
Of metacello, git, scripting and thingsOf metacello, git, scripting and things
Of metacello, git, scripting and thingsESUG
 
How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-Katy Slemon
 
Arduino for Designers
Arduino for DesignersArduino for Designers
Arduino for DesignersFablab Torino
 
Cocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.twCocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.twYu-Wei Chuang
 
Social coding をもっと楽しみたいあなたへ
Social coding をもっと楽しみたいあなたへSocial coding をもっと楽しみたいあなたへ
Social coding をもっと楽しみたいあなたへRyunosuke SATO
 
Design of a BIOLOID Scorpion Report
Design of a BIOLOID Scorpion ReportDesign of a BIOLOID Scorpion Report
Design of a BIOLOID Scorpion ReportBruno Chung
 
Building and deploying Cocoa applications with ChocTop
Building and deploying Cocoa applications with ChocTopBuilding and deploying Cocoa applications with ChocTop
Building and deploying Cocoa applications with ChocTopPatrick Huesler
 
LeapMotion for Web with React and Flux
LeapMotion for Web with React and FluxLeapMotion for Web with React and Flux
LeapMotion for Web with React and FluxLaura Moore
 
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...Baruch Sadogursky
 
Ultrabootstrapping: Launching a Startup for Less Than $1000
Ultrabootstrapping: Launching a Startup for Less Than $1000Ultrabootstrapping: Launching a Startup for Less Than $1000
Ultrabootstrapping: Launching a Startup for Less Than $1000Jon Boutelle
 
Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started TodayGabriel Hamilton
 
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engverNaoki Sekiguchi
 
Tales from the OSGi Trenches - Bertrand Delacretaz
Tales from the OSGi Trenches - Bertrand DelacretazTales from the OSGi Trenches - Bertrand Delacretaz
Tales from the OSGi Trenches - Bertrand Delacretazmfrancis
 
Gerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub pluginGerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub pluginLuca Milanesio
 

Ähnlich wie international PHP2011_Jordi Boggiano_PHP Reset (20)

Dependency Management with Composer
Dependency Management with ComposerDependency Management with Composer
Dependency Management with Composer
 
Of metacello, git, scripting and things
Of metacello, git, scripting and thingsOf metacello, git, scripting and things
Of metacello, git, scripting and things
 
SWONtech News for May, 2012
SWONtech News for May, 2012SWONtech News for May, 2012
SWONtech News for May, 2012
 
How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-
 
Arduino for Designers
Arduino for DesignersArduino for Designers
Arduino for Designers
 
Cocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.twCocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.tw
 
Social coding をもっと楽しみたいあなたへ
Social coding をもっと楽しみたいあなたへSocial coding をもっと楽しみたいあなたへ
Social coding をもっと楽しみたいあなたへ
 
Design of a BIOLOID Scorpion Report
Design of a BIOLOID Scorpion ReportDesign of a BIOLOID Scorpion Report
Design of a BIOLOID Scorpion Report
 
Jabber Bot
Jabber BotJabber Bot
Jabber Bot
 
Tales from the OSGi trenches
Tales from the OSGi trenchesTales from the OSGi trenches
Tales from the OSGi trenches
 
Building and deploying Cocoa applications with ChocTop
Building and deploying Cocoa applications with ChocTopBuilding and deploying Cocoa applications with ChocTop
Building and deploying Cocoa applications with ChocTop
 
Zero To Dojo
Zero To DojoZero To Dojo
Zero To Dojo
 
LeapMotion for Web with React and Flux
LeapMotion for Web with React and FluxLeapMotion for Web with React and Flux
LeapMotion for Web with React and Flux
 
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
 
Ultrabootstrapping: Launching a Startup for Less Than $1000
Ultrabootstrapping: Launching a Startup for Less Than $1000Ultrabootstrapping: Launching a Startup for Less Than $1000
Ultrabootstrapping: Launching a Startup for Less Than $1000
 
Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started Today
 
Dojo tutorial
Dojo tutorialDojo tutorial
Dojo tutorial
 
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver
 
Tales from the OSGi Trenches - Bertrand Delacretaz
Tales from the OSGi Trenches - Bertrand DelacretazTales from the OSGi Trenches - Bertrand Delacretaz
Tales from the OSGi Trenches - Bertrand Delacretaz
 
Gerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub pluginGerrit Code Review with GitHub plugin
Gerrit Code Review with GitHub plugin
 

Mehr von smueller_sandsmedia

webinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnen
webinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnenwebinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnen
webinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnensmueller_sandsmedia
 
webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...
webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...
webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...smueller_sandsmedia
 
international PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projekten
international PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projekteninternational PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projekten
international PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projektensmueller_sandsmedia
 
international PHP2011_Bastian Feder_The most unknown Parts of PHPUnit
international PHP2011_Bastian Feder_The most unknown Parts of PHPUnitinternational PHP2011_Bastian Feder_The most unknown Parts of PHPUnit
international PHP2011_Bastian Feder_The most unknown Parts of PHPUnitsmueller_sandsmedia
 
international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...
international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...
international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...smueller_sandsmedia
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5smueller_sandsmedia
 
international PHP2011_J.Hartmann_DevOps für PHP
international PHP2011_J.Hartmann_DevOps für PHPinternational PHP2011_J.Hartmann_DevOps für PHP
international PHP2011_J.Hartmann_DevOps für PHPsmueller_sandsmedia
 
webinale2011_Daniel Höpfner_Förderprogramme für dummies
webinale2011_Daniel Höpfner_Förderprogramme für dummieswebinale2011_Daniel Höpfner_Förderprogramme für dummies
webinale2011_Daniel Höpfner_Förderprogramme für dummiessmueller_sandsmedia
 

Mehr von smueller_sandsmedia (8)

webinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnen
webinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnenwebinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnen
webinale2011_Kai Radusch_Landingpage-Optimierung für Adwords-Kampagnen
 
webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...
webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...
webinale 2011_Gabriel Yoran_Der Schlüssel zum erfolg: Besser aussehen, als ma...
 
international PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projekten
international PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projekteninternational PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projekten
international PHP2011_Henning Wolf_ Mit Retrospektivenzu erfolgreichen Projekten
 
international PHP2011_Bastian Feder_The most unknown Parts of PHPUnit
international PHP2011_Bastian Feder_The most unknown Parts of PHPUnitinternational PHP2011_Bastian Feder_The most unknown Parts of PHPUnit
international PHP2011_Bastian Feder_The most unknown Parts of PHPUnit
 
international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...
international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...
international PHP2011_Kore Nordmann_Tobias Schlitt_Modular Application Archit...
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5
 
international PHP2011_J.Hartmann_DevOps für PHP
international PHP2011_J.Hartmann_DevOps für PHPinternational PHP2011_J.Hartmann_DevOps für PHP
international PHP2011_J.Hartmann_DevOps für PHP
 
webinale2011_Daniel Höpfner_Förderprogramme für dummies
webinale2011_Daniel Höpfner_Förderprogramme für dummieswebinale2011_Daniel Höpfner_Förderprogramme für dummies
webinale2011_Daniel Höpfner_Förderprogramme für dummies
 

Kürzlich hochgeladen

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Kürzlich hochgeladen (20)

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

international PHP2011_Jordi Boggiano_PHP Reset

  • 1. PHP Reset Jordi Boggiano @seldaek http://nelm.io/ Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 2. Disclaimer This is not about REST Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 3. About Me Belgian living in Zürich Weby stuff for 10 years http://seld.be Symfony2 core dev and other OSS contributions http://github.com/Seldaek Recently started Nelmio http://nelm.io We do Symfony2 & Frontend Performance consulting Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 4. Planning Small Rant New Frameworks & Libraries GitHub Commercial Break Best Practices Composer Wishful Thinking Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 5. A bit of history Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 6. PHP4 - 22-May-2000 01 class Foo_Bar_Baz 02 { 03 var $foo; 04 05 function Foo_Bar_Baz() 06 { 07 } 08 09 function bar() 10 { 11 } 12 } Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 7. PHP5 - 13-Jul-2004 01 class Foo_Bar_Baz 02 { 03 public $foo; 04 05 public function __construct() 06 { 07 } 08 09 private function bar() 10 { 11 } 12 } Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 8. Could you spot the differences? Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 9. Yet seven years later ~20% of servers still run PHP4 Source: @iliaa's PHP Advent article, December 2010. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 10. PHP5.3 - 30-Jun-2009 01 namespace FooBar; 02 03 class Baz 04 { 05 public $foo; 06 07 public function __construct() 08 { 09 } 10 11 private function bar() 12 { 13 } 14 } Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 11. Again, not much has changed. But it changes everything. BackslashMeansNoBackwardsCompatibility Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 12. We've been sitting on our asses for too long. It's time for a change. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 13. New Frameworks Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 14. Symfony2 Lithium Silex ZF2 ... . Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 15. New Libraries Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 16. Assetic Asset management & processing Combine & Compress JS, CSS Compile CoffeeScript, SASS, LESS, .. Re-encode images All on the fly with cache or pre-processed Inspired by Python's WebAssets Shipped with Symfony2 http://github.com/kriswallsmith/assetic Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 17. Doctrine2 DBAL, ORM, ODMs Document stores (MongoDB, CouchDB, PHPCR, XML) Common interfaces allow for interop and knowledge re-use Propel2 builds on top of it Shipped with Symfony2 http://github.com/doctrine Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 18. Monolog Logging FingersCrossedHandler for production Log to files, FirePHP, emails, etc. Inspired by Python's Logbook Shipped with Symfony2 http://github.com/Seldaek/monolog Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 19. Twig Template engine Automatic escaping Separation of concerns (Readability) Inspired by Python's Jinja2 Shipped with Symfony2 http://github.com/fabpot/Twig Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 20. Gaufrette Filesystem abstraction Code once, store files anywhere S3, Memory, FTP, Rackspace, .. Transparently cache calls to slow backends http://github.com/knplabs/Gaufrette Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 21. Snappy Generates PDF/images from webpages Uses wkhtmltopdf/wkhtmltoimage Good example of a small single-purpose library http://github.com/knplabs/snappy Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 22. Imagine Image manipulation API that doesn't suck Supports GD2, Imagick, Gmagick Easily resize, crop, and more Inspired by Python's PIL & others http://github.com/avalanche123/Imagine Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 23. Buzz HTTP requests API that doesn't suck Wraps around CURL http://github.com/kriswallsmith/Buzz Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 24. Goutte Web Crawler Supports CSS3 selectors to extract content Easily follow links, submit forms, etc. Good example of code re-use (Sf2/ZF2 components) http://github.com/fabpot/Goutte Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 25. I can't list them all. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 26. GitHub Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 27. Git will hurt you Read http://progit.org - it's free. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 28. GitHub is your friend No need to track down a developer's email. Hit fork, create a branch, then send a pull request Push code, get immediate attention and contributors README.mdown in every repository 200 Symfony2 contributors, still in beta! Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 29. Best Practices Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 30. MIT License Free as in free. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 31. Autoload with PSR-0 01 // One class per file 02 // First bit should be a vendor name (your project, company, ..) 03 // This should sit in <project>/Nelmio/Bar/Baz.php 04 // WATCH THE CASE! 05 06 namespace NelmioBar; 07 08 class Baz 09 { 10 } http://tinyurl.com/psr0-standard Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 32. PEAR-style Coding Standards 01 namespace FooBar; 02 03 class Baz 04 { 05 public $foo; 06 07 public function __construct() 08 { 09 $stuff = array('Coding Style'); 10 if (true) { 11 foreach ($stuff as $blob) { 12 echo "happy $blob!"; 13 } 14 } else { 15 echo "dead kittens"; 16 } 17 } 18 } http://pear.php.net/manual/en/standards.php Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 33. Remember, kids, standards are NOT about taste Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 34. Testing Tests are always good, but for libraries they're a must. Typing phpunit in <project>/ is all I want to know. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 35. Composer Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 36. Package Management for PHP Mostly inspired by npm and bundler Advanced dependency resolving Install project dependencies locally Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 37. Compose great things with small libraries Rely on proven code to do common tasks Simplify old APIs (e.g. Imagine, Buzz) Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 38. composer.json (lib) 01 { 02 "name": "Monolog", 03 "description": "Logging for PHP 5.3", 04 "keywords": ["log","logging"], 05 "homepage": "http://github.com/Seldaek/monolog", 06 "version": "1.0.0", 07 "license": "MIT", 08 "authors": [ 09 { 10 "name": "Jordi Boggiano", 11 "email": "j.boggiano@seld.be", 12 "homepage": "http://seld.be" 13 } 14 ], 15 "require": { 16 "php": ">=5.3.0" 17 } 18 } Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 39. composer.json (project) 01 { 02 "repositories": { 03 "AwesomeLib": { 04 "git": "git://github.com/Jim/AwesomeLib.git" 05 }, 06 "GreatLib": { 07 "git-bare": { 08 "url": "git://github.com/Bob/GreatLib.git", 09 "version": "1.0.0" 10 } 11 } 12 }, 13 "require": { 14 "Twig": ">=1.0.0", 15 "AwesomeLib": "latest", 16 "GreatLib": "1.0.0", 17 "Monolog": "latest" 18 } 19 } Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 40. Demo, kind of. (blame @naderman :) Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 41. Fear code re-use no more. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 42. Last words Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 43. Namespace adoption, in effect, opens up a world of possibilities. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 44. Open up your mind, we're not alone. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 45. Share your code and collaborate. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 46. Thank you. Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be
  • 47. Feedback please on: http://joind.in/3489 Slides: http://slides.seld.be Contact me: @seldaek || jordi@nelm.io Jordi Boggiano Company http://nelm.io http://twitter.com/seldaek Blog http://seld.be