Ejemplo n.º 1
0
 echo 'Beginning import<br />';
 flush();
 ob_flush();
 /*
  * Step through each parser method.
  */
 if ($parser->test_environment() !== FALSE) {
     echo 'Environment test succeeded<br />';
     if ($parser->populate_db() !== FALSE) {
         $edition_errors = $parser->handle_editions($_POST);
         if (count($edition_errors) > 0) {
             $args = $_POST;
             $args['import_errors'] = $edition_errors;
             echo show_admin_forms($args);
         } else {
             $parser->clear_apc();
             /*
              * We should only continue if parsing was successful.
              */
             if ($parser->parse()) {
                 $parser->build_permalinks();
                 $parser->write_api_key();
                 $parser->export();
                 $parser->generate_sitemap();
                 $parser->index_laws();
                 $parser->structural_stats_generate();
                 $parser->prune_views();
             }
         }
     }
 }