Closed (won't fix)
Project:
MongoDB
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Jun 2011 at 18:26 UTC
Updated:
26 Jun 2011 at 05:09 UTC
Jump to comment: Most recent file
Comments
Comment #1
crea commentedComment #2
fgmI think this does not belong in the MongoDB (sub)module(s) : this is a very generic part of D7, and any D7 backport/compatibility like DBTNG, autoload or QueueAPI might want to define it too: testing for defined() does not make us safe against what can happen if another module chooses to define it.
While the proper solution would probably be to have a generic "backport" module which all such inter-version modules should use and rely upon, the safest course until this actually happens (if ever) is probably to have our own module-specific constant.
Comment #3
crea commentedyou are right
Comment #4
crea commentedIt can be also argued that if another module blindly defines the constant without checking its error in that module. We can't control other modules, but we can behave ourselves atleast.
The whole point of keeping using the constant was to minimize code difference between 6 & 7.
Comment #5
fgmMaybe someone should create a "backports" project to house all these little things found in all D7 backport modules ?
Comment #6
crea commentedOk let's gather opinions then
Comment #7
crea commentedIt's also worth to note that constants should be defined very early in the bootstrap process (regardless of whether you are using specific backported code or not). Moving it to a dedicated backports module would require loading the module code somehow. I think that complicates the whole scenario, making using of if(defined()) checks more appealing.
Comment #8
crea commentedOk, I think it's much easier just to use $_SERVER['REQUEST_TIME'] than to waste time in debates.
I also think that having separate code bases is inevitable http://drupal.org/node/1089504#comment-4655694 so closing this.