Difference between #1 and #4 of
Use phing to make Yii application "installable"

Changes

Title changed

Use phing to make ourYii application "installable"

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

phing

Content changed

To use this "how-to", you need to install [phing in your machine. [Phing](PHing Is Not GNU make; it's a PHP project build system or build tool based on  Apache Ant. "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,
 
    'charset' => 'utf8',
 
'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('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 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
10 followers
Viewed: 15 118 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: 12 years ago
Update Article

Revisions

View all history