yiisoft/yii — pull request #2432 by alexgt9 (2013-04-30 18:38:28+00:00)
Title: Implements delete cache by tag Issue #305

Implements the option to delete cache depending with a tag.
Added new CTagCacheDependency class that recives an array with the tags related.

And a method added to CCache, "deleteByTag" that delete all caches related with the tag.

This work with tag version. When a cache is set with tag dependency, it saves the actual version of each tag, initialy 1, then if you deleteByTag a especified tag, the version of that tag is incremented and invalidate all caches related with that tag.

Example te set dependency
```php
Yii::app()->cache->set( 'any_id', 'value', 0, new CTagCacheDependency( array( 'post', 'user' ) ) );
```

Deleting a tag
```php
Yii::app()->cache->deleteByTag( 'user' );
```