Use phing to make ourYii application "installable"
Content
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,
'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('127.0.0.1', '::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 asket 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.