[Typo3] die () function for install file

Christopher bedlamhotel at gmail.com
Wed Jul 6 23:51:25 CEST 2005


Hi,

On 06/07/05, cbc2 <cbc2 at comcast.net> wrote:
> Hi Christopher
> 
> Thanks for your help.  What about the {   } ?  Do they stay in?  Where do they actually go? ... before and after the die statement?

Here's the original:

	// This checks for my own IP at home. You can just remove the if-statement.
if (1==0 || (substr($_SERVER['REMOTE_ADDR'],0,7)!='192.168' &&
$_SERVER['REMOTE_ADDR']!='127.0.0.1'))		{
	die("In the source distribution of TYPO3, the install script is
disabled by a die() function call.<br/><b>Fix:</b> Open the file
typo3/install/index.php and remove/out-comment the line that outputs
this message!");
}

As it mentions, 'you can remove the if statement'. If you're trying to
disable the install script altogether, you can just replace the
_entire_ block of code above with something like:

die('The install tool is disabled!');

The original is a conditional statement; in other words, there are
conditions where the stuff between '{' and '}' might NOT be executed
(i.e. when the script is executed from a private network). If what you
want is for the script to die any time anyone accesses
typo3/install/index.php, then you don't need the condition ('if
statement') because you want it to happen ALL the time. Alternatively,
you could use a condition that's _always_ true...

if (1 == 1) {
  die('1 == 1!');
}

-Christopher



More information about the TYPO3-english mailing list