Blog

Symfony Deploy Script

Aug 25, 2009
Category:Symfony 

I've just started using the PHP framework, Symphony, after putting it off for far too long!

This seems to be the way to download and deploy symfony, and I'm sure I'm going to want to do it again so I took notes, here they are: ;)

cd PROJECT DIR
mkdir -p lib/vendor
cd lib/vendor/
curl -O http://www.symfony-project.org/get/symfony-1.2.8.zip || wget http://www.symfony-project.org/get/symfony-1.2.8.zip
unzip symfony-1.2.8.zip
mv symfony-1.2.8 symfony
rm symfony-1.2.8.zip
cd ../..
php lib/vendor/symfony/data/bin/check_configuration.php
#nano /etc/php.ini


Thats pretty standard as far as I can tell, you may want to update the version numbers at some point and I've had to fall back to curl as my hosting company doesnt include wget. This first block can most likley be ran as a script to get symfony setup. The following blocks of commands will probably need a bit more thought and changing some paramaters and config files. There are here for me only as a cheat sheet really.

Next creating the project, frontend and configuring the database:

php lib/vendor/symfony/data/bin/symfony generate:project NAME
php symfony generate:app --escaping-strategy=on --csrf-secret=SECRET frontend
php symfony configure:database "mysql:host=localhost;dbname=DBNAME" DBUSER DBPASS
#edit schema or build it
php symfony propel:build-schema
#edit test data or dump it
php symfony propel:data-dump > data/fixtures/test.yml


Now to build everything + an app and a module

php symfony propel:build-all --no-confirmation
php symfony cache:clear
php symfony propel:data-load
php symfony propel:generate-module --with-show --non-verbose-templates APPNAME MODULE-NAME MODEL-NAME
php symfony propel:generate-admin APP MODEL-NAME --module=MODULE-NAME


I'll also list any useful sites I come across while learning symfony




Comments