From: Roland Mas Date: Thu, 31 May 2012 07:36:28 +0000 (+0000) Subject: Merged from 5.1: fix to Mediawiki wrapper X-Git-Tag: v5_2_rc1~9 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=3f1b8c0aad167445d61876d64fa553c519860a45;hp=8ad4c4fe5d1755e9367b4c7873c72f1639400d77 Merged from 5.1: fix to Mediawiki wrapper --- diff --git a/src/plugins/mediawiki/bin/mw-wrapper.php b/src/plugins/mediawiki/bin/mw-wrapper.php index 6a286bb8b7..bc988799e9 100644 --- a/src/plugins/mediawiki/bin/mw-wrapper.php +++ b/src/plugins/mediawiki/bin/mw-wrapper.php @@ -1,25 +1,30 @@ #! /usr/bin/php -f + * All rights reserved. * - * This file is part of FusionForge. + * This file is part of FusionForge. FusionForge is free software; + * you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software + * Foundation; either version 2 of the Licence, or (at your option) + * any later version. * - * FusionForge is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, - * or (at your option) any later version. - * - * FusionForge is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * FusionForge is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * with FusionForge; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *- + * Wrapper to call MediaWiki maintenance scripts on a forge project wiki. */ if (count ($argv) < 3) { @@ -34,7 +39,7 @@ $wrapperscript = array_shift ($argv) ; $fusionforgeproject = array_shift ($argv) ; $mwscript = array_shift ($argv) ; -require_once dirname(__FILE__) . '/../../../www/env.inc.php'; +require_once dirname(__FILE__).'/../../../common/include/env.inc.php'; require_once $gfcommon.'include/pre.php'; require_once $gfcommon.'include/cron_utils.php'; @@ -46,13 +51,20 @@ setup_plugin_manager () ; $group = group_get_object_by_name($fusionforgeproject) ; if (!$group || $group->isError()) { - die ("Wrong group!\n") ; + die("Wrong group! " . + ($group ? $group->getErrorMessage() : "") . "\n"); } if (!$group->usesPlugin('mediawiki')) { die ("Project doesn't use the Mediawiki plugin\n") ; } +function ffmw_wrapper_fixup_searchpath($username) { + db_query_params("ALTER ROLE $username SET search_path = public", + array()); +} +register_shutdown_function('ffmw_wrapper_fixup_searchpath', + forge_get_config('database_user')); define( "MEDIAWIKI", true ); require_once $gfwww.'plugins/mediawiki/LocalSettings.php' ; @@ -65,5 +77,3 @@ array_unshift ($argv, $mwscript, '--conf', $fusionforge_basedir . '/plugins/medi while (@ob_end_flush()); require_once $mwscript ; - -?>