Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The art of PHP package design

The art of PHP package design

Are you dreaming about your first project? Maybe you already have several under your belt? When it comes to making you project user-friendly and usable, writing code is only one of the things you must care about. The rest of them is covered in this talk.

Tomasz Kowalczyk

October 10, 2016

More Decks by Tomasz Kowalczyk

Other Decks in Programming


  1. the art of package design in PHP

  2. /usr/bin/whoami @tmmx

  3. None
  4. Idea

  5. “I want to create a new library!” Why?

  6. searching for ideas

  7. research current state

  8. pain points

  9. rule of three

  10. finishing your tasks solving problems

  11. “There are only two hard things in Computer Science: cache

    invalidation and naming things.” Phil Karlton
  12. Code

  13. project repository

  14. GitHub, BitBucket, Gitlab...

  15. ...self hosting?

  16. SourceForge PHPClasses

  17. composer.json

  18. supported PHP versions

  19. dependencies

  20. roave/security-advisories

  21. depend in the direction of stability

  22. PSR-0 vs PSR-4

  23. consistent coding style

  24. framework agnostic

  25. now comes the best part

  26. CODE CODE CODE CODE CODE code code code code code

    Code Code Code Code Code CODE code
  27. Continuous Integration

  28. because you have tests, right?

  29. RIGHT?

  30. license

  31. to GPL, or not to GPL?

  32. MIT, BSD, Apache, MPL, WTFPL

  33. do not use Creative Commons

  34. versioning scheme

  35. SemVer major.minor.patch

  36. breaking news! changes

  37. tagging releases

  38. README.md

  39. Release

  40. register package

  41. Composer Packagist Satis

  42. Final touch

  43. CHANGELOG.md

  44. .gitattributes

  45. .gitignore

  46. SensioLabs Insight Scrutinizer CI Nitpick CI …

  47. Community

  48. documentation


  50. Summary

  51. my condolences, you’re now the maintainer of an open source

  52. Images https://www.flickr.com/photos/davidedamico/15030329393 (city bg) https://www.flickr.com/photos/skyseeker/14404947216 (lightning) Resources: http://www.phptherightway.com http://phppackagechecklist.com http://semver.org

    https://blog.codinghorror.com/rule-of-three http://martinfowler.com/bliki/TwoHardThings.html https://en.wikipedia.org/wiki/Software_versioning https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licenses https://gist.github.com/jashkenas/cbd2b088e20279ae2c8e https://leanpub.com/principles-of-package-design https://www.sitepoint.com/starting-new-php-package-right-way https://runcommand.io/2016/06/26/my-condolences-youre-now-the-maintainer-of-a-popular-open-source-project http://www.slideshare.net/matthiasnoback/principles-of-php-package-design-for-amsterdamphp http://raphaelstolt.blogspot.com/2016/09/anatomy-of-dope-php-package-repository.html
  53. Questions?

  54. Thanks! @tmmx