Forum Moderators: coopster

Message Too Old, No Replies

php 4.3.5 released

         

jatar_k

10:26 pm on Mar 29, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



ChangeLog [ca.php.net]

I know it was the 26th but I didn't see it friday and didn't go on the site over the weekend strangely enough.

Lots of bug fixes. We put on all of our servers today.

This is primarily a bug fix release, without any new features or additions. PHP 4.3.5 is by far the most stable release of PHP to date and it is recommended that all users upgrade to this release whenever possible.

coopster

1:23 pm on Mar 30, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I realize this may not apply to a revision level upgrade within a release, but how do you handle the
php.ini
changes on upgrades? Line-by-line?

jatar_k

5:54 pm on Mar 30, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



we run mostly default ini's with only a few changes so we have only a short list of settings that need to be changed.

So I guess line by line. We use a shell script to update servers. OS patches, apache, ssl, php and maybe some other things too, can't remember off the top of my head. The script just does the whole thing for us, very simple.

coopster

12:23 am on Mar 31, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Thanks. Just curious. Line-by-line here, too.

I'm just trying to make life a bit easier for myself when it's time to upgrade servers, and especially configuration files like .conf, .ini, etc. I never thought of scripting it (duh, what a brilliant analyst we have here).

Makes me think, though...how would one read the file, find existing directive settings and change them to the directive settings I have changed from defaults...but what if the developers changed the defaults (has happened before,

register_globals
for example). Hmmm, anybody else got any ideas on this...?

jatar_k

12:26 am on Mar 31, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



actually everything is scripted except for the ini stuff. I really don't trust anything for that.

We roll it out on dev servers, qa it, then roll the versions forward with software/site releases.

We just move the dev server ini file forward too.

coopster

12:32 am on Mar 31, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>>I really don't trust anything for that.

Neither do I, that's why I do the line-by-line thing. However, if I could read and compare the two (current .ini versus brand-new .ini), it might be worth the time to develop a nice little script that prints out the info. I know that certain platforms (IBM's AS400, for example) have some compare utilities built in for this type of requirement. Well, we'll see if anybody else has any input.

JasonHamilton

1:06 am on Mar 31, 2004 (gmt 0)

10+ Year Member



diff works well enough for me :P

mykel79

3:27 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



Coopster: how about this little script I wrote in, what else, PHP :)

class compare_ini_files_class {
var $params, $line_nr;
function compare_ini_files_class ($filename1, $filename2) {
//read files into arrays
$this->file1=$filename1;
$this->file2=$filename2;
$lines[1]=file($this->file1);
$lines[2]=file($this->file2);
//extract values of configuration parameters
for ($i=1;$i<=2;$i++) {
foreach ($lines[$i] as $key=>$val) {
unset($temp);
//find and strip ";" and everything after it, because it's a comment
$pos = strpos($val, ";");
if ($pos===false) {
//no comments found
$line=$val;
}
else $line=substr($val,0,$pos+1); //line is everything up to ";"
ereg('(.*)[ ]*=[ ]*(.*)',$line,$temp);
$this->params[$i]["$temp[1]"]="$temp[2]"; //put extracted value into table
$this->line_nr[$i]["$temp[1]"]=$key; // save line number where this value as in file
}
}
}
function compare() {
foreach ($this->params[1] as $key=>$val) {
if ($val!=$this->params[2][$key]) {
echo $this->file1,':',$this->line_nr[1]["$key"],' ',$key,'=',$val,'<br>';
echo $this->file2,':',$this->line_nr[2]["$key"],' ',$key,'=',$this->params[2][$key],'<br><br>';
}
}
}
}
$ini_files=new compare_ini_files_class('php1.ini','php2.ini');
echo 'The differences in the INI files are:<br>',$ini_files->compare();
?>

It reads all the directives and their values into arrays and then checks if some values are different. Then it prints out the different ones along with the line numbers in file1 and file2.

It might have some bugs, I haven't really tested it much.

I had a lot of trouble getting the indents to show, so they're in spaces and not tabs

coopster

5:04 pm on Mar 31, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



diff. Ahhh. Showing my (lack of) *nix skills now, aren't I?

I like the idea of the script to at least highlight the areas I need to look at. A script would work cross platform as well, you know, in case a diff or other file comparison utility wasn't available for the OS hosting the servers.

Thanks for the start mykel79. I haven't had a chance to poke through the code yet and test it, but will give it a closer look once PHP 5 has stabilized and server upgrade decisions are being considered. Or hopefully long before that.

mykel79

5:48 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



No problem coopster. Like you said, it's just a start, but then again it just took 15 minutes to code :)