|
28 | 28 | * --classes Export only concepts and categories
|
29 | 29 | * --properties Export only properties
|
30 | 30 | * --individuals Export only pages that are no categories, properties, or types
|
| 31 | + * --namespace <namespacelist> |
| 32 | + * Export only namespaces included in <namespacelist> |
| 33 | + * Example: --namespace "NS_Example1|NS_Example3|SMW_CONCEPT" with | being used as separator. |
| 34 | + * Uses constant namespace names. |
31 | 35 | * --page <pagelist> Export only pages included in the <pagelist> with | being used as a separator.
|
32 | 36 | * Example: --page "Page 1|Page 2", -e, -file, -d are ignored if --page is given.
|
33 | 37 | * -d <delay> Slows down the export in order to stress the server less,
|
@@ -68,7 +72,11 @@ public function __construct() {
|
68 | 72 | $this->addOption( 'properties', 'Export only properties', false );
|
69 | 73 | $this->addOption( 'individuals', 'Export only individuals', false );
|
70 | 74 |
|
71 |
| - $this->addOption( 'page', 'Export only pages included in the <pagelist> with | being used as a separator. ' . |
| 75 | + $this->addOption('namespace','Export only namespaced included in the <namespacelist> with | being used as a separator. ' . |
| 76 | + 'Example: --namespace "NS_NS1|NS_NS2|NS_NS3"',false,true); |
| 77 | + |
| 78 | + |
| 79 | + $this->addOption( 'page', 'Export only pages included in the <pagelist> with | being used as a separator. ' . |
72 | 80 | 'Example: --page "Page 1|Page 2", -e, -file, -d are ignored if --page is given.', false, true );
|
73 | 81 |
|
74 | 82 | $this->addOption( 'server', '<server> The protocol and server name to as base URLs, e.g. http://en.wikipedia.org. ' .
|
@@ -176,10 +184,15 @@ private function runExport() {
|
176 | 184 | $pages = explode( '|', $this->getOption( 'page' ) );
|
177 | 185 | }
|
178 | 186 |
|
179 |
| - if ( $this->hasOption( 'server' ) ) { |
| 187 | + if ( $this->hasOption( 'namespace' ) ) { |
| 188 | + $restrictNamespaceTo = array_map('constant', explode( '|', $this->getOption( 'namespace' ) ) ); |
| 189 | + } |
| 190 | + |
| 191 | + if ( $this->hasOption( 'server' ) ) { |
180 | 192 | $GLOBALS['wgServer'] = $this->getOption( 'server' );
|
181 | 193 | }
|
182 | 194 |
|
| 195 | + |
183 | 196 | $exporterFactory = new ExporterFactory();
|
184 | 197 |
|
185 | 198 | $exportController = $exporterFactory->newExportController(
|
|
0 commit comments