Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only variables should be assigned by reference with function

I use old version of Codeigniter framework. With new version of php I am gettings this error: Only variables should be assigned by reference

I am wondering if this is safe bugfix: Changing:

 $this->_base_classes =& is_loaded();

to

$assign = is_loaded();    
$this->_base_classes =& $assign;

Is that the same?

like image 839
user1324762 Avatar asked Jan 22 '17 10:01

user1324762


2 Answers

This is an codeigniter bug in which the old version does not support anymore the mysql.

You can go to file: system/core/Loader.php Then file: system/core/Common.php Line 190 there should be:

//function is_loaded($class = '') >>> Edit this one like the expression below

  function &is_loaded($class = '')

function &is_loaded($class = '')

After that go to file: application/config/database.php and change the following below:

//$db['default']['dbdriver'] = 'mysql'; >>> Edit this one like the expression below.

$db['default']['dbdriver'] = 'mysqli';

I hope it works

like image 59
Orulf.Labay Avatar answered Oct 02 '22 14:10

Orulf.Labay


Please see this url

https://github.com/bcit-ci/CodeIgniter/issues/904

You can go to file: system/core/Loader.php Then file: system/core/Common.php Line 190 there should be:

function &is_loaded($class = '')
like image 31
Md.Jewel Mia Avatar answered Oct 02 '22 16:10

Md.Jewel Mia