Mengatasi Error dari PHP 5.2 ke 5.3
Ada beberapa syntax koding di PHP 5.2 di ganti di php 5.3 biasa nya akan muncul error DEPRECATED yang artinya fungsi atau command tsb sudah tidak di gunakan lagi di fungsi PHP yang terbaru.
berikut beberapa error yang terjadi
Error Deprecated split()
Ubah
Error split ();
Menjadi
explode();
Deprecated: Assigning the return value of new by reference is deprecated in system\codeigniter\Common.php on line 130
ubah
|
1
|
$objects[$class] =& new $name(); |
menjadi
|
1
|
$objects[$class] =new $name(); |
Message: Function set_magic_quotes_runtime() is deprecated
ubah
|
1
|
set_magic_quotes_runtime(0); |
menjadi
|
1
|
@set_magic_quotes_runtime(0); |
A PHP Error was encountered Severity: 8192 Message: Assigning the return value of new by reference is deprecated Filename: libraries/Loader.php Line Number: 255
ubah
|
1
|
$CI->dbutil =& new $class(); |
menjadi
|
1
|
$CI->dbutil =new $class(); |
A PHP Error was encountered Severity: 8192 Message: Assigning the return value of new by reference is deprecated Filename: database/DB.php Line Number: 133
Ubah
|
1
|
$DB =& new $driver($params); |
menjadi
|
1
|
$DB =new $driver($params); |
The url has disallowed Character
Ubah system/libraries open URI.php line 189
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
Menjadi
if ( ! preg_match("|^[".($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
untuk error fungsi date time anda harus set tanggal di php.ini dengan cara mengaktifkan
date.timezone ='Asia/Krasnoyarsk';