Welcome Guest, Not a member yet? Register   Sign In
some changed code in php 5.3.0 compatibilities
#1

[eluser]Unknown[/eluser]
my client can't wait for CI 1.7.2

so i have to make several changes myself ;-)

here what i do

A. remove by condition set_magic_quotes_runtime

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

Code:
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)

Code:
$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:
Code:
$config['permitted_uri_chars'] = 'a-z ~%.:_\-';

to:
Code:
$config['permitted_uri_chars'] = '~%.:_\-';


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

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

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

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


i hope this can help
#2

[eluser]Derek Allard[/eluser]
Just for completeness: http://ellislab.com/forums/viewthread/12...15/#622194
#3

[eluser]Unknown[/eluser]
For "A", I removed the deprecated warning by changing my error reporting in index.php to look like so:
Code:
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:
Code:
$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.




Theme © iAndrew 2016 - Forum software by © MyBB