Before I install Drupal
Whenever I start a new drupal project, my first task is to setup a version control repository. I have used CVS for 8 years but now that I had a taste of SVN, that is all I am using. Once I setup the repositary I create the folder for the project:
Then I download the latest version of the drupal series I want to install. Since a number of critial modules are not yet ported to Drupal 6 (views, cck, panels to name a few) I stick to Drupal 5 for now.
Then I follow the vendor branch instruction in the SVN book so I can keep track of changes while having the ability to modify the core files (fixed bugs, add features). NOTE: I avoid making core changes but it happened a couple of time that it was innevitable.
The next step bring the drupal source into my actual project.
This needs an explanation. What I am doing here is creating the trunk of my project from a copy of the 5.7 release. I am doing this so that I can upgrade to drupal 5.8+ in the future even if I changed some core files. The trunk is my project root folder which happens to be the document root when using drupal. That is why I make it my trunk.
Some people will instead checkout the CVS version of drupal in your trunk and since CVS plays well with SVN, you get the same advantages. Since I like doing things differently some times, I prefer doing it using svn vendor branches.
I want to work in my project so I need to check it out!
svn checkout file:///var/svn/myproject/trunk myproject
Drupal requires you to create a folder called "files" which will contain public files. But SVN will not know about this will and will put a question mark (?) when issuing "svn status". What I do is I tell svn to ignore this folder using svn properties.
The current folder is the document root where the files folder is located. By doing this, the files folder will be ignore by SVN which is a good thing. This folder contains dynamic files created by the application. It is exacly like the database. The database cannot be controlled by SVN because the database is dynamic.
In order to install Drupal, the settings.php file needs to be writable so the install script can modify its contain. Config files that contains passwords or contains settings that change from one user to another should not be in SVN. That is why I recommend that you rename the file to a "distributed" copy and tell svn to ignore the settings.php.
svn move sites/default/settings.php sites/default/settings.php-dist -m "The real settings.php should not be versionned"
svn setprop svn:ignore "settings.php" sites/default -m "The real settings.php should not be versionned".
The installer still need a writable settings.php and we'll get one from the distributed copy:
cp sites/default/settings.php-dist sites/default/settings.php
chmod 666 sites/default/settings.php
Now I can run the install script and follow the instructions to install Drupal.
Make a Payment to Christian Roy