Last modified: 2012-02-23 09:51:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29580, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27580 - new extension: "Offline" database driver reads articles.xml.bz2
new extension: "Offline" database driver reads articles.xml.bz2
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Other (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.mediawiki.org/wiki/Extensi...
: patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-20 08:26 UTC by Adam Wight
Modified: 2012-02-23 09:51 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
extension source code (19.37 KB, application/octet-stream)
2011-02-20 08:26 UTC, Adam Wight
Details
extension source code (38.15 KB, application/x-gzip)
2011-02-21 09:16 UTC, Adam Wight
Details

Description Adam Wight 2011-02-20 08:26:45 UTC
Created attachment 8178 [details]
extension source code

Starting with others peoples' work, I wrote this in the hope that standalone MW installations will become commonplace.

Any help would be appreciated, with mediawiki.org hosting and posting especially.

Great work!

-Adam Wight
Comment 1 Max Semenik 2011-02-20 08:47:51 UTC
Neat!

See http://www.mediawiki.org/wiki/Manual:Developing_extensions#Publishing_your_extension regarding publishing on mediawiki.org

If you want to host your extension in our SVN repository (which will allow it to benefit from localisation and other developers' attention), you can apply for commit access: http://www.mediawiki.org/wiki/Commit_access

A few nitpicks after looking at code:
* We don't use ?> - it helps nothing and can lead to hard to track bugs if someone leaves whitespace after it
* You don't need to split i18n messages into two files
* Message keys should have an unique prefix, such as offline_ to avoid possible conflicts with other extensions
* APC functions are not available on every PHP installation, check with function_exists() first
* Why are you disabling other databases unconditionally?
Comment 2 Adam Wight 2011-02-20 09:59:24 UTC
Great point about the database, I will look into it.  The goal I've set for myself is to have a hybrid live/bz2 system which could do useful things like display local edits, then batch upload them to a DVCS when the net is back, etc...  so what level are you suggesting I hook in at?

It might require small changes in mediawiki to drop the accelerator cache requirement, and I can imagine further changes which would open many possibilities for useful data source plugins.  As an example, there is a master/slave concept wrapped around many (363) separate db calls, not the sort of thing to be hardcoded into core logic in the first place.
Comment 3 Mark A. Hershberger 2011-02-20 13:58:13 UTC
I haven't looked at your code, so the answer may be there.

I like your idea, but I wonder if you could use this to load pages into the local DB as they are viewed.  Then edits could be performed and merged with the main repository when you can go "online".  This would make MediaWiki into a sort of DVCS for editing.
Comment 4 Adam Wight 2011-02-21 09:16:46 UTC
Created attachment 8184 [details]
extension source code
Comment 5 Adam Wight 2011-02-21 09:17:54 UTC
Thanks to Max Semenik for some good ideas--most of his suggestions are corrected in the attached files.  A new pseudo-driver "DatabaseBz2" can be configured as either the primary or the fallback data source.

However, a mediawiki bug (or my error) is preventing the retrieved article from being displayed when this extension is set as the secondary, and the primary db cannot open a connection.  Strange.  The workaround is to change the db insertion at the end of Offline.php from
    $wgDBservers[] = array(
to a replacement:
    $wgDBservers[0] = array(

Have fun!

-Adam
Comment 6 Sumana Harihareswara 2011-11-23 15:28:27 UTC
Adam, did you end up applying for commit access?  As far as I can tell, your extension is not available in the MediaWiki SVN repository.  So please do apply and put it in there, as Max suggested in comment 1.

https://www.mediawiki.org/wiki/Commit_access_requests#Requesting_commit_access

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links