ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

PHP Symfony 1.2 project in 10min

Updated on June 09, 2009

Background

This has been a love-hate relationship. Symfony is a wonderful framework to work with, getting your head round it the first few days is a bit of a learning curve, a well rewarding learning curve. Even though Symfony is very well and thoroughly documented finding something 'quickly' can get frustrating. In an attempt to ensure I have another copy of this available for whatever reason, I decided to provide my general setup and help lines here.

Already setup

I have Symfony installed via the PEAR classes as an application on my servers. This is to install with Doctrine plugin

Quick and dirty

Make directories

# mkdir /path/to/www/name
# cd /path/to/www/name

Create project

# symfony generate:project name

Create a an application

#symfony generate:app --escaping-strategy=on --csrf-secret=my_Password_I_Want_to_u5e frontend
 

Edit _dev file

remove the 127.0.0.1 limitation

/path/to/www/name/web/name_dev.php
  

Add to webserver

domain -> /path/to/www/name/web/

Enable Doctrine

* edit config/ProjectConfiguration.class.php replace sfPropelPlugin with -> sfDoctrinePlugin * must clear cache after change

# symfony cc

Remove Propel files

# rm web/sfPropelPlugin
# rm config/propel.ini
# rm config/schema.yml
# rm config/databases.yml


Add Doctrine files

# mkdir config/doctrine
# symfony plugin:publish-assets

Add and create database

# mysqladmin -u mysqlUser -p create myDatabase
# symfony configure:database --name=doctrine --class=sfDoctrineDatabase "mysql:host=localhost;dbname=myDatabase" mysqlUser mysqlPassword


Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    Click to Rate This Article