meza
meza copied to clipboard
Consider setting up primewiki as foreign file repo
This would allow using the primewiki like InstantCommons (Wikimedia Commons). To make this work, add the following code:
if ( is_array( $primewiki ) ) {
$primeWikiId = $primewiki['id'];
$wgForeignFileRepos[] = array(
'class' => 'ForeignDBRepo',
'name' => 'primewikifiles', // any unique name I think
'url' => "$wgServer/$primeWikiId/img_auth.php",
'directory' => "/opt/meza/htdocs/wikis/$primeWikiId/images",
'hashLevels' => 2,
'dbType' => $wgDBtype,
'dbServer' => $wgDBserver,
'dbUser' => $wgDBuser,
'dbPassword' => $wgDBpassword,
'dbFlags' => DBO_DEFAULT,
'dbName' => $primewiki['database'],
'tablePrefix' => '',
'hasSharedCache' => false,
'descBaseUrl' => "$wgServer/$primeWikiId/index.php/File:",
'fetchDescription' => false
);
}
Note that these files don't appear to show in searches. I'm not sure if that's an indexing issue (indexing hasn't run on them yet) or by design (e.g. small wikis don't want to be clobbered by Commons).
This worked for me on a modified Meza:
// Set the English wiki to share images with everyone
$wgForeignFileRepos[] = [
'class' => 'ForeignDBRepo',
'name' => 'mainwiki',
'url' => "$wgServer/wiki/en/img_auth.php",
'directory' => '/opt/data-meza/uploads-gluster/en',
'hashLevels' => 2, // This must be the same for the other family member
'dbType' => 'mysql',
'dbServer' => $wgDBservers[0]['host'],
'dbUser' => $mezaDatabaseUser,
'dbPassword' => $mezaDatabasePassword,
'dbFlags' => DBO_DEFAULT,
'dbName' => 'wiki_en',
'tablePrefix' => '',
'hasSharedCache' => false,
'descBaseUrl' => "$wgServer/wiki/en/File:",
'fetchDescription' => false
];