[Mediawiki-l] wfStrencode & wfQuery
brion at pobox.com
Mon Jan 22 19:22:00 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
John Moorhouse wrote:
> I'm working on moving a number of Wiki's to V1.9 and have hit a problem
> with the kWBreadCrumbs extension, which is complaining about both
> wfStrencode & wfQuery functions, I've tried the various suggestions
> about replacing wfStrencode with addQuotes() but I'm rather out of my
> depth. The rest of the extension works with 1.9 (I've dot it running
> without the kwBreadCrumbsNoCache function, any help would be
> appreciated, as I'm out of my depth here, I've added the function code
> to this email. If I can get it working I'll add it back into the
> extensions list if this is felt appropriate.
(or better $db->addQuotes($blah); note this includes the outer quotes)
wfQuery($blah, DB_WRITE, $fname);
(or better use the various query-builder functions, which will tend to
be safer due to applying propr quoting always, and may be more portable
for not-quite-standard constructs).
These long-, long-, long-obsolete functions have been removed because
they are unreliable -- it's hard to know which database object they will
be sent to, and that's generally icky.
You get a Database object from wfGetDB(DB_MASTER) or wfGetDB(DB_SLAVE).
Writes must go to the master *only*. Many read operations can be taken
from a slave, which will spread load away from your primary server in a
load-balancing replication setup. (On a single server they will both
return the same connection.)
- -- brion vibber (brion @ pobox.com)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v22.214.171.124 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the MediaWiki-l