Talk: PHP Best Practices – Matthew Weier O’Phinney and Lorna Jane Mitchell

Writing maintainable code is an art that takes effort and practice to master.
Part of that art is learning what tools and strategies will assist you in that effort. In this tutorial, we will cover a variety of practices and tools that can make your life, and the lives of your team members, easier as you develop your applications. Among them, we will provide overviews of:

  • Version Control
  • Coding Standards
  • Unit Testing basics
  • QA tools: phpcs, phploc, phpmd, continuous integration, and more
  • Team Collaboration tools, such as Skype, IRC, issue trackers, and more

via Talk: PHP Best Practices –

SVN Externals

The official SVN online manual has an article on this, please read it. I won’t let myself off the hook that easy and will give you a brief example on how to use them. Let’s say you have your own MVC project based on Zend Framework. You should off course store your app in SVN, but using the following command you can dynamically link the framework to you library folder. Please consider the following command knowing that our present working directory is ‘library’:

svn propset 'svn:externals' 'Zend' .

This command wil link the Zend library and after performing an svn up your working copy will also include version 1.7.6 of Zend Framework. Please also consider commiting, because other checkouts need to sync the framework too. Maybe I should explain the different fragments of the command too:

  • svn propset: this part will set a property
  • svn:externals: the property we’re gonna set is called ’svn:externals’
  • Zend: we will create a folder called ‘Zend’ which is a checkout of a specific version
  • The URL. Quite self-explanatory
  • The dot (.): the dot specifies that the checkout will happen in the current folder. You can also put a directory name in there

Happy versioning!