Getting symfony 1.1 Running

I was just thinking, I wrote a blog entry about symfony 1.1, without any guide to getting symfony 1.1 up and running. If you're not sure what you're doing, don't do it! Wait for the official release (or RC, etc) which will no doubt come with docs as well. You'll probably need them.

Note: I don't know how well this will run on Windows. I think it should (from looking at symfony.bat), but your mileage may vary. Cross your fingers, let's jump in!

To get the code, I've been pulling it down from SVN into a local lib directory. Though, there's one thing to think about before we go there.

We need to decide which code to pull down. The most obvious option is to pull down the trunk/ folder, but I've been having some sweet success with the branches/dwhittle/ folder. Among other things, the dwhittle branch has Propel 1.3 support, which I'm clearly an avid fan of (after writing sfPropel13Plugin). It's kept fairly well up to date, so it seems fine.

So, you've chosen a branch, let's pull down the code:

  • Navigate to your local repo: cd /<path to local repo (I have it in /Library somewhere)>/
  • Checkout the code: svn co http://svn.symfony-project.com/branches/dwhittle/ sf11 (or use /trunk if you want to stick to trunk.)
  • (Optional, for convenience. Or else skip ahead to the third last step) Copy the symfony script somewhere useful: cp sf11/data/bin/symfony ~/util
  • Edit the symfony script, and add in your lib dirs: (lines 44 and 45, under the PEAR comment) $sf_symfony_lib_dir = '/<path to local repo>/sf11/lib'; $sf_symfony_data_dir = '/<path to local repo>/sf11/data' ;
  • Run the script! ~/util/symfony - there should the list of Pake tasks
  • Create a new project folder, and cd into it
  • Generate a project! ~/util/symfony generate:project <project name>
  • You should now be able to run symfony and it'll automatically refer to your symfony 1.1 Pake tasks. Success!


From here, you can do the same old tricks, like symlink'ing/svn:externals'ing the symfony libs into lib/vendor/symfony/, and modify config/config.php so you're not referring to the global lib. But that's entirely optional (I only do it because my IDE likes it).

And for you Windows users, if the steps above broke for you, try including the symfony.bat into your util directory, so that Windows has something to execute. It should work, though!

Best of luck!

Tuesday, November 27. 2007

1 Comment