Why the install.php script so complicated ?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Why the install.php script so complicated ?

Postby fluminis » 20. June 2009 14:52

Hello all,

I use the install.php script to setup xampp lite 1.7.0 on my usb key.
But the script did not change the alias path in the http.conf file.

The reason is that I setup my alias not in the htdocs directory but somewhere else on my usb key more accessible for me :
N:\Apps\xampplite\ => xampp install directory
N:\MyFiles\website1\ => files for website 1
N:\MyFiles\website2\ => files for website 2

Ok, not really a problem, I know PHP, I could do the changes by myself in the script !
Well, in fact the script is wierd and very complicated.

Why did you use awk to do the job ? PHP alone should do the trick, isn't it ?
In the script you play with a lot of \\\\\\ and //. Just in order to call awk.

I spent hours to play with \ and \\ to call awk corectly and at the end I gave up.
Instead, to do what I needed, I added those lines in the script :

Code: Select all
if (($xamppinstaller == "newpath") || ($BS == 1)) {
   $httpConf = file_get_contents($confhttpdroot);
         
   $tmpA = $oldPartition.'MyFiles/';
   $tmpB = $newPartition.'MyFiles/';

   $httpConf = str_replace($tmpA, $tmpB, $httpConf);
         
   file_put_contents($confhttpdroot, $httpConf);
}


In my point of view, you could re-write the entire script with such method, and stop using awk. The advantage of this method is that you use only PHP and simplify the code a lot and stop using all the \ stuff.

Did I miss something in the use of awk that explain why you use it ?

Thanks a lot for xampp lite, I use it all the time.

Fluminis
fluminis
 
Posts: 2
Joined: 20. June 2009 14:27

Re: Why the install.php script so complicated ?

Postby fluminis » 02. August 2009 10:56

no answer ?
fluminis
 
Posts: 2
Joined: 20. June 2009 14:27

Re: Why the install.php script so complicated ?

Postby Wiedmann » 02. August 2009 11:14

I use the install.php script to setup xampp lite 1.7.0 on my usb key.

As of XAMPP 1.7.2 we don't use this "install.php" anymore.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 98 guests