Part of the EllisLab Network
   
 
some changed code in php 5.3.0 compatibilities
Posted: 10 August 2009 06:16 PM   [ Ignore ]  
Summer Student
Total Posts:  15
Joined  08-10-2009

my client can’t wait for CI 1.7.2

so i have to make several changes myself wink

here what i do

A. remove by condition set_magic_quotes_runtime

file: codeigniter/CodeIgniter.php (line: 60)

if(!phpversion()=='5.3.0')
    
set_magic_quotes_runtime(0); // Kill magic quotes 

 

B. remove all new object by reference, change ‘=&’ to ‘=’

from:
$objects[$class] =& new $name();
became:
$objects[$class] = new $name();

file: codeigniter/Common.php   (line: 130)
file: codeigniter/Common.php   (line: 136)
file: libraries/Loader.php   (line: 255)
file: database/DB.php       (line: 133)

$objects[$class] = new $name(); 

see: = new


C. since hyphen ‘-’ became special character in php 5.3, change this way:

file: config/config.php     (line: 153)

from:

$config['permitted_uri_chars''a-z ~%.:_\-'

to:

$config['permitted_uri_chars''~%.:_\-'


file: libraries/URI.php     (line: 189)

from:

if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i"$str)) 

to:

if ( ! 
preg_match("|^[\w".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i"$str)) 

wacth!:
! preg_match(”|^[\w


i hope this can help

Profile
 
 
Posted: 12 August 2009 01:24 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  4777
Joined  03-23-2006

Just for completeness: http://codeigniter.com/forums/viewthread/124643/P15/#622194

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

Profile
MSG
 
 
Posted: 30 August 2009 04:00 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  3
Joined  08-14-2009

For “A”, I removed the deprecated warning by changing my error reporting in index.php to look like so:

error_reporting(E_ALL & ~E_DEPRECATED); 

I didn’t have to change codeigniter/CodeIgniter.php and seems to work in my PHP 5.2.9 environment.

For “C”, I changed my config.php to look like so:

$config['permitted_uri_chars''abcdefghijklmnopqrstuvwxyz 0123456789~%.:_\-'

I didn’t have to change libraries/URI.php and again it seems to work in my PHP 5.2.9 environment.

These are the two things I’ve come across because my development environment changed from PHP 5.2.9 to PHP 5.3.0. I’m going to have to read up on the “B” part and the “new” keyword.

Profile