public function initializeInstallerFactory(InputInterface $input)
    {
        $validate   = new Validate();
        $resolver   = new DatabaseResolver();
        $pluginDir  = realpath($validate->directory($input->getOption('plugin')));
        $pluginsDir = $input->getOption('extra-plugins');

        if (!empty($pluginsDir)) {
            $pluginsDir = realpath($validate->directory($pluginsDir));
        }

        $factory             = new InstallerFactory();
        $factory->moodle     = new Moodle($input->getOption('moodle'));
        $factory->plugin     = new MoodlePlugin($pluginDir);
        $factory->execute    = $this->execute;
        $factory->repo       = $validate->gitUrl($input->getOption('repo'));
        $factory->branch     = $validate->gitBranch($input->getOption('branch'));
        $factory->dataDir    = $input->getOption('data');
        $factory->dumper     = $this->initializePluginConfigDumper($input);
        $factory->pluginsDir = $pluginsDir;
        $factory->noInit     = $input->getOption('no-init');
        $factory->database   = $resolver->resolveDatabase(
            $input->getOption('db-type'),
            $input->getOption('db-name'),
            $input->getOption('db-user'),
            $input->getOption('db-pass'),
            $input->getOption('db-host')
        );

        return $factory;
    }