Development

HowToDevelopMultipleVersions

You must first sign up to be able to contribute.

Version 3 (modified by synace, 11 years ago)
yourproject path more obvious

In order to develop a branch of symfony, you will need to be able to run it, and run a test project with it.

First, create a working directory, in which your symfony checkout, and your test projects will go.

mkdir /path/to/your/working_directory
cd /path/to/your/working_directory

Checkout your branch into a new directory on your server.

mkdir /path/to/your/working_directory/symfony
cd /path/to/your/working_directory/symfony
svn checkout http://svn.symfony-project.com/branches/xxxxxx

Now, edit the following files:

/path/to/your/working_directory/symfony/bin/symfony.sh

#!/bin/sh
#
# Shell wrapper for symfony (based on Phing shell wrapper)
# $Id: symfony.sh 500 2006-01-23 09:15:57Z fabien $
#
# This script will do the following:
# - check for PHP_COMMAND env, if found, use it.
#   - if not found assume php is on the path
# - check for SYMFONY_HOME env, if found use it
#   - if not look for it
# - check for PHP_CLASSPATH, if found use it
#   - if not found set it using SYMFONY_HOME/lib

SYMFONY_HOME="/path/to/your/working_directory/symfony/bin"
PHP_CLASSPATH="/path/to/your/working_directory/symfony/lib"
export PHP_CLASSPATH

if (test -z "$PHP_COMMAND") ; then
  # echo "WARNING: PHP_COMMAND environment not set. (Assuming php on PATH)"
  export PHP_COMMAND=php
fi

$PHP_COMMAND -d html_errors=off -qC $SYMFONY_HOME/symfony.php $*

/path/to/your/working_directory/symfony/bin/symfony.php

Index: symfony.php
===================================================================
--- symfony.php	(revision 1651)
+++ symfony.php	(working copy)
@@ -6,8 +6,8 @@
 }
 
 // define some PEAR directory constants
-define('PAKEFILE_LIB_DIR',  '@PEAR-DIR@');
-define('PAKEFILE_DATA_DIR', '@DATA-DIR@');
+define('PAKEFILE_LIB_DIR',  '/usr/share/pear');
+define('PAKEFILE_DATA_DIR', '/usr/share/pear/data');
 define('PAKEFILE_SYMLINK',  false);
 define('SYMFONY_VERSION',   '@SYMFONY-VERSION@');

/path/to/your/working_directory/symfony/lib/pear.php

Index: pear.php
===================================================================
--- pear.php	(revision 1651)
+++ pear.php	(working copy)
@@ -1,7 +1,7 @@
 <?php
 
-$sf_symfony_lib_dir  = '@PEAR-DIR@/symfony';
-$sf_symfony_data_dir = '@DATA-DIR@/symfony';
+$sf_symfony_lib_dir  = '/path/to/your/working_directory/symfony/lib';
+$sf_symfony_data_dir = '/path/to/your/working_directory/symfony/data';
 $sf_version          = '@SYMFONY-VERSION@';
 
 return 'OK';

Now, inside your working directory make a new directory called "project"

mkdir /path/to/your/working_directory/yourproject
cd /path/to/your/working_directory/yourproject

Link the symfony shell script to a local file 'symfony', for easy access from within the project directory and make the symfony.sh executable.

ln -s /path/to/your/working_directory/symfony/bin/symfony.sh symfony
chmod a+x /path/to/your/working_directory/symfony/bin/symfony.sh 

Make sure you're using the proper version now.

./symfony -V
symfony version @SYMFONY-VERSION@

Create a folder and Initialize the project

mkdir /path/to
./symfony init-project yourproject

Create symlinks for the lib and data dirs.

cd /path/to/your/working_directory/yourproject/lib
ln -s /path/to/your/working_directory/symfony/lib symfony

cd /path/to/your/working_directory/yourproject/data
ln -s /path/to/your/working_directory/symfony/data symfony

Make the log and cache directories writable

chmod 0777 -R /path/to/your/working_directory/yourproject/logs
chmod 0777 -R /path/to/your/working_directory/yourproject/cache

Create your application

./symfony init-app yourapplication

You now have a project and application running under your checked out version of symfony.

Configure apache to use the /path/to/your/working_directory/yourproject/web directory as the document root and open your browser to the page.