convert namespaces to sql
authorRiver Tarnell <kateturner@users.mediawiki.org>
Sun, 20 Mar 2005 03:29:12 +0000 (03:29 +0000)
committerRiver Tarnell <kateturner@users.mediawiki.org>
Sun, 20 Mar 2005 03:29:12 +0000 (03:29 +0000)
maintenance/namespace2sql.php [new file with mode: 0644]

diff --git a/maintenance/namespace2sql.php b/maintenance/namespace2sql.php
new file mode 100644 (file)
index 0000000..def0336
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+# $Header$
+#
+# Print SQL to insert namespace names into database.
+# This source code is in the public domain.
+
+require_once( "commandLine.inc" );
+
+for ($i = -2; $i < 16; ++$i) {
+       $nsname = wfStrencode( $wgLang->getNsText( $i ) );
+       $dbname = wfStrencode( $wgDBname );
+       print "INSERT INTO ns_name(ns_db, ns_num, ns_name) VALUES('$dbname', $i, '$nsname');\n";
+}
+
+?>