I want to extend the EE_Loader class in ExpressionEngine 2, without hacking at core EE (or CI) code.
I tried to follow the advice from Simon Emms' blog which would be a clean way to extend CI_Loader, and follows the standard convention for extending a CI class.
I've tried adding a EE_Loader.php
file within codeigniter/system/core/
, which is where CI_Loader (in file Loader.php
) lives. My subclass_prefix is 'EE_' because I'm using ExpressionEngine so I'm confident with the filename being used, but it's not reading in the new file.
Has anyone been successful in extending ExpressionEngine's EE_Loader class? Any pointers would be appreciated.
To provide some background, I have written a PHP Session handler which writes to MySQL, using Active Record to form my queries. It will be used in a web cluster so I need to share sessions. I have considered using a NFS file, memcached, redis and MySQL solutions. MySQL is already in use, will perform well and provides a centralised store.
After reading the session data from the DB, I make another call to write to the DB, but I get a "deprecated" warning:
A PHP Error was encountered
Severity: 8192
Message: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.
Filename: mysql/mysql_driver.php
Line Number: 319
I also get the same message when I use the mysqli driver.
It's happening because $this->conn_id
becomes false between 2 queries. I don't know why.