a=b; a=b; a=b; ad infinitum

I did have a different post that I was planning on writing today. I just figured that what I’m seeing on my Desktop Screens deserved sharing.  I’m doing some work on a site, and have copied it to a development area so my work does not affect the live site. Unfortunately the site URL & Document root are hard coded across the site, So before I can start I’m having to fix this.

So I find an include file full of variables. Which is a good way of doing it, since if you make any changes you only need to edit one file. Here’s an example of said file.

$site_name         =     “****************;
$site_email        =    “****@*******”;
$site_url        =    “http://********************/”;
$ip                =     ***.***.***.***;
$site_path        =    “/*****/******/*****”;

******** to protect customers privacy.

OK. Seems fair right? That’s only a small snippet of set variables There are dozens and dozens of them. Now, every other file on the site starts off with including this variable file. They then go on to reset all the variables in it to the same values. e.g. :-

<?php

require(**included file**);

$site_name         =     “****************;
$site_email        =    “****@*******”;
$site_url        =    “http://********************/”;
$ip                =     ***.***.***.***;
$site_path        =    “/*****/******/*****”;

??? WTF ???

Now, I know the original person who built the site did it all at the same time. so that discounts it being an extra file added at a later rebuild, and the variables per file had not yet been removed.

And as for the coding in the rest of the site, Lets just say I have begged to be allowed to rm -Rf * the whole directory and start again from scratch as it will be quicker/better.