WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#3349 closed enhancement (fixed)

wp-config pickup consistency fixes

Reported by: RuddO Owned by: 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 7 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 RuddO7 years ago

  • Type changed from defect to enhancement

comment:2 markjaquith7 years ago

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

At first glance, this looks fine.

comment:3 RuddO7 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.

comment:4 foolswisdom7 years ago

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

comment:5 masquerade7 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.

comment:6 RuddO7 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.

comment:7 masquerade7 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.

comment:8 markjaquith7 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?

comment:9 JeremyVisser7 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.

comment:10 omry7 years ago

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

comment:11 omry7 years ago

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

comment:12 markjaquith7 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

comment:13 rob1n7 years ago

  • Milestone changed from 2.2 to 2.3

comment:14 rob1n7 years ago

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

comment:15 markjaquith7 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.