Prepare the application to execute a console command.
Removed migration and seeding providers

@return void
487912
public function prepareForConsoleCommand()
    {
        $this->withFacades();

        $this->make('cache');
        $this->make('queue');

        $this->configure('database');

        $this->register('Illuminate\Queue\ConsoleServiceProvider');
    }
1364061
protected function execConsoleApp()
    {
        $app = new Application();
        $config = $this->getConfigArray();
        $container = new Container(["settings" => $config]);
        $this->setupDependencies($container);
        $this->setupCommands($app, $container);
        $app->run();
    }
536630
public function prepare()
    {
        $this->taskFileSystemStack()
             ->mkdir($this->properties['dist.dir'])
             ->mkdir($this->properties['target.dir'])
             ->mkdir(sprintf('%s/reports', $this->properties['target.dir']))
             ->run();
    }
1349770
public function fire()
    {
        // It's possible for the developer to specify the tables to modify in this
        // schema operation. The developer may also specify if this table needs
        // to be freshly created so we can create the appropriate migrations.
        $name = trim($this->input->getArgument('name'));

        $table = $this->input->getOption('table');

        $create = $this->input->getOption('create') ?: false;

        // If no table was given as an option but a create option is given then we
        // will use the "create" option as the table name. This allows the devs
        // to pass a table name into this option as a short-cut for creating.
        if (!$table && is_string($create)) {
            $table = $create;

            $create = true;
        }

        // Now we are ready to write the migration out to disk. Once we've written
        // the migration out, we will dump-autoload for the entire framework to
        // make sure that the migrations are registered by the class loaders.
        $this->writeMigration($name, $table, $create);
    }
1049304
public function main()
  {
    // Get base info about project.
    $this->prepareProjectData();

    // Get all info about source files.
    $this->getInfoSourceFiles();

    // Get all info about resource files.
    $this->getInfoResourceFiles();

    // Prepare all place holders.
    $this->preparePlaceHolders();

    // Replace references to resource files with references to optimized/minimized resource files.
    $this->processingSourceFiles();

    // Compress and rename files with hash.
    $this->processResourceFiles();

    // Create pre-compressed versions of the optimized/minimized resource files.
    if ($this->gzipFlag) $this->gzipCompressOptimizedResourceFiles();

    // Remove original resource files that are optimized/minimized.
    $this->unlinkResourceFiles();
  }
1166513
protected function prepareDatabase()
    {
        $this->migrator->setConnection($this->option('database'));

        if (!$this->migrator->repositoryExists()) {
            $this->call(
                'migrate:install', ['--database' => $this->option('database')]
            );
        }
    }
853124
public function prepareTable()
    {
        $driver = $this->db->getDriver();
        $tableExistsSql = sprintf($this->checkTableSqls[$driver], $this->table);
        if ($this->checkTable && !$this->db->fetchColumn($tableExistsSql)) {
            $createTableSql = sprintf($this->createTableSqls[$driver], $this->table);
            $this->db->executeUpdate($createTableSql);
        }
    }
435183
private function prepareEnvironment()
    {
        $filesystem = $this->make(Filesystem::class);


        if ($filesystem instanceof Filesystem) {
            if ($filesystem->exists($path = $this->getEnvironmentPath())) {
                $env = $filesystem->get($path);


                array_map(
                    function ($env) {

                        if ($env !== '' && $env !== null) {
                            putenv($env);
                        }
                    },
                    explode("\n", $env)
                );

                $this->environments = count($_ENV) ? $_ENV : isset($_SERVER['ENV']) ? $_SERVER['ENV'] : [];
            }
        }

    }
624100
def prepare_app_pipeline():
    """"""
    runner = ForemastRunner()
    runner.write_configs()
    runner.create_app()
    runner.create_pipeline()
    runner.cleanup()
789608
private function prepareBuilder(): void
    {
        if (!file_exists($this->getReportCacheDir())) {
            @mkdir($this->getReportCacheDir(), 0777, true);
        }

        $this->builder
             ->setCacheDir($this->getReportCacheDir())
             ->initialise();

        return;
    }
39860
protected function prepare()
    {
        $this->register('require', function($context, $path) {
            $context->requireAsset($path);
        });

        $this->register('depend_on', function($context, $path) {
            $context->dependOn($path);
        });

        $this->register('require_tree', function($context, $path) {
            $context->requireTree($path);
        });

        $this->body = $this->getData();

        if (preg_match(static::HEADER_PATTERN, $this->getData(), $matches)) {
            $this->header = $matches[0];
            $this->body = substr($this->getData(), strlen($matches[0])) ?: '';
        }

        $this->processed = array();
    }
345819
public function prepare()
    {    
        if (!empty($this->module->templateTransCat)) {
            $this->tcModule = $this->module->tcModule;
            $this->tcModels = $this->module->tcModels;
            
            $id = Inflector::camel2id(basename($this->className()));
            $this->tc = str_replace('*', "/model-{$id}", $this->module->templateTransCat);
        }
        if (!empty($this->module->params['pageSize'])) {
            $this->pageSize = $this->module->params['pageSize'];
        }
    }
1115428
public function init()
    {
        $this->addCommand(Migration\CreateCommand::class);
        $this->addCommand(Migration\StatusCommand::class);
        $this->addCommand(Migration\MigrateCommand::class);
        $this->addCommand(Migration\ResetCommand::class);
        $this->addCommand(Migration\DropAllCommand::class);

        $this->addGlobalOption('d')
            ->alias('dir')
            ->description('Set migration file directory.');

        $this->addGlobalOption('p')
            ->alias('package')
            ->description('Package to run migration.');
    }
707651
public function runSetup()
    {
        if ($this->params->forceIsActive) {
            $this->consoleWriteLineWithIndent('Force mode active! Database will be generated', Color::YELLOW);
            
            $dbParams          = $this->getDbConnectionParams();    
            $dbConnectionCmd   = $this->getDbConnectionCmd();
            $dropDatabaseCmd   = $dbConnectionCmd . ' -e"DROP DATABASE ' . $dbParams['dbname'] . ';"';
            $createDatabaseCmd = $dbConnectionCmd . ' -e"CREATE DATABASE ' . $dbParams['dbname'] . ';"';
            $createSchemaCmd   = 'php bin/doctrine.php orm:schema-tool:create';
            
            $this->consoleWriteWithIndent('Dropping database... ');
            $output = shell_exec($dropDatabaseCmd);
            $this->consoleWriteLine('done!', Color::GREEN);
            
            $this->consoleWriteWithIndent('Creating database... ');
            $output = shell_exec($createDatabaseCmd);
            $this->consoleWriteLine('done!', Color::GREEN);
            
            $this->consoleWriteWithIndent('Creating tables... ');
            $output = shell_exec($createSchemaCmd);
            $this->consoleWriteLine('done!', Color::GREEN);
        } else {
            $this->consoleWriteLineWithIndent('Nothing to do. For database generating please use --force|-f option.', Color::YELLOW);
        }
    }
157721
public function prepareFileSystem()
    {

        // load the directories
        $directories = $this->getDirectories();

        // load user and group from system configuration
        $user = $this->getSystemConfiguration()->getUser();
        $group = $this->getSystemConfiguration()->getGroup();

        // check if the necessary directories already exists, if not, create them
        foreach (DirectoryKeys::getServerDirectoryKeysToBeCreated() as $directoryKey) {
            // prepare the path to the directory to be created
            $toBeCreated = $this->realpath($directories[$directoryKey]);

            // prepare the directory name and check if the directory already exists
            if (is_dir($toBeCreated) === false) {
                // if not, try to create it
                if (mkdir($toBeCreated, 0755, true) === false) {
                    throw new \Exception(
                        sprintf('Can\'t create necessary directory %s while starting application server', $toBeCreated)
                    );
                }

                // set user/group specified from the system configuration
                if ($this->setUserRights(new \SplFileInfo($toBeCreated), $user, $group) === false) {
                    throw new \Exception(
                        sprintf('Can\'t switch user/group to %s/% for directory %s while starting application server', $user, $group, $toBeCreated)
                    );
                }
            }
        }

        // create the container specific directories
        /** @var \AppserverIo\Psr\ApplicationServer\Configuration\ContainerConfigurationInterface $containerNode */
        foreach ($this->getSystemConfiguration()->getContainers() as $containerNode) {
            // iterate over the container host's directories
            foreach ($containerNode->getHost()->getDirectories() as $directory) {
                // prepare the path to the directory to be created
                $toBeCreated = $this->realpath($directory);

                // prepare the directory name and check if the directory already exists
                if (is_dir($toBeCreated) === false) {
                    // if not, try to create it
                    if (mkdir($toBeCreated, 0755, true) === false) {
                        throw new \Exception(
                            sprintf('Can\'t create necessary directory %s while starting application server', $toBeCreated)
                        );
                    }

                    // set user/group specified from the system configuration
                    if ($this->setUserRights(new \SplFileInfo($toBeCreated), $user, $group) === false) {
                        throw new \Exception(
                            sprintf('Can\'t switch user/group to %s/% for directory %s while starting application server', $user, $group, $toBeCreated)
                        );
                    }
                }
            }
        }

        // check if specific directories has to be cleaned up on startup
        foreach (DirectoryKeys::getServerDirectoryKeysToBeCleanedUp() as $directoryKey) {
            // prepare the path to the directory to be cleaned up
            $toBeCleanedUp = $this->realpath($directories[$directoryKey]);

            // if the directory exists, clean it up
            if (is_dir($toBeCleanedUp)) {
                $this->cleanUpDir(new \SplFileInfo($toBeCleanedUp));
            }
        }

        // check if needed files do exist and have the correct user rights
        $files = $this->getFiles();
        foreach (FileKeys::getServerFileKeysToBeCreated() as $fileKeys) {
            // prepare the path to the file to be created
            $toBeCreated = $this->realpath($files[$fileKeys]);

            // touch the file (will lead to its creation if it does not exist by now)
            if (touch($toBeCreated) === false) {
                throw new \Exception(
                    sprintf('Can\'t create necessary file %s while starting application server', $toBeCreated)
                );
            } else {
                chmod($toBeCreated, 0755);
            }

            // set user/group specified from the system configuration
            if ($this->setUserRight(new \SplFileInfo($toBeCreated), $user, $group) === false) {
                throw new \Exception(
                    sprintf('Can\'t switch user/group to %s/% for file %s while starting application server', $user, $group, $toBeCreated)
                );
            }
        }
    }
1252573
public function main()
    {
        // CakeAdmin Migration
        $this->out('Migrating CakeAdmin Tables...');
        $this->migrate('CakeAdmin');
        $this->out('<info>Migrating CakeAdmin Tables completed!</info>');
        $this->hr();

        // Notifier Migration
        $this->out('Migrating Notifier Tables...');
        $this->migrate('Notifier');
        $this->out('<info>Migrating Notifier Tables completed!</info>');
        $this->hr();

        // Settings Migration
        $this->out('Migrating Settings Tables...');
        $this->migrate('Settings');
        $this->out('<info>Migrating Settings Tables completed!</info>');
        $this->hr();

        $createAdmin = $this->in('Do you want to create your first administrator?', ['Y', 'n'], 'Y');

        if ($createAdmin === 'Y') {
            $this->out('Generating a new administrator...');
            $this->dispatchShell('admin');
        }
    }
1000289
protected function prepareProcessBuilder()
    {
        $pb = new ProcessBuilder();
        $pb->inheritEnvironmentVariables();

        if ($this->sudo) {
            $pb->add('sudo');
        }
        $pb->add($this->bin);
        if ($this->config) {
            $pb->add('--config')
                ->add($this->config);
        }

        $pb->add('--rotate');

        return $pb;
    }