Make WordPress Core

Opened 18 years ago

Closed 17 years ago

#3349 closed enhancement (fixed)

wp-config pickup consistency fixes

Reported by: ruddo's profile RuddO Owned by: rob1n's profile rob1n
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.1
Component: Optimization Keywords: 2nd-opinion
Focuses: Cc:

Description

What this patch does:

  • calls WP's wp-config.php consistently throughout WP (before it was a mixture of ../'s and dirname(FILE)'s)
  • lets anyone use a WordPress tree composed out of symlinks without issues (perfect for those who host hundreds of WPs in a single server for hundreds of customers, and who by any reasons won't use WP-MU)

These fixes work OK on my setup, and should work OK on others' setups. Just tested creating a new blog and it's all good.

Attachments (1)

2.0.5-phantom-wp-config-consistency.diff (5.3 KB) - added by RuddO 18 years ago.

Download all attachments as: .zip

Change History (16)

#1 @RuddO
18 years ago

  • Type changed from defect to enhancement

#2 @markjaquith
18 years ago

  • Keywords 2nd-opinion added
  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

At first glance, this looks fine.

#3 @RuddO
18 years ago

Thanks, Mark. I did work on other plugins and submitted them to their respective authors. The last author I will contact is the wonderful FireStats plugin's, where my fixes initially didn't work because the "offending file" was already being included via a dirname(FILE), thus I had to use getcwd(). It worked with getcwd() though.

#4 @foolswisdom
18 years ago

+1 on consistency
-1 on ./ it is obtuse, leads me to do a double take to ensure it is not ../

#5 @masquerade
18 years ago

+-0 for consistency, the whole codebase is inconsistent, and I don't care any more.
-1 for anything that requires any plugin under any condition to have to use getcwd. Its not reliable.

#6 @RuddO
18 years ago

foolswisdom: I based the ./ on the fact that some WP files already used it. it seems to work fine, whereas under some (admittedly not common, but possible) conditions, the famed dirname(FILE) fails.

this patch does not introduce any usage of getcwd(). Only my FireStats patch (mailed to the author) did. As you say, getcwd() is not reliable, but it was the only way I could get FireStats to work, and the getcwd() mod went only into FireStats.

#7 @masquerade
18 years ago

The fact that we are breaking plugins like this one and maybe others that we don't know about is unacceptable. If getcwd is the only way something will work with this patch applied, thenI don't think it should be applied.

#8 @markjaquith
18 years ago

I think the FireStats issue was a result of him using Symlinks... not this change. Obviously I don't want anything going in that breaks plugins on normal installs. But if this leaves normal installs alone but allows more creative setups, I don't mind it. RuddO, can you clear up the reason for having to use getcwd() ? Because of symlinks or this patch?

#9 @JeremyVisser
18 years ago

Nothing to do with this particular issue, but the K2 Sidebar Modules broke for me as well, due to the fact that I symlinked the K2 theme directory from my blog to my Dad's blog and was wondering why the "K2 Sidebar Modules" option showed up on my blog, but not Dad's. A long time later, I realised it was because of the dreaded __FILE__ which resolved the symlinks and broke the path names.

#10 @omry
18 years ago

RuddO, I never got your patch, please re-send.

#11 @omry
18 years ago

or better yet, open a ticket for it at firestats.cc, and attach the patch there.

#12 @markjaquith
18 years ago

  • Milestone changed from 2.1 to 2.2
  • Version changed from 2.0.5 to 2.1

We can play with this after 2.1

#13 @rob1n
18 years ago

  • Milestone changed from 2.2 to 2.3

#14 @rob1n
18 years ago

  • Owner changed from markjaquith to rob1n
  • Status changed from assigned to new

#15 @markjaquith
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5843]) Consistently include wp-config.php. fixes #3349

Note: See TracTickets for help on using tickets.