Revision #3 has been created by Maurizio Domba Cerin on May 22, 2012, 10:47:19 AM with the memo:
« previous (#2) next (#4) »
Use phing to make
our application "installable"
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 allow
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
updating some field like
'db' => array(
'connectionString' => 'mysql:host=[[hostname]];dbname=[[database]]',
'emulatePrepare' => true,
'username' => '[[username]]',
'password' => '[[password]]',
'charset' => 'utf8',
o set gii configuration in this way:
'gii' => array(
'class' => 'system.gii.GiiModule',
'password' => '[[giipassword]]',
'ipFilters' => array('127.0.0.1', '::1'),
Now, my config(.dist) file looks like this:
Now I can create build.xml and put inside this content:
[...]And now, I can run
The output will be similar to this:
As you can see, some questions will be aske
you. Your answers will
override main.php.dist file
you can install your application
easy way. This is just a simple example
You can also, for example, create your own console command and call them with phing.