Extension talk:WikiSync

Support for HTTPS
Does WikiSyncSetup::$remote_wiki_root support HTTPS url? --Solitarius 03:03, 17 April 2011 (UTC)
 * Sorry for huge delay - this extension is still alpha and requires a lot of development. For example, I am planning to make most of API calls to be made via jQuery, maybe even remote ones. Currently it uses Snoopy PHP class for API fetches, looking at code it seems that Snoopy supports https via curl execution, however I do not run any https MediaWiki installation so I haven't checked it. You need to have curl installed and provide the path to it via $curl_path in Snoopy class. Unfortunately, I don't have enough time to develop the extension further (due to financial constrains), I hope someday I'll be able to contribute more. QuestPC 05:51, 6 May 2011 (UTC)

"Informational null revisions"
I was translating this extension in TranslateWiki and found this message:

"Only a special bot user $1 can perform wiki synchronizations. Please login as $1. Do not change $1 name in between the synchronizations, otherwise informational null revisions will not be properly skipped (see Extension:WikiSync for more info)."

It's a bit hard to understand how null revisions are informational. The message refers to Extension:WikiSync, but it doesn't help much either.

Can anyone please explain it?

Thank you. --Amir E. Aharoni 07:42, 6 July 2011 (UTC)


 * As far as I know, null revisions are made when importing a page for example. First the revision will be imported with the information which author did them original and then there will be a null revision with the information which author has imported the revision, if I remember it right. Both will refer to the same textid though. --Danwe 18:59, 10 August 2011 (UTC)

Newest revision only?
I think in many cases it wouldn't be necessary to sync all revisions but just the newest one. There could be a check-box for that, would fasten up things too. --Danwe 11:20, 7 July 2011 (UTC)

Problems Logging in to Localhost and Synchronizing from Global
Not sure what I'm doing wrong here, but when I attempt to login in wikisync from the global to local, the synchronize button never activates. And though I can login from local to global and the sync button activates, clicking it only deactivates it with no visible activity following. Here is my LocalSettings.php entries for local and global, correspondingly:

require_once( "$IP/extensions/WikiSync/WikiSync.php" ); WikiSyncSetup::$remote_wiki_root="http://xenanthropy.com/wiki/api.php"; WikiSyncSetup::$rtl_access_groups = array( 'user' );

require_once( "$IP/extensions/WikiSync/WikiSync.php" ); WikiSyncSetup::$remote_wiki_root="http://localhost/wiki/api.php"; WikiSyncSetup::$rtl_access_groups = array( 'user' );

I couldn't tell from the article whether the /api.php was necessary, but it seemed to be the only way it worked to any degree. One thing I noticed was that from either end, the local root (as opposed to remote) did not include /api.php, and I know of no option to amend this if necessary. I'm not sure if that could be the problem or not. Also, I'm using 1.16.5 at both ends, do I need to downgrade or upgrade to be able to use this extension?--173.18.46.251 18:31, 8 August 2011 (UTC)
 * The infobox says it's for MediaWiki version 1.15.5 and 1.17a, so I think it's incompatible with 1.16.5 (otherwise it'll say 1.15.5+)

TBloemink 18:34, 8 August 2011 (UTC)
 * Thanks! It works after an update, except that I'm not sure what the permission settings need to be for this, as none of the settings I've tried seem to work.  How and where do I need to change these permissions?

Cannot create temporary file in WikiSyncClient::tempnam_sfx Please make sure you have writing permissions in '/var/lib/mediawiki/images/tmp/'
 * --50.83.15.15 18:28, 9 August 2011 (UTC)

You cannot synchronize the wiki to itself
I installed the extension on my local system (is reachable by the host http://wiki) and on my server (reachable by http://wiki.mydomain.tld). If I click on login it says Successfully logged into remote wiki site. If I click on Synchronize it says: You cannot synchronize the wiki to itself This problem can be fixed with the following patch: --- WikiSync.js.old	2011-10-19 07:55:20.000000000 +0200 +++ WikiSync.js	2011-10-19 08:28:48.000000000 +0200 @@ -1030,8 +1030,7 @@ 	 * "Synchronize" button click handler */ 	process : function { -		if ( wgServer.indexOf( this.remoteContext.wikiroot ) !== -1 || -				this.remoteContext.wikiroot.indexOf( wgServer ) !== -1 ) { +		if ( wgServer == this.remoteContext.wikiroot ) { alert( this.formatMessage( 'sync_to_itself' ) ); return; }

Synchronization failed with Mediawiki 1.17
If I try to synchronize two wikis, both version 1.17 I get the following error back:

 Has anyone an idea how to fix this?

To fix "Fatal error: Call to undefined method Status::atEnd" in wiki 1.17 - 1.19 and let it work correct for transfer file.
$this->fpath = $file->getLocalRefPath;
 * (For 1.19 only) Change WikiSyncApi.php 533 line (original code is:  $this->fpath = $file->getPath;" to:

$streamstatus = ImportStreamSource::newFromFile( $fname ); if ( !($streamstatus->isGood) ) { @unlink( $fname ); return $json_result->getResult( 'import', $streamstatus->getWikiText(true,true) ); } $source = $streamstatus->value;
 * (For >1.17 ) replace WikiSyncClient.php 567 to 572 line to following code

= Problems =

Mediawiki 1.19
I have a global wiki and a local wiki. The configuration of both have the following structure:


 * Global: 172.25.7.101/mediawiki
 * Local: 172.25.2.90/mediawiki

I think the problem is on local wiki because this is behind HTTP proxy. What i'm trying to say is I have a lighttpd server as proxy and behind it have the mediawiki with another lighttpd server. Maybe that is the problem.

Now i'll put the errors returns me the WikiSync page:


 * From local wiki
 * Direction: 172.25.7.101 -> 172.25.2.90


 * Successfully logged into remote wiki site
 * source first revision: {"ws_status":"1","query":{"revisionhistory":[{"revid":"1","pageid":"1","timestamp":"2012-06-19T14:07:22Z","revlen":"461","textlen":"461","usertext":"MediaWiki default"}]},"query-continue":{"revisionhistory":{"startid":2}}}
 * source last revision: {"ws_status":"1","query":{"revisionhistory":[{"revid":"2","pageid":"2","timestamp":"2012-06-19T14:44:29Z","revlen":"6","textlen":"6","usertext":"Admin"}]},"query-continue":{"revisionhistory":{"startid":1}}}
 * source: {"ws_status":"1","query":{"revisionhistory":[{"revid":"2","pageid":"2","timestamp":"2012-06-19T14:44:29Z","revlen":"6","textlen":"6","usertext":"Admin"}]}}
 * destination search results: {"ws_status":"1","query":{"similarrev":[]}}
 * Synchronizing from 2
 * Trying to synchronize from revision 2
 * destination: {"ws_status":"1","query":{"allpages":[{"pageid":1,"ns":0,"title":"Main Page"}]}}
 * destination sample title: Main Page
 * destination: {"ws_status":"1","query":{"pages":{"1":{"pageid":1,"ns":0,"title":"Main Page","touched":"2012-06-19T17:16:25Z","lastrevid":1,"counter":3,"length":423,"new":"","starttimestamp":"2012-06-21T14:39:06Z","importtoken":"1a271ac2413742690c05ee85f392d5a2+\\"}}}}
 * destination import token: 1a271ac2413742690c05ee85f392d5a2+\
 * {"ws_status":"0","ws_code":"http","ws_msg":"Request error status=500, text="}
 * xml_chunk_result: http: Request error status=500, text=


 * From global wiki
 * Direction: 172.25.7.101 -> 172.25.2.90


 * http:HTTP error while querying data from remote API

Can anyone help me with this? Thanks in advance