To handle console command
197111
public function handle()
    {
        $controllerName = $this->input->getArgument('name');

        $controllerNamespace = $this->getNamespace('Controllers', $controllerName);

        $isPlain = $this->input->getOption('plain');
        $isResource = $this->input->getOption('resource');

        if($isPlain) {
            $controllerStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeControllerPlain.txt');
        } elseif($isResource) {
            $controllerStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeControllerResource.txt');
        } else {
            $controllerStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeController.txt');
        }

        $controllerStubs = str_replace([ 'dummyControllerName', 'dummyNamespace', '\\\\' ], [ basename($controllerName), $controllerNamespace, '\\' ], $controllerStubs);

        if(!file_exists($filename = app_path() ."/Controllers/{$controllerName}Controller.php")) {
            $this->filesystem->create($filename, $controllerStubs);
            $this->info("{$controllerName}Controller has been created successfully.");
        } else {
            $this->info("{$controllerName}Controller already exists.");
        }
    }
499560
public function handle()
    {

        if (! $this->preflighted()) return;

        CharacterPlanet::where('character_id', $this->getCharacterId())->get()->each(function ($planet) {

            $planet_detail = $this->retrieve([
                'character_id' => $this->getCharacterId(),
                'planet_id'    => $planet->planet_id,
            ]);

            // seed database with pins
            collect($planet_detail->pins)->each(function ($pin) use ($planet) {

                CharacterPlanetPin::firstOrNew([
                    'character_id' => $this->getCharacterId(),
                    'planet_id'    => $planet->planet_id,
                    'pin_id'       => $pin->pin_id,
                ])->fill([
                    'type_id'          => $pin->type_id,
                    'schematic_id'     => $pin->schematic_id ?? null,
                    'latitude'         => $pin->latitude,
                    'longitude'        => $pin->longitude,
                    'install_time'     => property_exists($pin, 'install_time') ?
                        carbon($pin->install_time) : null,
                    'expiry_time'      => property_exists($pin, 'expiry_time') ?
                        carbon($pin->expiry_time) : null,
                    'last_cycle_start' => property_exists($pin, 'last_cycle_start') ?
                        carbon($pin->last_cycle_start) : null,
                ])->save();

                // Collect data for the cleanup phase
                $this->planet_pins->push($pin->pin_id);

                if (property_exists($pin, 'factory_details')) {

                    CharacterPlanetFactory::firstOrNew([
                        'character_id' => $this->getCharacterId(),
                        'planet_id'    => $planet->planet_id,
                        'pin_id'       => $pin->pin_id,
                    ])->fill([
                        'schematic_id' => $pin->factory_details->schematic_id,
                    ])->save();

                    // seeding garbage collector
                    $this->planet_factories->push($pin->pin_id);
                }

                if (property_exists($pin, 'extractor_details')) {

                    CharacterPlanetExtractor::firstOrNew([
                        'character_id' => $this->getCharacterId(),
                        'planet_id'    => $planet->planet_id,
                        'pin_id'       => $pin->pin_id,
                    ])->fill([
                        'product_type_id' => $pin->extractor_details->product_type_id ?? null,
                        'cycle_time'      => $pin->extractor_details->cycle_time ?? null,
                        'head_radius'     => $pin->extractor_details->head_radius ?? null,
                        'qty_per_cycle'   => $pin->extractor_details->qty_per_cycle ?? null,
                    ])->save();

                    // Collect data for the cleanup phase
                    $this->planet_extractors->push($pin->pin_id);

                    collect($pin->extractor_details->heads)->each(function ($head) use ($planet, $pin) {

                        CharacterPlanetHead::firstOrNew([
                            'character_id' => $this->getCharacterId(),
                            'planet_id'    => $planet->planet_id,
                            'extractor_id' => $pin->pin_id,
                            'head_id'      => $head->head_id,
                        ])->fill([
                            'latitude'  => $head->latitude,
                            'longitude' => $head->longitude,
                        ])->save();

                        // seeding garbage collector
                        $this->planet_heads->push([
                            'extractor_id' => $pin->pin_id,
                            'head_id'      => $head->head_id,
                        ]);
                    });
                }

                if (property_exists($pin, 'contents')) {

                    collect($pin->contents)->each(function ($content) use ($planet, $pin) {

                        CharacterPlanetContent::firstOrNew([
                            'character_id' => $this->getCharacterId(),
                            'planet_id'    => $planet->planet_id,
                            'pin_id'       => $pin->pin_id,
                            'type_id'      => $content->type_id,
                        ])->fill([
                            'amount' => $content->amount,
                        ])->save();

                        // seeding garbage collector
                        $this->planet_contents->push([
                            'pin_id'  => $pin->pin_id,
                            'type_id' => $content->type_id,
                        ]);

                    });
                }
            });

            collect($planet_detail->links)->each(function ($link) use ($planet) {

                CharacterPlanetLink::firstOrNew([
                    'character_id'       => $this->getCharacterId(),
                    'planet_id'          => $planet->planet_id,
                    'source_pin_id'      => $link->source_pin_id,
                    'destination_pin_id' => $link->destination_pin_id,
                ])->fill([
                    'link_level' => $link->link_level,
                ])->save();

                // Collect data for the cleanup phase
                $this->planet_links->push([
                    'source_pin_id'      => $link->source_pin_id,
                    'destination_pin_id' => $link->destination_pin_id,
                ]);

            });

            collect($planet_detail->routes)->each(function ($route) use ($planet) {

                CharacterPlanetRoute::firstOrNew([
                    'character_id' => $this->getCharacterId(),
                    'planet_id'    => $planet->planet_id,
                    'route_id'     => $route->route_id,
                ])->fill([
                    'source_pin_id'      => $route->source_pin_id,
                    'destination_pin_id' => $route->destination_pin_id,
                    'content_type_id'    => $route->content_type_id,
                    'quantity'           => $route->quantity,
                ])->save();

                // seeding garbage collector
                $this->planet_routes->push($route->route_id);

                if (property_exists($route, 'waypoints')) {
                    collect($route->waypoints)->each(function ($waypoint) use ($planet, $route) {

                        CharacterPlanetRouteWaypoint::firstOrNew([
                            'character_id' => $this->getCharacterId(),
                            'planet_id'    => $planet->planet_id,
                            'route_id'     => $route->route_id,
                            'pin_id'       => $waypoint,
                        ])->save();

                        // seeding garbage collector
                        $this->planet_waypoints->push([
                            'route_id' => $route->route_id,
                            'pin_id'   => $waypoint,
                        ]);

                    });
                }
            });

            $this->planetCleanup($planet);
        });
    }
1008835
public function handle()
    {
        if (is_null($this->argument('name'))) {
            $this->installFromFile();

            return;
        }

        $this->install(
            $this->argument('name'),
            $this->argument('version'),
            $this->option('type'),
            $this->option('tree')
        );
    }
902157
public function handle()
    {
        $version = $this->version();

        foreach (static::$slugs as $os => $slug) {
            $archive = $this->download($version, $slug);

            $binary = $this->extract($archive);

            $this->rename($binary, $os);
        }

        $message = "ChromeDriver binaries successfully updated to version %s.";

        $this->info(sprintf($message, $version));
    }
1234430
public function handle()
    {
        $this->writeln();
        $this->writeln('Example help screen');
        $this->writeln();
        $this->writeln('Usage: helloworld [OPTIONS]');
        $this->writeln('A Hello World application to demonstrate Clip');
        $this->writeln();
        $this->writeln('Commands:');
        $this->writeln('  help       - This information screen');
        $this->writeln('  test       - A silly test example');
        $this->writeln('  flags      - Example using options.');
        $this->writeln('  profile    - Example of required --name and --age options.');
        $this->writeln('  check:name - User input example');

        $this->writeln();
        $this->exitWithSuccess();
    }
843993
def handle(self):
        
        self.output = PyStratumStyle(self.input, self.output)

        config_file = self.argument('config_file')
        sources = self.argument('file_names')

        status = self.run_command(config_file, sources)

        return status
794246
public function handle()
    {
        ENV::set('APP_KEY', str_random(32));
        $this->configurate();
        $console = new Console;
        var_dump($console->pulse('migrate', true));
        $console->pulse('pulsar:configurate');
        (new Installer)->install();
    }
611363
public static function handleCommand() {
        try {
            global $argv;
            $tokens = array_slice($argv, 1);

            if (empty($tokens)) {
                throw new RuntimeException("Command name is required !!");
            }

            $commandName = (string)$tokens[0];
            $commandTokens = array_slice($tokens, 1);

            $commandParameters = [];
            $currentCommandName = null;

            for ($i = 0; $i < sizeof($commandTokens); $i++) {
                $commandToken = $commandTokens[$i];

                if (substr($commandToken, 0, 2) == '--') {
                    if ($currentCommandName != null) {
                        $commandParameters[$currentCommandName] = true;
                    }
                    $currentCommandName = substr($commandToken, 2);
                }
                else {
                    if ($currentCommandName == null) {
                        throw new RuntimeException("Invalid argument \"$commandToken\". Arguments must start with \"--\"");
                    }
                    $commandParameters[$currentCommandName] = $commandToken;
                    $currentCommandName = null;
                }
            }

            if ($currentCommandName != null) {
                $commandParameters[$currentCommandName] = true;
            }

            self::executeCommand($commandName, $commandParameters);
        }
        catch (CommandNotFoundException $exception) {
            get_logger()->warning($exception->getMessage());
            echo $exception->getMessage() . "\n";
        }
    }
280582
public function handle() {
		\Config::set('filesystems.default', 'it');

		$do = $this->argument('do');
		if ($do == 'come-here') {
			if (!class_exists('ZipArchive')) {
				$this->error("It".$this->beer."' tell you - you should be enable the ZipArchive Extention On Your Apache To continue ");
				return '';
			}
			/*$this->line("It".$this->beer."' .::. prepare all files and cloning please wait...");
			shell_exec('git clone https://github.com/arabnewscms/it-come ');

			$zip = new ZipArchive;
			$res = $zip->open(base_path('it-come/it.zip'));
			if ($res === TRUE) {
			$zip->extractTo(base_path('app'));
			$zip->close();
			}
			 */
			/*$it_des = $zip->open(base_path('it-come/it_des.zip'));
			if ($it_des === TRUE) {
			$zip->extractTo(base_path('public'));
			$zip->close();
			}*/
			/*$itHelper = file_get_contents(base_path('it-come/it.php'));
			Storage::put('app/itHelpers/it.php', $itHelper);*/

			/*Storage::deleteDirectory('it-come');
		$this->line("It".$this->beer."' .::.  amazing i am ready now to assist you ".$this->love);*/

		} else if ($do == 'go-out') {
			if ($this->confirm('are you sure you want to delete (it) '.$this->ops.' ?')) {
				$this->line("It".$this->beer."' .::. omg i am sad but okay please wait to delete my files");

				$uninstall = new ItUninstall;
				$uninstall->uninstall_merge();
				shell_exec('composer remove "phpanonymous/it": "^1.0"');
				//$itHelper = file_get_contents(base_path('app/itHelpers/it.php'));
				//Storage::put('app/itHelpers/it.php', '');
				//Storage::deleteDirectory('app/it');
				Storage::deleteDirectory('public/it_des');
				$this->line("It".$this->beer."' .::. okay all is done Bye Bye :( ");

			} else {
				$this->line("It".$this->beer."' .::.  okay i am still here to assist you ".$this->love);
			}

		}
	}
1123132
public function handle()
    {
        parent::handle();

        $controllerGenerator = new APIControllerGenerator($this->commandData);
        $controllerGenerator->generate();

        $this->performPostActions();
    }
763839
public function handle()
    {
        $this->processInput();
        $tmpfile = $this->createTmpFileWithMenu();
        $path = $this->getPath($tmpfile);
        add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile());
        $this->info('Menu ' . $this->name() . ' added to ' .  $dstFile . '.');
        $this->postActions();
    }
188868
public function handle()
    {
        if ($this->checkIfCanIncrement('current')) {
            $number = app('pragmarx.version')->incrementPatch();

            $this->info("New patch: {$number}");

            $this->displayAppVersion();
        }
    }
123367
public function handle()
    {
        if ($this->checkIfCanIncrement('current')) {
            $number = app('pragmarx.version')->incrementMinor();

            $this->info("New minor version: {$number}");

            $this->displayAppVersion();
        }
    }
236539
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $this->migrator->setConnection($this->option('database'));

        // Next, we will check to see if a path option has been defined. If it has
        // we will use the path relative to the root of this installation folder
        // so that migrations may be run for any path within the applications.
        $this->migrator->run($this->getMigrationPaths(), [
            'pretend' => $this->option('pretend'),
            'step' => $this->option('step'),
        ]);
        // Once the migrator has run we will grab the note output and send it out to
        // the console screen, since the migrator itself functions without having
        // any instances of the OutputInterface contract passed into the class.
        foreach ($this->migrator->getNotes() as $note) {
            $this->output->writeln($note);
        }
        // Finally, if the "seed" option has been given, we will re-run the database
        // seed task to re-populate the database, which is convenient when adding
        // a migration and a seed at the same time, as it is only this command.
        if ($this->option('seed')) {
            $this->call('db:seed', ['--force' => true]);
        }
    }
96014
public function handle()
    {
        if (! is_dir(base_path('tests/Browser/Pages'))) {
            mkdir(base_path('tests/Browser/Pages'), 0755, true);
        }

        if (! is_dir(base_path('tests/Browser/Components'))) {
            mkdir(base_path('tests/Browser/Components'), 0755, true);
        }

        if (! is_dir(base_path('tests/Browser/screenshots'))) {
            $this->createScreenshotsDirectory();
        }

        if (! is_dir(base_path('tests/Browser/console'))) {
            $this->createConsoleDirectory();
        }

        $stubs = [
            'ExampleTest.stub' => base_path('tests/Browser/ExampleTest.php'),
            'HomePage.stub' => base_path('tests/Browser/Pages/HomePage.php'),
            'DuskTestCase.stub' => base_path('tests/DuskTestCase.php'),
            'Page.stub' => base_path('tests/Browser/Pages/Page.php'),
        ];

        foreach ($stubs as $stub => $file) {
            if (! is_file($file)) {
                copy(__DIR__.'/../../stubs/'.$stub, $file);
            }
        }

        $this->info('Dusk scaffolding installed successfully.');

        $this->comment('Downloading ChromeDriver binaries...');

        $this->call('dusk:chrome-driver', ['--all' => true]);
    }
921924
public function handle()
    {
        $systems = new MigrationTool\availableSystems();
        $availableInputSystems = $systems->getAvailableInputSystems();
        $availableOutputSystems = $systems->getAvailableOutputSystems();

        //start menu to aks for In- and Output CMS-Format
        list ($inputCMS, $outputCMS) = $this->chooseCMS($availableInputSystems, $availableOutputSystems);

        //start menu to ask for In- and Output Root-Paths
        list ($rootPathInputCMS, $rootPathOutputCMS) = $this->getInputAndOutputDisk();

        //Initiale Input disk
        if ($rootPathInputCMS == 'input') {
            /** @var FileSystem $inputDisk */
            $inputDisk = Storage::disk('cms.migrations.input');
        } else {
            /** @var FileSystem $inputDisk */
            Config::set('filesystems.disks.cms.migrations.custom_input.root', $rootPathInputCMS);
            $inputDisk = Storage::disk('cms.migrations.custom_input');
        }

        //Initiale Output disk
        if ($rootPathOutputCMS == 'output') {
            /** @var FileSystem $outputDisk */
            $outputDisk = Storage::disk('cms.migrations.output');
        } else {
            /** @var FileSystem $outputDisk */
            Config::set('filesystems.disks.cms.migrations.custom_output.root', $rootPathOutputCMS);
            $outputDisk = Storage::disk('cms.migrations.custom_output');
        }

        // TODO Kontrollieren ob richtiger Typ!
        /** @var BaseFormat $inputFormat */
        $inputFormat = new $availableInputSystems[$inputCMS]($inputDisk);

        /** @var BaseFormat $outputClass */
        $outputClass = new $availableOutputSystems[$outputCMS]($inputFormat, $outputDisk);

        $inputFormat->setOtherFormat($outputClass);

//        $this->output->progressStart(10);
        $wrongFiles = $outputClass->startMigration();
//        for ($i = 0; $i < 10; $i++) {
//            sleep(1);
//
//            $this->output->progressAdvance();
//        }
//        $this->output->progressFinish();

        if (is_array($wrongFiles)) {
            $this->table(['problematic file'], $wrongFiles);
        } // if
    }
1078387
public function handle()
    {
        try {
            $data = $this->argument('data');
            if (filter_var($data, FILTER_VALIDATE_URL)) {
                // need to download file
                $data = FileUtilities::importUrlFileToTemp($data);
            }

            if (is_file($data)) {
                $data = file_get_contents($data);
            }

            $format = $this->option('format');
            $format = DataFormats::toNumeric($format);
            $this->comment($format);

            $service = $this->option('service');
            $resource = $this->option('resource');
            $result = ServiceManager::handleRequest($service, Verbs::POST, $resource, [], [], $data, $format, false);
            if ($result->getStatusCode() >= 300) {
                $this->error(print_r($result->getContent(), true));
            } else {
                $this->info('Import complete!');
            }
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
    }