Index: trunk/extensions/SecurePoll/includes/Election.php |
— | — | @@ -358,6 +358,21 @@ |
359 | 359 | } |
360 | 360 | |
361 | 361 | /** |
| 362 | + * Get property names which aren't included in an XML dump |
| 363 | + */ |
| 364 | + function getPropertyDumpBlacklist( $options = array() ) { |
| 365 | + if ( !empty( $options['jump'] ) ) { |
| 366 | + return array( |
| 367 | + 'gpg-encrypt-key', |
| 368 | + 'gpg-sign-key', |
| 369 | + 'gpg-decrypt-key' |
| 370 | + ); |
| 371 | + } else { |
| 372 | + return array(); |
| 373 | + } |
| 374 | + } |
| 375 | + |
| 376 | + /** |
362 | 377 | * Tally the valid votes for this election. |
363 | 378 | * Returns a Status object. On success, the value property will contain a |
364 | 379 | * SecurePoll_ElectionTallier object. |
Index: trunk/extensions/SecurePoll/includes/Entity.php |
— | — | @@ -220,8 +220,11 @@ |
221 | 221 | */ |
222 | 222 | function getConfXmlEntityStuff( $options = array() ) { |
223 | 223 | $s = Xml::element( 'id', array(), $this->getId() ) . "\n"; |
| 224 | + $blacklist = $this->getPropertyDumpBlacklist( $options ); |
224 | 225 | foreach ( $this->getAllProperties() as $name => $value ) { |
225 | | - $s .= Xml::element( 'property', array( 'name' => $name ), $value ) . "\n"; |
| 226 | + if ( !in_array( $name, $blacklist ) ) { |
| 227 | + $s .= Xml::element( 'property', array( 'name' => $name ), $value ) . "\n"; |
| 228 | + } |
226 | 229 | } |
227 | 230 | if ( isset( $options['langs'] ) ) { |
228 | 231 | $langs = $options['langs']; |
— | — | @@ -243,4 +246,12 @@ |
244 | 247 | return $s; |
245 | 248 | } |
246 | 249 | |
| 250 | + /** |
| 251 | + * Get property names which aren't included in an XML dump. |
| 252 | + * Overloaded by Election. |
| 253 | + */ |
| 254 | + function getPropertyDumpBlacklist( $options = array() ) { |
| 255 | + return array(); |
| 256 | + } |
| 257 | + |
247 | 258 | } |
Index: trunk/extensions/SecurePoll/cli/dump.php |
— | — | @@ -13,12 +13,12 @@ |
14 | 14 | Options: |
15 | 15 | -o <outfile> Output to the specified file |
16 | 16 | --votes Include vote records |
17 | | - --all-langs Include messages for all languages instead of just the primary |
| 17 | + --all-langs Include messages for all languages instead of just the primary |
18 | 18 | --jump Produce a configuration dump suitable for setting up a jump wiki |
19 | 19 | EOT; |
20 | 20 | |
21 | 21 | if ( !isset( $args[0] ) ) { |
22 | | - spFatal( "Usage: php dump.php [-o <outfile>] <election name>" ); |
| 22 | + spFatal( $usage ); |
23 | 23 | } |
24 | 24 | |
25 | 25 | $context = new SecurePoll_Context; |