Difference between #2 and #3 of
Understanding "Assets"

Revision #3 has been created by qiang on Feb 20, 2011, 2:43:53 AM with the memo:

fixed the upgrading Yii section
« previous (#2) next (#4) »


Title unchanged

Understanding "Assets"

Category unchanged


Yii version unchanged

Tags unchanged


Content changed

* It's important that the directory be writable by the webserver user so that Yii can publish the resources there when needed.
* When a project has multiple versions (production, testing, development, etc.) **do not** copy the `assets/` folders from one area to another; allow Yii to deploy them automatically in each area.
* **Do not** manually edit any file under `assets/` - if you have a real need to make a change, find the publishing module, edit the source, delete the subfolder under `assets/`, and let Yii re-publish the updated files.
* **Do not** reference names under the `assets/` folder directly (say, to get at some other module's assets). If you need to use that
* **Do not** add the contents of the `assets/` folder to any source-code control system; these files have master source in other places.
* It is safe to delete everything under `assets/`. Yii will re-publish the assets if they are not found under `assets/`.
Upgrading Yii ------------- TWhen upgrade instructions to every new release of Yii include the note:
- Clean up your 'assets' folder.
This means to **delete** the contents of this folder (but leave the folder itself behind): Yii will re-deploy these assets from the new versi
ing to a new release of Yii, you do not need to clean up the folders under `assets/`. Yii will automatically re-publish assets to new folders based ons the first time each one is used.
This step is important!
Yii only publishes the resource files if the target unique-name folder does not exist, so if they're not removed during an upgrade, then the new version of the code will use old versions of asset files: this probably matters.
Yii version number. The old folders will remain there and unused.
If you are using the SVN development branch of Yii and find any asset file updated in the Yii framework after SVN update (e.g. `jquery.yiigridview.js` is changed due to a bug fix), you should clean up your `assets` folder so that the updated asset files can be re-published.
45 0
Viewed: 172 891 times
Version: 1.1
Category: Tutorials
Written by: Steve Friedl
Last updated by: GOsha
Created on: Feb 19, 2011
Last updated: 6 years ago
Update Article


View all history