<commit_before><?php
namespace Wpbootstrap\Commands;

/**
 * Class Import
 * @package Wpbootstrap
 */
class Import extends BaseCommand
{
    /**
     * @var \stdClass
     */
    public $posts;

    /**
     * @var \stdClass
     */
    public $taxonomies;

    /**
     * @var \stdClass
     */
    public $menus;

    /**
     * @var \stdClass
     */
    public $sidebars;


    public function run($args, $assocArgs)
    {
        $app = \Wpbootstrap\Bootstrap::getApplication();
        $cli = $app['cli'];

        error_reporting(-1);

        $extensions = $app['extensions'];
        $extensions->init();

        require_once $app['path'] . '/wp-admin/includes/image.php';

        $this->baseUrl = get_option('siteurl');
        $this->uploadDir = wp_upload_dir();


        // Run the import
        do_action('wp-bootstrap_before_import');

        $cli->log('Importing settings');
        //$this->importSettings();
        do_action('wp-bootstrap_after_import_settings');

        $cli->log('Importing content');
        //$this->importContent();<commit_msg>almost all the import process converted for 0.4.0<commit_after><?php
namespace Wpbootstrap\Commands;

/**
 * Class Import
 * @package Wpbootstrap
 */
class Import extends BaseCommand
{
    /**
     * @var \stdClass
     */
    public $posts;

    /**
     * @var \stdClass
     */
    public $taxonomies;

    /**
     * @var \stdClass
     */
    public $menus;

    /**
     * @var \stdClass
     */
    public $sidebars;


    public function run($args, $assocArgs)
    {
        $app = \Wpbootstrap\Bootstrap::getApplication();
        $cli = $app['cli'];

        error_reporting(-1);

        $extensions = $app['extensions'];
        $extensions->init();


        $this->baseUrl = get_option('siteurl');
        $this->uploadDir = wp_upload_dir();

        // Run the import
        do_action('wp-bootstrap_before_import');

        $cli->log('Importing settings');
        $importOptions = $app['importoptions'];
        $importOptions->import();
        do_action('wp-bootstrap_after_import_settings');

        $cli->log('Importing content');

        $cli->debug('Importing posts');
        $posts = $app['importposts'];
        $posts->import();

        $cli->debug('Importing taxonomies');
        $taxonomies = $app['importtaxonomies'];
        $taxonomies->import();

        $cli->debug('Importing menus');
        $menus = $app['importmenus'];
        $menus->import();

        $cli->debug('Importing sidebars');
        $sidebars = $app['importsidebars'];
        $sidebars->import();

        //$taxonomies->assignObjects();
{'fraction_non_alphanumeric': 0.16342115311187477, 'fraction_numerical': 0.0019091256204658267, 'mean_word_length': 2.2465923172242874, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6504189', 'n_tokens_mistral': 807, 'n_tokens_neox': 775, 'n_words': 139}