Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#10186 closed enhancement (wontfix)

Add global $server_version

Reported by: peaceablewhale's profile peaceablewhale Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: General Keywords: has-patch tested
Focuses: Cc:


A number of workarounds/features are specific to IIS in WordPress Core. However, some workarounds/features apply to certain IIS versions only. I suggest adding a global $iis_version.

Attachments (1)

10186.patch (1.3 KB) - added by peaceablewhale 14 years ago.

Download all attachments as: .zip

Change History (13)

#1 @dd32
14 years ago

The other option, is to change the $is_* variables to the version (if known).


if ( test for iis )
  $is_iis = (is version known?) ? version : true;
same for apache and all the others too..

if ( $is_apache )
would still work, just as long  as its non-null/non-false/non-zero

semi-crazy idea..

#2 @dd32
14 years ago

I was thinking of that for browsers as well, Ie, If Opera is >= 10, or IE 5 or 6.. etc..

#3 @peaceablewhale
14 years ago

However, it is possible that some fcuntion may be checking those $is_ variables as boolean. I am afraid that changing them to version numbers may break compatibility with them.

What do you think?

#4 @peaceablewhale
14 years ago

Will break ($is_iis === true).

#5 @dd32
14 years ago

What do you think?

I think its possible. However, a point that we dont need to worry about.

$version = 10.4;

var_dump( $version == true );


PHP will evaluate anything non-false/null/zero to be true in the above example.

(Of course, $version === true would be false, But thats going to be rarely used, a triple check along with a true.. most people are just going to do if($iis)

#6 @dd32
14 years ago

If it was a problem, Introducing a new variable for it for future..

$apache = apache_version();
$iis = iis_version();

leaving $is_... alone for back compat

#7 @peaceablewhale
14 years ago

  • Summary changed from Add global $iis_version to Add global $server_version

I have uploaded a new patch that generates $server_version instead of $iis_version.

#8 @peaceablewhale
14 years ago

Forgot to change $is_iis7 just now..

#9 @westi
14 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I think we should move away from referencing versions completely.

We should be working on capabilities not versions.

The current implementation of IIS7 specific stuff will break as soon as IIS8 is used even if it supports everything that is required because we check explicitly for 7.

I don't think we should be making globals available with version numbers of things like this in them and so I am going to close this ticket.

#10 @peaceablewhale
14 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

However, the server version number is required for fixing #10186, and we will also need to care IIS URL_Rewirte when IIS 8 is released. I think adding global $server_version is useful.

#11 @peaceablewhale
14 years ago

Correction: this is required for fixing #10187

#12 @westi
14 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

We should not create globals with server version in.

It encourages checks to be made that should be better made on capabilities.

If we need a capabilite check like iis_supports_rewrites that could have to check a version but the version extraction should be encapsulated where it is used not stored in a global to encourage miss-use.

Note: See TracTickets for help on using tickets.