Yii environment for teamwork

Hello everybody!

After testing Yii, now I have to find the best way for my team use the framework. How could it be?

  • Each developer having a local server and testing it?

  • One development server with Yii? In this case, how to configure Yii so the developers could use yiic tools

  • Other approach?

I am a bit confused about this…

There are lots of ways.

The common way is for each dev to have their own development environment. They then push to a staging server, which runs your continuous integration. You can then pull from the staging server to live (often via ssh, but you decide). These days, a lot of us use git for source control, and its distributed nature makes the above scenario very simple to set-up and has no management overhead; it also makes rolling back very easy when things – as they do sometimes – go wrong.

Keep the Yii source in its own repository (or project, if using svn). This makes testing and updating versions of Yii safe and easy.

Each developer having their own env is a way, but…configuring each envinroment can be painful, since we have to install apache, php, yii, mod_rewrite, php_pdo, etc. So I was wondering if isn´t there another way. But thanks for you reply!

1- Install and configure Yii Framework under a ‘development server’ (http://www.yiiframework.com/doc/guide/quickstart.installation) .

2- Install SVN into your ‘development server’.

3- Make a local working copy for each developer station (checkout).

4- Begin your development (each task for each developer after creating the appropriate Yii project).

5- Every developer will commit his changes to the ‘development server’.

6- You can use GFORGE for example to manage your projects.

In a team work, SVN or any other version control system is a must. With my CMS I use google code.

If setting a working environment for each member takes much time, try to start with Yii virtual appliance (VMware image) - available at home page.

If you are on Linux, then it’s trivial – literally a five minute job – but I guess you aren’t, as you’d know that.

On Windows, just install WAMP, check the mod_rewrite option, restart Apache, and you’re done. Sure, if you want local PHPUnit, CruiseControl and PHPUnderControl, then it’s a little more work, but only an hour, say.

Devs not having their own environment kills productivity. Why would you not want to do it?

I loved svn, really I did, and for non-techs it’s still a fantastic tool, but for development work, with svn, you are always hitting the problems of distributed project management, and merging branches. And for ease of deployment – for those supporting live systems – it is superb.

I know it’s a tricky beast to get to grips with, but I urge everyone to try. It’s not a coincidence that most devs have converged on it as the tool of choice.

SVN is a tool can be used to manage development progress, but fot our problem here, all developers can work in the same server with different sessions, and you will see that you will not lose the time to configure your development environment more than once.

If you don’t want your developers to install an environment, I’d suggest you look into a distributed versioning system (git, mercurial, …), as they are easier to fork into seperate repositories and then push back to the main one (something like branches in svn, but really easier to manage)

What you can do then is give every developer a subdomain/subdirectory with a (password protected) web dir and a versioning dir. They develop on their local machine, and commit changes to the versioning server (with an IDE like Zend or Netbeans this is almost as easy as saving to local files). On the versioning server you have a post-commit hook which pushes the code to the web dir, which results in the developer being able to see his changes immediately. After a developer is done writing a new feature, his repository should be remerged with the main repository.

If you’re working with a database, you’d also need some kind of database migration script if you really want everything to go smoothly.