function test_ordering_of_importers() { global $wp_importers; $_wp_importers = $wp_importers; // Preserve global state $wp_importers = array('xyz1' => array('xyz1'), 'XYZ2' => array('XYZ2'), 'abc2' => array('abc2'), 'ABC1' => array('ABC1'), 'def1' => array('def1')); $this->assertEquals(array('ABC1' => array('ABC1'), 'abc2' => array('abc2'), 'def1' => array('def1'), 'xyz1' => array('xyz1'), 'XYZ2' => array('XYZ2')), get_importers()); $wp_importers = $_wp_importers; // Restore global state }
_e('ERROR:'); ?> </strong> <?php printf(__('The <strong>%s</strong> importer is invalid or is not installed.'), esc_html($_GET['invalid'])); ?> </p></div> <?php } ?> <p><?php _e('If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:'); ?> </p> <?php $importers = get_importers(); // If a popular importer is not registered, create a dummy registration that links to the plugin installer. foreach ($popular_importers as $pop_importer => $pop_data) { if (isset($importers[$pop_importer])) { continue; } if (isset($importers[$pop_data['importer-id']])) { continue; } $importers[$pop_data['importer-id']] = array($pop_data['name'], $pop_data['description'], 'install' => $pop_data['plugin-slug']); } if (empty($importers)) { echo '<p>' . __('No importers are available.') . '</p>'; // TODO: make more helpful } else { uasort($importers, '_usort_by_first_member');
} } register_exporting_handler(new MW_CLIExportingHandler()); miniwiki_boot(); if ($argc < 2) { echo MW_NAME, ' ', MW_VERSION, ' (c)2005,2006 Stepan Roh <*****@*****.**>', "\n"; ?> Usage: <?php echo $argv[0]; ?> [--omit-history] [--force-import] file dataspace[:resource_prefix]* Available formats: <?php foreach (get_importers() as $importer) { echo ' ' . $importer->get_format() . "\n"; } exit; } array_shift($argv); $with_history = true; $force_import = false; if ($argv[0] === '--omit-history') { $with_history = false; array_shift($argv); } if ($argv[0] === '--force-import') { $force_import = true; array_shift($argv); }