Difference between #2 and #3 of
Use phing to make Yii application "installable"

Revision #3 has been created by Maurizio Domba Cerin on May 22, 2012, 10:47:19 AM with the memo:

fixed typos
« previous (#2) next (#4) »


Title changed

Use phing to make ourYii application "installable"

Category unchanged


Yii version unchanged

Tags unchanged


Content changed

To use this "how-to", you need to install [phing](http://www.phing.info/trac/ "phing") in your machine. I want to show you a little example that allows me to configure gii password and database informations, with phing. First of all, when I start a new yii application, I copy protected/config/main.php in protected/config/main.php.dist, and updating some field like ...: ```php 'db' => array(     'emulatePrepare' => true,
'connectionString' => 'mysql:host=[[hostname]];dbname=[[database]]',             'emulatePrepare' => true,
'username' => '[[username]]',          'password' => '[[password]]',          'charset' => 'utf8',         ), ``` Also, I like alsto set gii configuration in this way: ```php 'gii' => array(          'class' => 'system.gii.GiiModule',          'password' => '[[giipassword]]',          'ipFilters' => array('', '::1'),         ), ``` Now, myMy complete config(.dist) file looks like this:

Now I can create build.xml and put
it inside this content:

And now, I can run

$ phing  

The output will be similar to this:

As you can see, some questions will be aske
t tod from you. Your answers will be override main.php.dist file options when copying it into main.php. And
This is just a simple example of how
you can install your application using this easy way. This is just a simple examplemethod. You can also, for example, create your own console command and call them with phing.
7 0
Viewed: 10 116 times
Version: 1.1
Category: How-tos
Tags: phing
Written by: sensorario
Last updated by: Maurizio Domba Cerin
Created on: May 22, 2012
Last updated: 5 years ago
Update Article


View all history