Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/23/2017 04:21:58 AM (9 years ago)
Author:
johnjamesjacoby
Message:

Admin/Converter: Lazy load admin & converter as needed.

  • Move admin class into its own file
  • Remove admin.php
  • Introduce _setup_ functions to make loading them on the fly easier
  • Simplify converter logic for smoother starting/stopping
  • Improved UI for timer/status updates
  • Remove double-duty variables from BBP_Converter and response data
  • Switch from text-only response value to JSON object for improved flexibility

This allows the converter to return more data, and makes it easier to work with that data.

Todo:

  • Error responses
  • Check that starts are bumping correctly inside of steps
  • Better utilize JSON responses
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/tools/converter.php

    r6456 r6601  
    2424    // Default
    2525    $files  = array();
    26     $path   = bbpress()->admin->admin_dir . 'converters/';
     26    $path   = bbp_setup_converter()->converters_dir;
    2727    $curdir = opendir( $path );
    2828
     
    6767    // Create a new converter object if it's found
    6868    if ( isset( $converters[ $platform ] ) ) {
     69
     70        // Include & create the converter
    6971        require_once $converters[ $platform ];
    70         return new $platform;
     72        if ( class_exists( $platform ) ) {
     73            return new $platform;
     74        }
    7175    }
    7276
Note: See TracChangeset for help on using the changeset viewer.