Version Control != Dependency Management


Published on

Are you using svn:externals, git-submodules or something similar with your Version Control System of choice for connecting third-party libraries to your PHP projects? This presentation explores ways to handle dependencies in PHP projects, just like projects in other programming languages have done for ages.
See for full article.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Version Control != Dependency Management

  1. 1. Version Control != Dependency Management Patrick van Dissel @pvdisselOctober 29, 2010
  2. 2. NoteThis presentation is focussed on and for PHP projects, but the principal can be applied on projects in other programming language
  3. 3. PHP
  4. 4. Common project structure Nice separation: ● Application ● Libraries ● Public
  5. 5. Common structure in VCS Single directory structure Libraries copied in every project; causing duplication
  6. 6. Subversion (svn)
  7. 7. With Subversion (SVN)Common structure in VCS svn:externals to tags As it should be used
  8. 8. With Subversion (SVN)Common structure in VCS svn:externals to trunk As its often used
  9. 9. Getting externals in SVN
  10. 10. External fetching on SVN checkout
  11. 11. svn:externalsPros:● svn:externals fixes duplicationCons:● Externals are hidden in SVN metadata● Externals are NOT read-only(!)● Externals can ONLY point to a SVN repository● Makes branching/tagging harder
  12. 12. svn:externalsMakes a rudimentary dependency manager from Subversion
  13. 13. How do others handledependency management?
  14. 14. *nix
  15. 15. with Make A solution the *nix way● Compile wont succeed until all required dependencies are available● Configurable to use optional dependencies when available
  16. 16. Java
  17. 17. with MavenA solution the Java way
  18. 18. with MavenA solution the Java way
  19. 19. PHP
  20. 20. Solutions available for PHP a framework and distribution system for reusable PHP components
  21. 21. Solutions available for PHPPyrus (PHP5.3.1+) is a tool to manage PEARpackages. Pyrus simplifies and improves the PEARexperience. Features include:● Standalone tool (pyrus.phar)● Can be integrated into application● Pear repository management/connection● Dependency Management● Packaging in the PHAR format (PHp Archive)
  22. 22. Solutions available for PHP PHing Is Not GNU make. A PHP project build system/tool based on Apache Ant
  23. 23. Solutions available for PHP Use a Version Control System likeSubversion to control code versions
  24. 24. Solutions available for PHP Use a build tool like Phing to "build" projects
  25. 25. Solutions available for PHP Use Pear as repository for libraries and applications
  26. 26. Solutions available for PHP Use Pyrus to integrate the Pear repository withPhing for dependency management
  27. 27. So..?
  28. 28. It isnt working yet!!Currently Phing doesnt have a plugin to work with Pyrus (October 29, 2010)
  29. 29. Resources● Phing -● Pear -● Pear2 / Pyrus - Pyrus presentation:● Extending Phing -● Phar -● Pake -● Make -● Apache Maven -● Apache Ant -● Apache Ivy -
  30. 30. Questions?