Problem
When I updated the CodeIgniter 2.2.0 application to use the database drivers mysqli, it violated the CodeIgniter backup function of the database utility class . Where I used to successfully get a database backup, now I get an error message ...
Unsupported feature of the database platform used.
The error simply means that the CodeIgniter backup function from the Utility Database class is not supported mysqli. According to online docs, only MySQL is supported.
However, I prefer not to use an outdated database driver mysql.
Possible workaround (not allowed) :
I thought I could solve this by simply expanding the CodeIgniter Database Utility class. However, CodeIgniter does not allow this according to the documentation ...
Note. Database classes cannot be extended or replaced with your own classes.
Another way (fatal error) :
EDIT: My answer and accepted answer are based on this workaround.
This GitHub page describes a method for extending a database class by creating a class MY_Loaderfor kernel extension.
https://github.com/bcit-ci/CodeIgniter/wiki/Extending-Database-Drivers
However, when I tried this solution, I got this fatal error ...
File name: core / MY_Loader.php, Line number: 49
: undefined CI_DB_mysqli_driver:: where() /home/account/codeigniter/system/libraries/Session.php 217
49: $db =& new $my_driver(get_object_vars($db));
MY_Loader , , MY_DB_mysqli_utility :
<?php class MY_DB_mysqli_utility extends CI_DB_mysqli_utility {
function __construct($params){
parent::__construct($params);
log_message('debug', 'Extended DB driver class instantiated!');
}
function _backup($params = array())
{
.....
}
}
( , GitHub , , - , , CI_DB_mysqli_utility CI_DB_mysqli_driver.)
EDIT: , _driver, _utility... .
( ):
, , SystemIgniter. .
"" , system/database/drivers/mysqli/mysqli_utility.php, :
function _backup($params = array())
{
return $this->db->display_error('db_unsuported_feature');
}
Ellis Lab, , ...
https://ellislab.com/forums/viewthread/194645/
, _backup.
function _backup($params = array())
{
.....
}
, /?
CodeIgniter mysqli, CodeIgniter Database, , . , , , , , - - , .
. , CodeIgniter v3 mysqli.