| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2.0625 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 96 | function database($params = '', $return = FALSE, $active_record = NULL) { |
|
|
|
|||
| 21 | // load our version of the CI_DB_Cache class. The database library checks |
||
| 22 | // if this class is already loaded before instantiating it. Loading it now |
||
| 23 | // makes sure our version is used when a controller enables query caching |
||
| 24 | 96 | if(!class_exists('CI_DB_Cache')) { |
|
| 25 | @include(APPPATH . 'libraries/MY_DB_cache.php'); |
||
| 26 | } |
||
| 27 | |||
| 28 | // call the parent method to retain the CI functionality |
||
| 29 | 96 | return parent::database($params, $return, $active_record); |
|
| 30 | } |
||
| 31 | } |
||
| 32 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.