SUBSCRIBE VIA RSS


Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.

Topics

Stack Overflow


The old fashioned way

RECENT TUNES

August 20, 2009 – 12:24pm Getting a new developer started on an existing symfony project

Here is the basic process we use to get a new developer started on a symfony project. This flow assumes you already have created your symfony project and it checked into an svn repository somewhere, and that the developer is on a mac.

1. Checkout code from SVN into your ~/Sites folder. From the command line do:

svn co [path to repository] ~/Sites/[projectname] --username [username]

After the checkout, go into your new [projectname] directory and do a fix permissions:

./symfony fix-perms

2. Create a new virtual host in apache. You can skip this step but I find it makes things easier. My entry in my apache .conf file (on my mac its located at /etc/apache2/users/[username].conf where [username] is the username on my mac) looks like this:

<VirtualHost *:80>
	ServerName [projectname].local
	DocumentRoot /Users/[myusername]/Sites/[projectname]/web
</VirtualHost>

I also have add this new domain to my local hosts file at /etc/hosts:

127.0.0.1   [projectname].local

then i restart my webserver with a “sudo apachectl graceful”.

3. set up your local database. On my mac I use Sequel Pro to create the database. I run a..

./symfony propel-build-all

..to regenerate the sql and base model classes. Often I don’t like to commit auto-generated code to svn but rather just the source files from which the new code is generated (you can read the side bar “Best Practice: Checkin all the canonical stuff, and nothing else” with one view on this at http://www.ericsink.com/scm/scm_repositories.html).

Once that is done, normally I would insert the db schema into my new database, like this:

mysql -u root [dbname] < data/sql/lib.model.schema.sql

… but sometimes I want to use a lot of the same basic data from before, so I insert database dump that has actual content:

mysql -u root [dbname] < data/sql/latest.sql

4. configure the symfony project to use your new db. You’ll have to copy the config/databases.yml-dist to database.yml and add your own settings there. The databases.yml file is ignored in our repository, so that way the devs can keep different local configuration settings for our dev environment without having to create lots of different symfony environments (usually I keep them to just dev, stage, production) in the project.

5. load up http://[projectname].local/frontend_dev.php to see if things are working!

Posted by in  Web Development   |  

Comments are closed.