I know that I can save all my projects files into repository so deployment of new version of software become only using svn export into properly directory.
But I have a feeling that it is not right way and for media files I should use some other utilities for deployment like rsync. But it is also a problem with double-side sync = I like to keep backup of full projects into some security space (not only live server).
So main question is what is the right way and project’s directory structure for web-application in PHP?
I know that I can save all my projects files into repository so deployment
Share
Ehh, a complex one.
First of all, if you have such possibility, it’s good to split ‘code’ and ‘web’ part. Something like that.
This gets PHP out of web root. It’s safer (attacer will not be able to access your files by entering URL in browser). BUT – this requires appropriate application design (for example Symfony framework gives you similar layout).
Second thing – there’s nothing wrong (in my opinion) with binary files inside SVN repo. It all depends, though, what files we are talking about. If not user-uploaded content – go ahead. The less complex is deployment, the less chance something goes wrong.
BTW: You can always opt-out some folders contents from svn so user files won’t mess up with your files.
So one thing you have to keep in your design is to separate user entered content of your content (the best is to create special folders for users and opt them out SVN).