Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How composer saved PHP

331 views

Published on

Whenever composer was released, it made a massive difference for php and for all php frameworks. Find out how.

Published in: Software
  • Be the first to comment

How composer saved PHP

  1. 1. HOW COMPOSER SAVED PHP
  2. 2. OBLIGATORY “ABOUT ME” SLIDE ➤ Worked as a web developer since 2006 ➤ Have used several in-house and OS frameworks ➤ Involved with phpBelfast ➤ Currently work for The Tomorrow Lab ➤ @ryankilf
  3. 3. DEPENDENCY MANAGEMENT ?
  4. 4. DEPENDENCY MANAGEMENT IN PHP IN 2012 A confused mixture
  5. 5. DEPENDENCY MANAGEMENT ➤ PEAR ➤ phpclasses.org
  6. 6. DEPENDENCY MANAGEMENT ➤ PEAR ➤ phpclasses.org
  7. 7. DEPENDENCY MANAGEMENT ➤ PEAR ➤ phpclasses.org ➤ Framework Specific Dependency Management ➤ CodeIgniter - Sparks ➤ FuelPHP - Cells ➤ Laravel - Bundles ➤ Cake - The Bakery ➤ ZF2 - Modules
  8. 8. INTEROPERABILITY + STANDARDS SUUUUURRRREEE
  9. 9. CODING STANDARDS $variablenamelikeso $variableNameLikeSo $variable_name_like_so
  10. 10. SUMMARY - SILOS ➤ Different Coding Standards ➤ Different dependency tools ➤ How to write something for both, say, Laravel & FuelPHP? ➤ Where do you put it? ➤ Are you creating two entirely separate repos?
  11. 11. “Originally used for tracking visits to his online resume, he [Rasmus Lerdorf] named the suite of scripts "Personal Home Page Tools," more frequently referenced as "PHP Tools." - php.net history page
  12. 12. “The PHP community needs to get together behind a new solution and the framework developers need to lead the charge. - Phil Sturgeon, 2012
  13. 13. ENTER
  14. 14. PROBLEMS COMPOSER SOLVES ➤ Installation per site ➤ Not curated ➤ But packagist.org helps ensure quality ➤ Tests part of composer.json ➤ PSR-0 Compliant Autoloading solution ➤ Now PSR-4 ➤ Don’t have to commit every file in some library
  15. 15. TYPICAL COMPOSER FILE (SECTION THEREOF) "require": { "php": ">=7.0.1", "doctrine/dbal": "^2.5", "fzaninotto/faker": "^1.6", "jeroennoten/laravel-adminlte": "^1.17", "laravel/framework": "5.3.*" },
  16. 16. ADDING A NEW PACKAGE TO MY PROJECT
  17. 17. ADDING A NEW LIBRARY COMPOSER.JSON COMPOSER.LOCK
  18. 18. ENTER
  19. 19. PROBLEMS SYMFONY COMPONENTS SOLVE ➤ Great Libraries ➤ Used in lots of frameworks ➤ interoperability ➤ N.B. Symfony not a monolith, but a bunch of bits ➤ But I can take those bits and make what I want
  20. 20. PROJECTS USING SYMFONY COMPONENTS http://symfony.com/projects Drupal
 phpBB
 Laravel
 Symfony Full Stack
 eZ Publish Community
 Joomla!
 Composer
 Magento
 Piwik
 Silex
 Assetic
 Goutte
 Sami
 Sismo
 PHPUnit
 OroCRM
 OroPlatform
 Doctrine
 Behat
 Sylius
 Sonata Project
 Zikula
 Symfony CMF
 Akeneo PIM
 Shopware
 Propel
 Mautic
 Codeception
  21. 21. PROJECTS USING SYMFONY COMPONENTS http://symfony.com/projects TYPO3
 Thelia
 Kunstmaan Bundles
 Sculpin
 Flow
 phpspec
 phpDocumentor
 Guzzle
 Bolt
 Pagekit
 Vespolina
 Easybook
 Fork CMS
 phpMyFAQ 
 PPI Framework
 Proem Framework
 Sulu
 init CMS
 Carew
 RedKite CMS
 Ladybug
 Phinx
 Elcodi
 Spress
 phpRedExpert
 Roadiz
 Mothership
 BackBee
 concrete5
 Sonata e-commerce
 Drupal Console
 Grav
 WellCommerce
 Contao
 Aimeos e-commerce components
 PHP Depend
 bowerphp
 freepost
 Morfeu
 Pimcore
 CSBill
 eccube
  22. 22. ENTER
  23. 23. PROBLEMS PHP-FIG SOLVES ➤ Standards ➤ for everyone ➤ A whole PHP vision ➤ a PHP-first community ➤ Not just a community for every framework ➤ They don’t write code ➤ PSR-0 - most important
  24. 24. NOW? What’s the current state of PHP?
  25. 25. COMPOSER INFLUENCE
  26. 26. COMPOSER INFLUENCE johnpbloch/wordpress // roots.io // wpackagist.org
  27. 27. ENTER
  28. 28. THE PHP LEAGUE ➤ Packages for everyone ➤ Which are PHP-FIG compliant ➤ PHP: The right way ➤ “Everyone first” ➤ Adapters for specific frameworks ➤ Flysystem, wow!
  29. 29. PHPBELFAST FRAMEWORK ➤ Now viable to make entire applications out of “Stuff” on packagist ➤ Not convinced that it’s the right thing to do ➤ But, still great that it’s viable ➤ @phpbelfast
  30. 30. ENTER YOU?
  31. 31. LESSONS FOR OPEN SOURCE ➤ Write code for the widest possible number of users ➤ Documentation matters ➤ Make the easiest solution the best solution ➤ Lots of small packages > few big ones ➤ community matters
  32. 32. FURTHER READING ➤ benramsey.com/blog/2013/11/the-fall-of-pear-and-the-rise-of-composer ➤ philsturgeon.uk/php/2012/03/06/packages-the-way-forward-for-php ➤ symfony.com/projects ➤ roots.io GET IN TOUCH ➤ @ryankilf // @thetomorrowlab ➤ ryan@thetomorrowlab.com

×