Halldor Posted July 30, 2011 Share Posted July 30, 2011 Hi, I just started on a project with a friend and since we both do PHP, we both work on the site. We're running the site and as we progress with developing new features we will implement them straight away. Do you have any tips for us? Sometimes we work on different parts of the code and my thoughts would be running "developing version"of our site and then share our internal progress there. I've also read something about version control but is that not waste of time compared to the developing version site? All tips is appreciated! Regards Halldor Quote Link to comment https://forums.phpfreaks.com/topic/243334-several-developers-one-site/ Share on other sites More sharing options...
trq Posted July 31, 2011 Share Posted July 31, 2011 You should probably have your own development versions of the site + a testing version. You then commit your changes from your development environments into a version control system which then updates your testing environment. Version control is an essential development tool IMO. Especially if there is more than one developer working on the project. I use version control even when working alone though, it really is an essential tool. Quote Link to comment https://forums.phpfreaks.com/topic/243334-several-developers-one-site/#findComment-1249609 Share on other sites More sharing options...
ignace Posted July 31, 2011 Share Posted July 31, 2011 You should look at the bigger picture here. Once you put your website live, you can't just go and do some live editing since that could ruin a user's experience therefor you need to have your website running locally on your computer with a development database, not the real live database. And patch the online code after you verified it works (be sure to notify your users of a scheduled maintenance and put your website "offline" till all code has been patched (uploaded)). You can put your website "offline" by using an .htaccess to redirect all traffic (expect you) to a maintenance page (be sure to return a proper HTTP status code for any spiders/crawlers on your website to come back later). An SCM (Source Code Management) tool like SVN helps you to merge conflicting files instead of having to do the process manually, in which you may even remove some work of your fellow developer. Other options you have with an SCM tool is to tag a specific release like 0.1, 0.2, .. which is nice if for example if you have a bug since v2.5 and found the root-cause in v2.9, you can then go back (checkout) to v2.5 and commit the fix and your SCM tool will internally patch all code till the latest version 2.9 (imagine doing that manually). Which you'll thank your SCM for many times if you have a customer running on an older codebase. Another great option SCM provides you with is branches. This is specifically great if for example you want to implement a new feature but you don't want to hinder bug fixes. So you can develop the new feature while bug fixes can be released on a regular basis. Once your feature is complete you merge it back to the main codebase and resolve any conflicts. Quote Link to comment https://forums.phpfreaks.com/topic/243334-several-developers-one-site/#findComment-1249719 Share on other sites More sharing options...
Halldor Posted July 31, 2011 Author Share Posted July 31, 2011 Version control is an essential development tool IMO. Thanks for your reply. I'll try to see if I can figure something out. Do you use any specific software? Or "just" by programmers comments in the code? And patch the online code after you verified it works (be sure to notify your users of a scheduled maintenance and put your website "offline" till all code has been patched (uploaded)). You can put your website "offline" by using an .htaccess to redirect all traffic (expect you) to a maintenance page (be sure to return a proper HTTP status code for any spiders/crawlers on your website to come back later). This was exactly what I was thinking, although I needed words to say it. It shouldn't take long time to implement news systems as it is now, since it's typically 50 lines of code and if we know which lines to paste it to. An SCM (Source Code Management) tool like SVN helps you to merge conflicting files instead of having to do the process manually, in which you may even remove some work of your fellow developer. Other options you have with an SCM tool is to tag a specific release like 0.1, 0.2, .. which is nice if for example if you have a bug since v2.5 and found the root-cause in v2.9, you can then go back (checkout) to v2.5 and commit the fix and your SCM tool will internally patch all code till the latest version 2.9 (imagine doing that manually). Which you'll thank your SCM for many times if you have a customer running on an older codebase. It's sounds too good to be true. If it can do that, well then it should be the solution. Now I can search for such solutions, thanks. Also thanks to you. I'm really getting excited to begin. I was looking for inspiration and something specific I can search for. Now I know what to look after. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/243334-several-developers-one-site/#findComment-1249748 Share on other sites More sharing options...
trq Posted July 31, 2011 Share Posted July 31, 2011 Do you use any specific software? Or "just" by programmers comments in the code? I use Subversion at work (well I actually use a git wrapper around subversion - but I won't go into that) and Git at home. Git is the one I would recommend. See http://git-scm.com/ Quote Link to comment https://forums.phpfreaks.com/topic/243334-several-developers-one-site/#findComment-1249750 Share on other sites More sharing options...
ignace Posted July 31, 2011 Share Posted July 31, 2011 Git is a great tool except it does not run out-of-the-box under Windows (which is I think your main OS), so you'll either need Cygwin or msysgit. Neither are advisable if you have never used Linux or the Windows CLI before. Subversion is only an option if you have a live SVN server running otherwise you won't even be able to do the basics: commit source code. Some server hosts provide SVN hosting but not many do. You can find a free Subversion host at Unfuddle and download TortoiseSVN to have nice GUI to work with SVN. All commits you do are against the SVN server so this may become a bottleneck if the commit is quite large since you can't use SVN until the commit is complete. Another great option on the market is Mercurial (which comes pre-bundled with TortoiseHG). Mercurial is like Git a distributed SCM and all commits are done against your local copy, which is fast and there is no need for a server. However in order to collaborate both developers have to be online at the same time so you can push your changes and pull their changes (and resolve any conflicts in the process). This is of course becomes a problem if you aren't always online when the other developers are so for that you'll still have the strengths of Mercurial but you'll also need a server to push your changes to (BitBucket being one of these). Now you can work any time you like as do the other developers and they push their changes to BitBucket and pull your changes. So Mercurial gives you a little more flex than Subversion does as you can commit while offline and push your changes whenever you get the chance to be online. Pick whatever suits you best and if you are in for adventure give Git a try Quote Link to comment https://forums.phpfreaks.com/topic/243334-several-developers-one-site/#findComment-1249796 Share on other sites More sharing options...
Halldor Posted July 31, 2011 Author Share Posted July 31, 2011 ... Windows (which is I think your main OS)... This is not correct, although I'm using a Windows computer now, it's not my main. I do the most tasks on my Ubuntu computer (also programming). Thank you both. I think Git is too big a mouthful for us rookies, and the other developer isn't using Linux. I was afraid from the beginning that your advices was too hard to implement in real life for us. After all it's a small project. I will promise you to give it a try Quote Link to comment https://forums.phpfreaks.com/topic/243334-several-developers-one-site/#findComment-1249869 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.