On 26 August 2010 16:13, Trevor Parscal tparscal@wikimedia.org wrote:
You can also use things like function_exists() to conditionally call MediaWiki versions of things or native PHP stuff.
With respect, this is the wrong way to go about it. Unconditionally remove all MediaWIki from within the library, and, if necessary, create a wrapper that provides the extra functionality we need. Obviously, if it'd need a huge wrapper compared to the size of the library, it's not worth extracting - the chances are that any re-users will need to create vast wrappers too. The current examples of deliberately MediaWIki free code are very good candidates for this as they provide complex functionality that's really hard to do right yet they have very simple interfaces.
Conrad
- Trevor
On 8/26/10 3:58 PM, Platonides wrote:
Trevor Parscal wrote:
* Software we've ported to PHP ourselves like our native-PHP CDB implementation or CSSJanus are buried in our code-base, and make use of a couple of trivial wf* global functions, making it somewhat inaccessible to third-party users.
We should probably provide stub a stub version of those functions, so reusers don't have to declare a bunch of functions just because we call wfProfileIn, wfGetIP and set a couple of hooks.
Other problem would be our usage of wrappers like WebRequest.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l