Development Workstation Setup

1 view
Skip to first unread message

Errol Sayre

unread,
Jan 16, 2008, 5:51:04 PM1/16/08
to phocoa users
I'm new to Phocoa (and generator based frameworks in general) and am
looking for some hints as to how you setup your development workspace
for building Phocoa apps.

I'm very committed to using subversion and don't necessarily want to
deal with MySQL on my local machine but it appears as though that's
the way Alan works in the blog demo screencast...

How does everyone do their setup? Do you run development on your local
machine with a database? Do you setup any custom Apache VHOSTS or
something to host your projects directly from your document space?

Thanks for the help,

Errol

Alan Pinstein

unread,
Jan 16, 2008, 7:42:12 PM1/16/08
to phocoa...@googlegroups.com
Hey Errol-

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

Errol Sayre

unread,
Jan 17, 2008, 9:04:32 AM1/17/08
to phocoa users
Thanks for the notes Alan. How about you're development setup... do
you have a local install of Phocoa running on your machine for all the
Phocoa commands? If so, how do you have Apache configured on your Mac
(I assume you're using a Mac ;-) to serve up your development
directory?

Alan Pinstein

unread,
Jan 17, 2008, 9:26:03 AM1/17/08
to phocoa...@googlegroups.com
Yes, I use a Mac for development.

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

Reply all
Reply to author
Forward
0 new messages