yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.91k forks source link

"Off serializer of cache" causes errors. #12188

Closed githubjeka closed 8 years ago

githubjeka commented 8 years ago

If serializer of cache is off then value for cache is array.

It's wrong for value of Cache::setValue()

SilverFire commented 8 years ago

However ApcCache, ArrayCache, XCache and WinCache support saving arrays and even objects without serialization.

The only thing that seems right to me:

githubjeka commented 8 years ago

And what about Redis/DbError errors?

samdark commented 8 years ago

Technically we can introduce exceptions for the case but since cache should be as fast as possible and these extra checks could slow it down, I'm not sure if these checks are worth adding.

SilverFire commented 8 years ago

Agreed with @samdark

@githubjeka Would you like to submit a PR with PHPDoc updates?

githubjeka commented 8 years ago

Ready,

SilverFire commented 8 years ago

https://github.com/yiisoft/yii2/commit/3ce36573b69c2c7df51f4ca5b128221e0626887e