Extension talk:Farmer

An example setting for URL Prefix Strategy
Thanks for the extension. Here's my installation procedure using URL Prefix stragety. MediaWiki version = 1.16.4 require_once( "$IP/extensions/Farmer/Farmer.php" ); /* We use the internal _matchByURLHostname function to find the wiki name */ $wgFarmerSettings['wikiIdentifierFunction'] = array( 'MediaWikiFarmer', '_matchByURLRegExp' ); $wgFarmerSettings['matchRegExp'] = '/[^\/]+/'; $wgFarmerSettings['matchOffset'] = 0;
 * Choose "mediawiki_" as the sql table prefix and "http://HOSTNAME//mediawiki" as the installation directory.
 * First extract and install the extension in the extensions/ directory as usual.
 * Add this in LocalSettings.php

$wgFarmerSettings['dbAdminUser'] = $wgDBuser; $wgFarmerSettings['dbAdminPassword'] = $wgDBpassword; $wgFarmerSettings['dbTablePrefixSeparator'] = '_'; $wgFarmerSettings['newDbSourceFile'] = realpath( dirname( __FILE__ ) ). '/maintenance/tables.sql'; $wgFarmerSettings['defaultWiki'] = "mediawiki"; function wgGetDaughterWikiName {	if ( preg_match( '/[^\/]+/', $_SERVER['REQUEST_URI'], $wgURLMatches ) ===1) {		return $wgURLMatches[0]; }	else {		return "mediawiki"; } }
 * Find the $wgScriptPath declaration in the LocalSettings.php, replace it with:

$wgScriptPath = "/". wgGetDaughterWikiName; $wgLogo            = "$wgStylePath/common/images/". wgGetDaughterWikiName. "_wiki.png"; By the way, there were no accounts in daughter wikis, so i created them manually. --Crlf0710 04:43, 7 May 2011 (UTC)
 * You can also replace the logo: create _wiki.png
 * Update URLs in the Special:Allmessages page.
 * Create wikis in Special:Farmer page.
 * Create soft links to mediawiki directory using the daughter wiki names.
 * It should work now.

Hello, I installed Farmer but now I cannot see anything when I go to my wiki. I installed farmer extension thru SVN.

There is something wrong with the $wgFarmerSettings. I used ais_ as the defaultwiki. the prefix separator is "_". Should I use ais or ais_.

I am at dead end. Please help.

RegExp examples
Can anyone provide some regexp examples for using with matchRegExp and matchOffset?

Error with $wgFarmerSettings
$wgFarmerSettings['wikiIdentifierFunction'] = array('MediaWikiFarmer', '_matchByURLHostname'); This delivers on startup of default wiki
 * I prefer Localsettings.php with

Warning: Missing argument 1 for MediaWikiFarmer::_matchByURLHostname in \extensions\Farmer\MediaWikiFarmer.php on line 281

$wgFarmerSettings['wikiIdentifierFunction'] = array('MediaWikiFarmer', '_matchByServerName'); This delivers on creating new wiki
 * I tested Localsettings.php with

Warning: Invalid argument supplied for foreach in \extensions\Farmer\MediaWikiFarmer.php on line 434


 * Can you help me to get one of both to work?

Environment and Setting

 * OS: Win 2000
 * 1) MediaWiki: 1.11alpha (r22753)
 * 2) PHP: 5.1.1 (apache2handler)
 * 3) MySQL: 5.0.18

--Wissenslogistiker 14:18, 7 June 2007 (UTC)

Non-shared user and user_groups
does Farmer support non-shared user and user_groups databases yet ?
 * Seems not for now.--FR6 20:20, 14 May 2007 (UTC)

Updating wiki source
What happens when you update the wiki source code? Will all necessary configurations of all the wiki installs be updated? Or will this still have to be done manually? --Denise 11:41, 3 April 2007 (UTC)

I don't understand What they mean
I am a Chinese. I don't understand what the followed mean:
 * 1) "MediaWiki trunk", which mentioned in the section "mysql_errno.28.29_fix" is what? Can I find the explain(s) of it in somewhere?
 * 2) The section tall me "You need to change this to read: if ( $this->lastErrno ) {", I'v checked the Database.php but I still don't know how do I follow the instruction ?

Please tall me, Thanks!

Environment and Setting
--Roc michael 04:32, 13 May 2007 (UTC)
 * OS: Win XP
 * 1) Mediawiki Version 1.9.2
 * 2) Apache Web Server Version 2.2.3
 * 3) PHP Script Language Version 5.1.6
 * 4) MySQL Database Version 5.0.24a

How to use the patch?
What is the description "Farmer currently requires my patch to work correctly" mean in the section "Shared_Tables"? I've check the link my patch. In the other end of the link is a file which I don't know what the type of the file is. It isn't a ".php" file. Does it can be executive on Win XP or by firefox? How do I use it?

Please tall me, Thanks!

Environment and Setting
--Roc michael 04:32, 13 May 2007 (UTC)
 * OS: Win XP
 * 1) Mediawiki Version 1.9.2
 * 2) Apache Web Server Version 2.2.3
 * 3) PHP Script Language Version 5.1.6
 * 4) MySQL Database Version 5.0.24a


 * See Subversion. I suggest that you use TortoiseSVN for aplying a patch from Windows. --FR6 20:26, 14 May 2007 (UTC)

Error on creating new wiki
I get the following error when I try to create a new wiki under farmer.

Anyone have any ideas on how to fix this problem?

Also once I try to create the wiki again it says that it already exists. Where is is getting that information. I tried looking in to the config directory but did not see it.

Update
Looking at the sql code and error messages it looks like the error is in the daughterwiki.sql file. The column that is requested in here is not actually created by the sql file.

To fix this I added

When I fixed this I tried to create another wiki it showed that two more table were not even created. The two tables that were not created where redirect and page_restrictions

Once I added these two tables to the sql code I was able to create a working wiki. Not sure if I am going to run in to other problems later. If I find anything else I will post it here

Additional Information:
This note is from somebody who had similar problems updating his Wiki:

I found I had the exact same errors. Mine occurred when I upgraded to MySQL 5.0.45 AFTER I had already (successfully) upgraded from MediaWiki 1.9 to 1.11. However by re-executing the php update.php in the maintenance directory I found it added a whole bunch of stuff that it did not add the first time I ran it under MySQL4. When I re-executed it under MySQL5 it fixed all the problems that I was having.

Hope that helps anyone else who happened on this page by searching for the rev_len issue. ~ Mark

Doesn't work for me
This didn't work for me, for some reason, even after I set the variables, when doing a test installation on localhost, and on my webhost - freeunlimitedweb.com

I tried configuring the settings, but nothing worked properly.

By the way, I'm running the latest version of MediaWiki (trunk) from SVN, and the trunk version of this extension, so why has this gone wrong?? --84.45.219.185 08:59, 30 July 2008 (UTC)

Database error
hi

i am working with mediwiki-1.11

i install the Farmer extension but showme this error when i create a new wiki

Database error A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "Revision::insertOn". MySQL returned error "1054: Unknown column 'rev_len' in 'field list' (localhost)".

what is the problem?

you can help me?

thanks

--200.77.227.68 18:40, 8 August 2008 (UTC)

Error
Fatal error: Call to undefined function wfMsgHtml in extensions/Farmer/MediaWikiFarmer.php on line 112

What did i forget to do?

Its Debian 4.0 etch Apache 2.2.3 PHP 5.2.0-8 MySQL 5.0.32 Mediawiki 1.14alpha SVN rveision 43190

Any ideas? And I'm confused about what to do with the patch.

Gewt 14:37, 4 November 2008 (UTC)

Using multiple Databases for one wiki
I had the idea to use two databases or more for one wiki. The databases should be shared with other wikis. For example, each wiki has it's very own database for common articles but one database which is shard with other wikis for templates. So it would be possible to share and maintain templates with other wikis without using interwikis which are not very comfortable because of the prefix and some other reasons. --Danwe 21:28, 30 April 2009 (UTC)
 * Something like that is possible now with the extension WikiSync. It allows to synchronize between several wikis --Danwe 22:57, 29 June 2011 (UTC)

Renaming mw tables for use with Farmer
You may want to mention a PHP script to help renaming the MySQL tables. Not all phpmyadmin are set-up properly with PMA enabled and therefore it would become a manual action of individually renaming 35+ tables, with someone bound to go wrong.

daughterwiki.sql is missing in v1.15.x
According to the documentation, this extension also provides a file called daugtherwiki.sql, however it's not present in release 1.15.x. I notice it is present if I download an earlier version. Can I use the file from an older version? I've checked the subversion source repository, it not present anymore in the trunk. Where can I find the latest version? --85.91.175.221 09:38, 30 June 2009 (UTC)

daughterwiki.sql is missing in v1.15.x and Unknown column 'rev_len' in 'field list'- solved
it seems if you use tables.sql in the maintenance folder (of MediaWiki) it will work.

Here's my experience installing this extension
On a new mediawiki 1.15 installation, running on sub domain... I was writing instructions as I went for future times when I need to do this (I don't think there will be a second time).


 * 1) Install mediawiki (with PREFIX!)
 * 2) Decide on hosting strategy (I choose URL Prefix)
 * 3) Download your version of Farmer from here Special:ExtensionDistributor/Farmer
 * 4) Upload the .tar.gz to the /extensions/ directory and unzip it (a /Farmer/ folder will be created)
 * 5) Add this code snippet to the bottom of /LocalSettings.php

require_once( 'farmer/Farmer.php' ); $wgFarmer = new MediaWikiFarmer( $wgFarmerSettings ); $wgFarmer->run;


 * 1) Add some configuration (you may as well do this in the previous step)

require_once( 'extensions/Farmer/Farmer.php' ); $wgFarmerSettings['defaultWiki'] = 'wiki'; # without the prefix separator apparently $wgFarmerSettings['wikiIdentifierFunction'] = array( 'MediaWikiFarmer', '_matchByServerName' ); $wgFarmerSettings['dbAdminUser'] = 'MYDBUSER'; $wgFarmerSettings['dbAdminPassword'] = 'MYPASSWORD'; $wgFarmerSettings['dbTablePrefixSeparator'] = '_'; $wgFarmerSettings['newDbSourceFile'] = realpath( dirname( __FILE__ ) ). '/extensions/Farmer/daughterwiki.sql'; $wgFarmer = new MediaWikiFarmer( $wgFarmerSettings ); $wgFarmer->run;


 * 1) Add a /configs/ directory to the /extensions/Farmer/ directory and set it to 777
 * 2) Access the homepage to install Farmer (make sure /configs/ is writable)
 * 3) * You may need to wait a bit and do a full refresh
 * 4) Go to Special:Allmessages
 * 5) Login as WikiSysop and create the pages for "farmerwikiurl" and "farmerinterwikiurl", seting the values to

http://wiki.MYDOMAIN.com/$1 and http://wiki.MYDOMAIN.com/$1/$2


 * 1) Go to Special:Farmer to set some settings ("Bad things happen unless you do this")
 * 2) Try creating a new wiki via the admin tool
 * 3) * It might say daughterwiki.sql is missing (it was missed in the 1.15 distribution, download it from 1.14)
 * 4) Try fixing the errors it spits out...

THIS INSTALLATION IS A PIECE OF SHIT AND SO ARE THE INSTRUCTIONS (but thanks for some free software and sorry about my frustration)

3 hours later.... I give up, but the next step would be to go through and try all those config variables and see if you can find one that's necessary that was never listed in the example and hence has not been set properly.

No success
Did not manage to get Farmer running. I get the farmer page on the wiki and I can create wikis. This is done on Mediawiki 1.15.3. For this version I adapted daughterwiki.sql from an earlier version. The problem I have that the generated links lead to file not found error.I decided to use URL Prefix Hosting Strategy. Any ideas? --Dramtix 07:45, 28 May 2010 (UTC)

Please fix
This extension is majorly broken, could the dev look into it? PseudoOne 19:17, 17 October 2010 (UTC)

How we can reach to new created wikis
I have many trouble to run farmer on mediawiki. At the and I have successfully run but couldn't access to newly created wiki.

Thaks

Session problem
2011-01-13 I managed to install Farmer, everything is working correctly except I got sessions and cookies error when i try to login. I cant understand where is the problem. Tried it with the nightly build mw and the 1.16mw, same problem. Did someone manage to install it without any bugs?

Infobox status
The infobox for extensions could use a 'status' field that indicates level of polish and completeness. 24.61.47.46 08:50, 22 January 2011 (UTC)

white page after creating new wiki
All things works But after create a new wiki, and clik on http://wiki.mysite.com/newwiki/ I have :

Not Found

The requested URL /newwiki/ was not found on this server.

Someone help? Thx

Great Job
Hi, we have chosen this extension for a project within our company to integrate our product (a school management system) with mediawiki. So far, though we are still in development stage, the Farmer looks pretty good and it has delivered what it promised So first of all my congratulation for the nice job. Everything seems to work pretty nice. As we need some automation ( on onunknownwiki we actually want to create a wiki) and we have solved this by using the mediawiki hooks and leaving the extension pure as it is.

I've also became curious about the upgrading when it involves database changes. As far as I manage to understand, the Farmer will not be called to upgrade all the instances in a database right? Is this a planned thing the might be out there or would it be good for the extension if we could contribute this for the extension? We still haven't manage to level this up (tech team and hosting team are discussing the need of upgrading) but it is my perspective this could actually benefit farmer extension.

Thanks for the god work

Blank Page
Whenever i try to use the extension i get a blank page. Bill9929 04:07, 10 December 2011 (UTC)

Installation was ok, but extension doesn't work
My configuration:

.htaccess settings:

LocalSettings.php: I have facebook extension also.

I had to add the following variable in LocalSettings.php: and had to change the following variable in the same file to Also the config folder for this extension was not created and I had to create it as well: /home/sixthtas/public_html/wiki/extensions/Farmer/configs/ After the above, my site started loading.

But when I try add new wiki i see this errors: http://sixthtaste.com/step1.jpg http://sixthtaste.com/step2.jpg http://sixthtaste.com/step3.jpg

How can I decide this problem?