Microweber\Utils\ComposerUpdate::run PHP Method

run() public method

public run ( $config_params = [] )
    public function run($config_params = array())
    {
        ob_start();
        $input = new ArgvInput(array());
        $output = new ConsoleOutput();
        $helper = new HelperSet();
        $config = new Config();
        if (!empty($config_params)) {
            $config_composer = array('config' => $config_params);
            $config->merge($config_composer);
        }
        //        $config_composer = array('config' => array(
        //            'prepend-autoloader' => false,
        //            'no-install' => true,
        //            'no-scripts' => true,
        //            'no-plugins' => true,
        //            'no-progress' => true,
        //            'no-dev' => true,
        //            'no-custom-installers' => true,
        //            'no-autoloader' => true
        //        ));
        $output->setVerbosity(0);
        $io = new ConsoleIO($input, $output, $helper);
        $composer = Factory::create($io);
        $composer->setConfig($config);
        $update = new UpdateCommand();
        $update->setComposer($composer);
        $out = $update->run($input, $output);
        ob_end_clean();
        return $out;
        //        $update = new InstallCommand();
        //        $update->setComposer($composer);
        //        $out = $update->run($input, $output);
        //  dd($output);
        //        $input = new ArrayInput(array('command' => 'update'));
        //
        ////Create the application and run it with the commands
        //        $application = new Application();
        //        $application->setAutoExit(false);
        //        $out = $application->run($input);
        //     dd($out);
        //        echo "Done.";
    }