4 * Copyright (C) 2010 Olaf Lenz
6 * This file is part of FusionForge.
8 * FusionForge is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with FusionForge; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /** This script will destroy a mediawiki instance of a specific project. */
25 echo "Usage " . $argv[0] . " <project>\n";
29 include dirname(__FILE__) . '/../../env.inc.php';
30 require_once $gfwww.'include/pre.php';
31 include $gfplugins . 'mediawiki/common/config-vars.php';
33 $projects_path = forge_get_config('projects_path', 'mediawiki');
36 foreach ($argv as $project) {
37 echo "Removing project wiki of $project.\n";
39 $project_dir = "$projects_path/$project";
40 echo " Deleting project subdir $project_dir.\n";
41 if (!is_dir($project_dir)) {
42 echo "$project_dir does not exist!\n";
44 system("rm -rf $project_dir");
47 $schema = "plugin_mediawiki_$project";
48 strtr($schema, "-", "_");
49 echo " Dropping database schema $schema.\n";
50 $res = db_query_params("DROP SCHEMA $schema CASCADE", array());
58 // c-file-style: "bsd"