Hi all
As we dropped PHP 3 support, we might also want to start use require_once to get rid of bug #571409. Does any of you know something that will need special care or just replacing every require with require_once should be okay?
Michal Cihar a écrit:
Hi all
As we dropped PHP 3 support, we might also want to start use require_once to get rid of bug #571409. Does any of you know something that will need special care or just replacing every require with require_once should be okay?
Should be ok. We will then be able to remove some if (!defined(...INCLUDED))
I am not sure if PHP3 users will still get the warning about PHP 3 ;)
Marc
Hi Marc, Michal & list,
Marc Delisle wrote:
Michal Cihar a écrit:
Hi all
As we dropped PHP 3 support, we might also want to start use require_once to get rid of bug #571409. Does any of you know something that will need special care or just replacing every require with require_once should be okay?
Should be ok. We will then be able to remove some if (!defined(...INCLUDED))
I will work on this. :-)
I am not sure if PHP3 users will still get the warning about PHP 3 ;)
I am sure that they won't... :o) But if that bothers you, I'll try to find a way not to welcome php 3 users with an error message about undefined functions.
Regards,
--
Alexander M. Turek rabus@users.sourceforge.net _ __ __ _ _ _ _ __ | |__ _ __ | / |_ _ / \ __| |_ __ ___ (_)_ __ | '_ | '_ | '_ | |/| | | | | / _ \ / _` | '_ ` _ | | '_ \ | |_) | | | | |_) | | | | |_| |/ ___ \ (_| | | | | | | | | | | | .__/|_| |_| .__/|_| |_|__, /_/ ___,_|_| |_| |_|_|_| |_| |_| |_| |___/ http://www.phpmyadmin.net
Hi all
Original message (Alexander M. Turek, Monday 24.11.2003 23:34 +0100):
Marc Delisle wrote:
I am not sure if PHP3 users will still get the warning about PHP 3 ;)
I am sure that they won't... :o) But if that bothers you, I'll try to find a way not to welcome php 3 users with an error message about undefined functions.
Adding some simple check to to of index.php could be fine...
if (substr(phpversion(), 0, 1) == '3') { echo 'Stop using old php'; }
Well this code won't handle correcly php 30, but I guess, it is acceptable :-)
Hi Michal!
As we dropped PHP 3 support, we might also want to start use require_once to get rid of bug #571409. Does any of you know something that will need special care or just replacing every require with require_once should be okay?
I'm not absolutely sure we can do that. I think I remember some place where require() is used in an iterative way, which will break functionality when using require_once.
But replacing require with require_once on places where a file should only be required once is no problem and will impose no problems.
Regards, Garvin.
Hi list,
Garvin Hicking wrote:
As we dropped PHP 3 support, we might also want to start use require_once to get rid of bug #571409. Does any of you know something that will need special care or just replacing every require with require_once should be okay?
I'm not absolutely sure we can do that. I think I remember some place where require() is used in an iterative way, which will break functionality when using require_once.
I think I've been careful enough. So far, the latest CVS files work fine for me... :-)
But replacing require with require_once on places where a file should only be required once is no problem and will impose no problems.
That's what I did.
I replaced all include / require calls by require_once. If a file may be required multiple times, I used require instead. In cases where we cathed a failed inclusion, I used include_once / include instead. This is the case for the configuration files, for instance.
Regards,
--
Alexander M. Turek rabus@users.sourceforge.net _ __ __ _ _ _ _ __ | |__ _ __ | / |_ _ / \ __| |_ __ ___ (_)_ __ | '_ | '_ | '_ | |/| | | | | / _ \ / _` | '_ ` _ | | '_ \ | |_) | | | | |_) | | | | |_| |/ ___ \ (_| | | | | | | | | | | | .__/|_| |_| .__/|_| |_|__, /_/ ___,_|_| |_| |_|_|_| |_| |_| |_| |___/ http://www.phpmyadmin.net