Codeigniter Datamapper ORM php 7 static issue Codeigniter Datamapper ORM php 7 static issue codeigniter codeigniter

Codeigniter Datamapper ORM php 7 static issue


I have the same problem. To fix it, try to add new protected static method

protected static function get_config_object() {    $CI =& get_instance();    return $CI->config;}

then delete or comment the lines 6474 and 6481 (in _dmz_assign_libraries, where values are assigned to $this->config),

and finally replace all calls $this->config with self::get_config_object()

It should run correctly now.


Try to suppress error with @, eg:

@$this->config =& $CI->config;


I faced the same problem.

FIX: Replace the actual datamapper.php library version with the latest one.

As mentioned in the official library website

Latest library version (1.8.3-dev) - source: https://github.com/saekort/datamapper/blob/master/application/libraries/datamapper.php