[phpMyAdmin Developers] PHPMYADMIN constant check

Alec Teal a.teal at warwick.ac.uk
Mon Aug 3 05:13:08 CEST 2015


Leave it.

I once benchnarked the if defined tests and they take up so little time (less than I expected - so little all I remember is "negligible") it's not worth time to remove them and they don't hurt.

Alec Teal

Marc Delisle <marc at infomarc.info> wrote:

>Le 2015-08-01 16:10, Dan Ungureanu a écrit :
>> Hello,
>> 
>> I see the following snippet in almost every file of phpMyAdmin, but I
>> believe that in most files it is not required.
>> 
>>     if (! defined('PHPMYADMIN')) {
>>         exit;
>>     }
>> 
>> I think that it was used to prevent execution if a direct request was
>> made to the file, but nowadays, most files contain only procedural code.
>> In most cases, with or without this, the code behaves the same so it may
>> be considered dead code.
>> 
>> I propose removing it where possible. What is your opinion?
>> 
>> Best regards,
>> Dan Ungureanu
>
>I agree that if the file only contains functions and classes, there is
>no point having this snippet, but I may be missing something.
>
>
>-- 
>Marc Delisle | phpMyAdmin
>
>_______________________________________________
>Developers mailing list
>Developers at phpmyadmin.net
>http://lists.phpmyadmin.net/mailman/listinfo/developers


More information about the Developers mailing list