Thanks for trying out phocoa!
I use svn as well for all of my development, and the directory setup
for phocoa was specifically set up to be very compatible with svn use.
Each project has an "outer" and an "inner" project directory:
project/
project/log
project/runtime
project/project
The inner "project/project" directory should be put in your SVN
repository. The outer one contains the "non-versioned" resources.
For dealing with dev/staging/production setups, I do that all inside
the project/project/conf directory.
I create multiple versions of each conf file for each deployment
scenario:
$ ls -al conf/
total 76K
drwxr-xr-x 3 apinstein apinstein 4.0K Jan 9 16:51 .
drwxr-xr-x 10 apinstein apinstein 4.0K Jan 16 15:07 ..
lrwxrwxrwx 1 apinstein apinstein 15 Nov 2 2006 httpd.conf ->
httpd.conf-prod
-rw-rw-r-- 1 apinstein apinstein 4.2K May 10 2007 httpd.conf-dev
-rw-rw-r-- 1 apinstein apinstein 2.7K May 10 2007 httpd.conf-prod
lrwxrwxrwx 1 apinstein apinstein 22 Oct 25 2006 showcase-conf.php
-> showcase-conf.php-prod
-rw-rw-r-- 1 apinstein apinstein 825 Feb 12 2007 showcase-conf.php-
dev
-rw-r--r-- 1 apinstein apinstein 833 Sep 9 2006 showcase-conf.php-
prod
lrwxrwxrwx 1 apinstein apinstein 16 Oct 25 2006 webapp.conf ->
webapp.conf-prod
-rw-r--r-- 1 apinstein apinstein 3.5K Jan 9 16:51 webapp.conf-dev
-rw-r--r-- 1 apinstein apinstein 3.5K Jan 9 16:51 webapp.conf-prod
Then I use symbolic links so that I don't have to reconfigure the
application; just set up a few symlinks that are safe as I update
production code with svn or svn exports.
This setup gives me flexibility to run my apps on any server just by
having an extra set of config files.
Also, you'll notice in webapp.conf that there is a PHP define for
IS_PRODUCTION that I also use throughout my code to toggle other
settings. I also add extra configuration stuff to webapp.conf such as
include_path, defines for paths to executables, or anything else that
varies by deployment environment.
Over the last 3 years of PHOCOA apps in production I've found it to
work quite well.
Hope that helps,
Alan
I have installed apache+php5+postgres with "port" (MacPorts). I then
added the "syck" library via PECL for better YAML parsing performance.
I actually run 2 web servers since I still do some php4 stuff, so I
run all my phocoa projects on port 8080. I set up a single IP with a
few additional commands:
Listen 8080
NameVirtualHost 10.0.1.201:8080
Then, I just "include" each conf file for each phocoa project:
Include /Users/alanpinstein/dev/sandbox/iphone/iphone/conf/httpd.conf
Include /Users/alanpinstein/dev/sandbox/phocoadev/phocoadev/conf/
httpd.conf
When you run the "phocoa newProject" command, it will create an
httpd.conf file for your project.
Whenever I create a new project, you just have to "/opt/local/apache/
bin/apachectl graceful" to get apache to see the new project.
I actually just had to go through this whole process again myself as
I re-set up a laptop from scratch. It helped me clean up a few
things. Previously it required more changes to loosen security to the
main httpd.conf file, so I updated the phocoa-generated httpd.conf
files to be compatible with the more secure setup.
Make sure you re-download the very latest phocoa (I just re-published
it now...). It should make things smoother.
I also just recently deprecated the use of the spyc library because
of compatibility problems, and switched to the Horde/YAML pear
library for YAML parsing, which seems to be much more compatible. The
new version has that stuff in it as well.
If you run into any problems, LMK. I am trying to make the phocoa
install as seamless as possible and want to help people work out any
issues.
Alan