[wp-hackers] update $wp_query->post->guid fails
otto at ottodestruct.com
Fri Jul 9 20:19:42 UTC 2010
On Fri, Jul 9, 2010 at 2:23 PM, Will Anderson <will at itsananderson.com> wrote:
> Is there a reason why the URL is used? From a GUID definition standpoint,
> the post's address meets the criteria (it should be globally unique ),
> but from a user's standpoint, it has a lot of potential for confusion for
> people who are (a) new to the WP DB and (b) don't already know what a GUID
> I guess what it boils down to is, why isn't something like the PHP uniqid()
> function  used instead?
>  http://en.wikipedia.org/wiki/Globally_Unique_Identifier
In the world of RSS and ATOM feeds, historically, the URLs of the
content have been used as unique identifiers. Reasoning is that most
sites own their own domain and a URL tends to link to one thing only.
Same basic principle leads to the reversed domain pattern for
namespacing in object oriented languages like Java and such. The fact
that you have your own domain means that you can prevent collisions
and that the URL pattern is under your control.
I have argued for using real GUIDs before (using the mySQL UUID()
function). There hasn't been any traction on it because nobody
seems to see any real advantages there. The GUID simply isn't used
much, although it's one of those necessary things for feeds.
The PHP uniqid function won't work because it's not *globally* unique.
The UUID() function in mySQL is.
More information about the wp-hackers