How to upgrade from 1.1.5 to 1.1.6

Hi All

I’ve a question about upgrading from 1.1.5 to 1.1.6

Let assume I’ve install yii at location X and my webapp at location Y

$> /X/framework/yiic webapp /Y

From the upgrade instruction, you should replace the ‘X/framework’ directory. How does that effect my webapp?

What I tried next was, I executed the above command again and copied some files back from my backup, which doesn’t sound right.

I get the feeling I’m missing something obvious here!

cheers

Luca

If your webapp is not under framework directory (it should not be there) you just need to replace framework directory with new one without any changes to your application and check if everything works.

Create a copy of the previous framework first (maybe rename X with X_1.1.5), then copy the new version to the same directory and rename it X. That’s it! No need to execute the yiic webapp command again. Just verify it everything in your web application works fine.:)

Check the changelog and see if there’s a feature that may affect your web app.

thanks for the replies!

The webapp is not in the framework directory, so how does the replacement of the ‘framework’ directory effect my webapp environment. As an example, in my webapp/protected directory there is this yiic file, which if I execute it gives the following


webapp/protected$> ./yiic

Yii command runner (based on Yii v1.1.5)

Usage: ./yiic <command-name> [parameters...]


The following commands are available:

 - message

 - shell

 - webapp


To see individual command help, use the following:

   ./yiic help <command-name>



Should I symlink this file to …/yii-1.1.6/framework/yiic ?

This is normally the one and only line in the start script (index.php) you’ll need to adjust, if you change the framework directory or move the application somewhere else.




// change the following paths if necessary

$yii=dirname(__FILE__).'/../Yii-11svn/framework/yii.php';



Edit: I was wrong about the one and only file. You’ll also need to edit the yiic command the same way.

/Tommy

From your reply I get the impression that you only have to change the paths if the framework directory changes. If I look in both yiic.php and index.php I see:

yiic.php:


<?php


// change the following paths if necessary

$yiic=dirname(__FILE__).'/../../../software/yii-1.1.5.r2654/framework/yiic.php';

$config=dirname(__FILE__).'/config/console.php';


require_once($yiic);



index.php:


<?php


// change the following paths if necessary

$yii=dirname(__FILE__).'/../../software/yii-1.1.5.r2654/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';

....



So you always have to replace both paths, which, and correct me if I’m wrong, is not mentioned anywere in the upgrade documentation!?

cheers

luca

In my opinion upgrading normally is done by renaming the current Yii (or framework) directory and adding a new one of the same name (e.g. Yii or framework since that’s the only directory needed in production). But I agree, what we discussed in this thread could well be explained in the documentation (or perhaps in a wiki article).

As a feature request I would suggest that a file indicating the actual Yii version should be added to the framework directory.

Edit: First sentence of first paragraph, "renaming or recreating a symbolic link"

/Tommy

You can get version by calling Yii::app()->version… or just look at the source code of YiiBase::getVersion.

If this is the way you name your Yii framework folder, indeed there’s a need to manually change the file paths of both index and yiic files EVERYTIME you upgrade your framework files. If I may suggest, create a folder and name it like ‘YiiFramework’ or ‘Yii’ or whatever makes you happy, then put in there the framework base files. Point your index and yiic to your created folder, and that will be the last time you will edit your index and yiic. For future versions of Yii, just replace the framework files with the new version, and your good to go.:)

Another options is to hold the framework updated with svn, so you can have the lastes version with a single click

ok, I see, my mistake. But I have to add that this is a little bit confusing. Also, what if I had a couple of websites all based on yii (same version). Upgrading one would automatically mean that all of them should be upgraded.

Wouldn’t it be better to let yiic manage the upgrade process. So you install somewhere the new yii software and run (in your webapp): ‘./yiic upgrade’, it will ask for the directory of the new yii software and it can verify compatibility issues.

cheers

btw: I really like yii (I’m using it now for a couple of days) and this is a very active/helpful forum!!!

Well, if you have a couple of websites, then you might want to consider having multiple folders for the versions of Yii. Say, website A will connect to Yii framework 1.1.5 in the folder named X, website B will use folder Y which uses folder version 1.1.4, and website C to use the latest framework in the folder Z. In this way, each websites will not be affected with the changes in every release (Yii framework only consumes around 15MB of disk space, very small price to pay :))

That’s something to consider. But I think it would be better to update their framework folder manually so as to avoid any further complications. In my opinion, if yiic update will be done, it might cause a dozen of topics in this forum complaining on the new feature. If I’m to be asked, I would like the developers of Yii to focus on fixing the bugs and make major enhancements for the framework.

I couldn’t agree more :) This is me returning the favor I got from this very community: helping those I can help. Because of this community, I was done finally with my first Yii application (with good remarks from my boss because I’m the one who introduced Yii to our company), and already planning for the second ;)

Let me thank the community for the great support. I made an upgrade of my Yii version from 1.1.4 to 1.1.7 just now, and it was a quick one. I simply edited the following line in the index.php of my project:

… before editing,





$yii=dirname(__FILE__).'/../yii-1.1.4.r2429/framework/yii.php';




… after editing,





$yii=dirname(__FILE__).'/../yii-1.1.7.r3135/framework/yii.php';




Hope this helps.