Project

General

Profile

Actions

Bug #14655

closed

require_once() instead of require() should be used in entry scripts

Added by Ingmar Schlecht over 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2005-04-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0beta2
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In showpic.php, index_ts.php, typo3/init.php TYPO3 uses the PHP function require() to include classes like t3lib_div.
Later on in the process, there are some other files included having a line like this:
require_once(PATH_t3lib.'class.t3lib_div.php');

Normally the fact that t3lib_div was already included earlier should not cause any problems because require_once() should only include if the class wasn't already included, but it seems like the behaviour of that function changed in a recent PHP version, so that require_once() now DOES include files which have already been included with require(). The solution would be to change also the FIRST inclusions from require() to require_once().

According to Rupert Germann, this bug only occurs when a PHP accelerator is enabled.

A typical PHP error message resulting from this problem is this:
PHP Fatal error: Cannot redeclare class t3lib_div in /www/htdocs/_data/typo3.com/typo3_src-3.8.0-dev-cvs/t3lib/class.t3lib_div.php on line 209
(issue imported from #M958)


Files

index_ts.php.patch (1.32 KB) index_ts.php.patch Administrator Admin, 2005-04-10 18:51
thumbs.php.patch (530 Bytes) thumbs.php.patch Administrator Admin, 2005-04-10 18:51
dmailerd.phpcron.patch (1.03 KB) dmailerd.phpcron.patch Administrator Admin, 2005-04-10 18:57
returnmail.phpsh.patch (1.29 KB) returnmail.phpsh.patch Administrator Admin, 2005-04-13 14:06
Actions

Also available in: Atom PDF