Code snippets for symfony 1.x


Refine Tags

Snippets tagged "installation"

Install symfony from subversion

You may disregard this snippet if you are working with a recent version of symfony. Installing symfony is now very straightforward, even from subversion.

The problem

I had to install symfony via subversion several times and it is a pain because the paths to several key files are to be manually changed in the files coming from the svn install. I prefer the subversion install over the pear beta install because i often have to fix bugs and patch things here and there in the symfony code.

The solution

1. svn checkout the symfony code somewhere on your server

2. Choose two distinct folder accessible from php where you will put the data and lib folders. Let us call those folders «DATA» and «LIB».

3. Make symbolic links of the data and lib directories inside those two folders. The following command is to be issued from the freshly checked out symfony folder:

ln -s data «DATA»/symfony
ln -s lib «LIB»/symfony

4. Put the following file inside the bin folder:

PEAR_DIR= «PAKE» #put here the path to pake.php
DATA_DIR= «DATA» # here is the path to the alias of the symfony data directory
SYMFONY_DIR= «LIB» # here is the path to the alias of the symfony lib directory 
SVN_VERSION=svn # this does not matter
sed -i '' -e "s#@PEAR-DIR@#${SYMFONY_DIR}/bin#g"
#sed -i '' -e "s#@PEAR-DIR@#${PEAR_DIR}#g" symfony.bat
sed -i '' -e "s#@PEAR-DIR@#${PEAR_DIR}#g" -e "s#@DATA-DIR@#${DATA_DIR}#g" -e "s#@SYMFONY-VERSION@#${SVN_VERSION}#g"  symfony.php
sed -i '' -e "s#@PEAR-DIR@#${PEAR_DIR}#g" -e "s#@DATA-DIR@#${DATA_DIR}#g" -e "s#@SYMFONY-VERSION@#${SVN_VERSION}#g" ../../lib/pear.php

5. Execute that file. You should be ready to use symfony

Additional remarks

by Olivier Verdier on 2006-08-24, tagged installation  svn 

Create your own symfony PEAR package

Sometimes, you want to create your own symfony PEAR package from the current trunk or from a particular branch. Or perhaps you did a checkout of the trunk and did some changes.

It's very simple to create your own PEAR package from such a directory:

pake release 0.8.1 stable

and pake will create a symfony PEAR package with the version 0.8.1.

You will now be able to install this with the pear command line tool:

pear install symfony-0.8.1.tgz
by Fabien Potencier on 2006-08-23, tagged installation  package  pear 
(1 comment)