Extend the Database Driver Class (in DB_driver) |
07-17-2017, 01:15 PM
(This post was last modified: 07-17-2017, 01:17 PM by Kaosweaver. Edit Reason: copy-paste error typo fixed )
I need replication to be automatic in the framework (someone does a write function, we need it to automatically select the master table and perform the query with a set comment in union with the PHP plug in we're using to accomplish the correct database to query from)
I've modified the DB_driver.php file in CI 3.1.5, however, I'd like to really do this outside of the core file. Quick notes on what we did: The config database.php file has two lines in it in the $db['default'] array PHP Code: 'replication' => TRUE, The DB_driver.php file has an added function (swipped from CI4's DB files) PHP Code: //-------------------------------------------------------------------- And then I modified the simple_query function like so: PHP Code: public function simple_query($sql) I added a MY_DB_drive.php file in the core folder hoping it would work (pulling out the above changes and making it in to an extended class) like so: PHP Code: <?php But that didn't work. Any pointers on getting what I'd like done without editing the core files? |
Messages In This Thread |
Extend the Database Driver Class (in DB_driver) - by Kaosweaver - 07-17-2017, 01:15 PM
RE: Extend the Database Driver Class (in DB_driver) - by skunkbad - 07-17-2017, 04:29 PM
RE: Extend the Database Driver Class (in DB_driver) - by spjonez - 07-20-2017, 05:44 AM
|