EllisLab/CodeIgniter — pull request #1403 by cryode (2012-05-28 00:18:23+00:00)
Title: Fix issue where cache backup is ignored on first call.

This is a (potential) fix to the issue where the backup Cache driver is not used upon the first request, resulting in errors related to the primary adapter. Based on the existing code, the error is likely to only happen on the first call, since it is corrected at that point. But obviously that doesn't do us any good now does it? :)

Reference issues: #146, #456

I don't know why the other recommends suggest fixing this in a place other than the constructor. Someone referenced `_initialize()` but that doesn't seem to be utilized anymore.

This fix assigns the "dummy" adapter as the default backup automatically when the property is declared. It then does the config assignments, and finally verifies if the primary and backup adapters are supported.

The original `is_supported()` check was done in the `__get()` magic method defined in Cache.php. I removed it entirely since, aside from the support check, all it did was return `parent::__get()`.

Curious what people think regarding the log message level (error or debug?). Also would be nice if others could verify it works with them.