How to create a virtual host

Three quick and simple steps to set up a virtual host:

Step-1: Open the apache conf file. Location of this depends upon the location of your server. Possible location of this file is “/etc/httpd/conf/httpd.conf” or “/etc/apache2/httpd.conf”.

Step-2: Add following settings:

<VirtualHost IP Address:Port(80)> DocumentRoot location of your side root ServerName host name ServerAlias *.host name [...]

Select Custom Column using Propel in Symfony

Sample code to fetch custom columns using propel into symfony

$c = new Criteria(); $c->clearSelectColumns(); $c->addSelectColumn(JokePeer::VOTE); $jokes = array(); $rs = JokePeer::doSelectStmt($c); while ($row = $rs->fetch()){ $joke = new Joke(); $joke-> hydrate($row) ; // hydrate is function that populate data into Object.$jokes[] = $joke; }

This sample code works only with propel 1.3. Use doSelectRS() [...]

How to Create a Cron file into Symfony

Steps to create a cron file with symfony database settings–

Create a Folder batch. Create your cron script file. Add following code on starting of your script. require_once(dirname(__FILE__).’/../config/ProjectConfiguration.class.php’); $configuration=ProjectConfiguration::getApplicationConfiguration(‘frontend’,'prod’,true); sfContext::createInstance($configuration);

The “frontend” is your application.

The script enables you to use all application settings and access all the peer files.