JCSama / CodeIgniter-develbar

CodeIgniter Developer Toolbar is a third party library based on Profiler Library with additional functionality for debugging and optimisation, Database, Models, Helpers, Libraries, Views, Ajax...
MIT License
176 stars 57 forks source link

Working with PDO gives error. #25

Closed yahyaerturan closed 6 years ago

yahyaerturan commented 6 years ago

Hi, I am using PDO driver in Codeigniter 3.x. When I enabled DevelBar, it throws an error:

error: {type: "PDOException", message: "You cannot serialize or unserialize PDO instances",…}
    file: "/system/libraries/Cache/drivers/Cache_file.php"
    line: 104
    message: "You cannot serialize or unserialize PDO instances"
    type: "PDOException"

How can I fix it? Thanks for any help.

JCSama commented 6 years ago

Hello @yahyaerturan I think this error is related to your PHP version and some overriding on PDO driver. can you give me more details !

yahyaerturan commented 6 years ago

Sure. I am working with PHP 7.1 - When I set my Codeigniter to use Mysqli, CI and Develbar works like a charm. When I switch to use pdo, CI works but Develbar gives upon error. I don't know what more details I can provide.

JCSama commented 6 years ago

Hello @yahyaerturan Can you try again with using my latest commit ? Keep me posted ^^

yahyaerturan commented 6 years ago

Hello @JCSama. Now it is working with PDO as well, thanks! Sorry for late response. As I made some minor changes on my copy, I had to apply all the changes line by line to test if it is working 👍

JCSama commented 6 years ago

@yahyaerturan, No problem and thank you for reporting this error 👍 If you have some new ideas or you wanna contribute to improve this extension, please don't hesitate.