Execute the console command.

@param ManagerRegistry $registry
481897
public function handle(ManagerRegistry $registry)
    {
        $names = $this->option('em') ? [$this->option('em')] : $registry->getManagerNames();

        if (!$this->option('sql')) {
            $this->error('ATTENTION: This operation should not be executed in a production environment.');
        }

        foreach ($names as $name) {
            $em   = $registry->getManager($name);
            $tool = new SchemaTool($em);

            $this->message('Creating database schema for <info>' . $name . '</info> entity manager...', 'blue');

            if ($this->option('sql')) {
                $sql = $tool->getCreateSchemaSql($em->getMetadataFactory()->getAllMetadata());
                $this->comment('     ' . implode(';     ' . PHP_EOL, $sql));
            } else {
                $tool->createSchema($em->getMetadataFactory()->getAllMetadata());
            }
        }

        $this->info('Database schema created successfully!');
    }
13688
protected function registerManagerRegistry()
    {
        $this->app->singleton(IlluminateRegistry::class, function ($app) {

            list($managers, $connections) = $this->setUpEntityManagers();

            return new IlluminateRegistry(
                head($managers),
                $connections,
                $managers,
                head($connections),
                head($managers),
                Proxy::class,
                $app
            );
        });

        $this->app->alias(IlluminateRegistry::class, ManagerRegistry::class);
    }
750025
public function fire()
    {
        $this->blockMessage('Welcome!', 'Starting the installation process...', 'comment');

        $success = $this->installer->stack([
            \Modules\Core\Console\Installers\Scripts\ProtectInstaller::class,
            \Modules\Core\Console\Installers\Scripts\RequirementsCheck::class,
            \Modules\Core\Console\Installers\Scripts\ResetEnvironment::class,
            \Modules\Core\Console\Installers\Scripts\ConfigureDatabase::class,
            \Modules\Core\Console\Installers\Scripts\SetAppKey::class,
            \Modules\Core\Console\Installers\Scripts\ModuleMigrator::class,
            \Modules\Core\Console\Installers\Scripts\ModuleSeeders::class,
            \Modules\Core\Console\Installers\Scripts\ModuleAssets::class,
            \Modules\Core\Console\Installers\Scripts\ThemeAssets::class,
            \Modules\Core\Console\Installers\Scripts\AdminUserInstaller::class,
            \Modules\Core\Console\Installers\Scripts\UnignoreComposerLock::class,
            \Modules\Core\Console\Installers\Scripts\SocietyIsInstalled::class,
        ])->install($this);

        if ($success) {
            $this->blockMessage(
                'SocietyCMS is ready',
                'You can now login with your username and password at /backend',
                'fg=black;bg=green;options=bold'
            );
        }
    }
812065
public function register(array $registry)
	{
		foreach($registry as $key => $reg)
			$this->data[$key] = $reg;
	}
213437
public function handle()
    {
        $this->call('key:generate');
        $this->call('storage:link');

        $this->call('vendor:publish', [
            '--provider' => BlogServiceProvider::class
        ]);
        /*$this->call('vendor:publish', [
            '--provider' => PermissionServiceProvider::class,
            '--tag' => 'migrations'
        ]);*/
        $this->call('migrate');

        $this->info('Attempting to set User model as parent to App\User');
        if (file_exists(app_path('User.php'))) {
            $str = file_get_contents(app_path('User.php'));

            if ($str !== false) {
                $str = str_replace('extends Authenticatable', "extends \Tanwencn\Blog\Database\Eloquent\User", $str);

                file_put_contents(app_path('User.php'), $str);
            }
        } else {
            $this->warn('Unable to locate "app/User.php".  Did you move this file?');
            $this->warn('You will need to update this manually.  Change "extends Authenticatable" to "extends \Tanwencn\Blog\Database\Eloquent\User" in your User model');
        }

        $this->call('blog:registerPermissions');
    }
808946
public function handle()
    {
        $this->hasOrCreateDirectory('App');
        $this->recursive_copy($this->from_directory , $this->to_directory);
        $this->info('ADR architecture has been set');

    }
815879
public static function run(I_Registry $registry, Manager $evtManager)
    {
        $instances = [];
        $methods = array_keys($registry->get('core/log', []));
        foreach ($methods as $method) {
            $levels = $registry->get(
                sprintf('core/log/%s', $method),
                []
            );
            foreach (array_keys($levels) as $level) {
                $methodRegistry = $registry->newFromKey(
                    sprintf('core/log/%s/%s', $method, $level)
                );
                $methodRegistry->set('name',  $method);
                $methodRegistry->set('level', $level);
                $methodRegistry->set('env',   $registry->get('core/env'));
                $class = $methodRegistry->get('class', null, false);
                if (is_null($class)) {
                    $class = sprintf(
                        "\\donbidon\\Core\\Log\\Method\\%s",
                        $method
                    );
                }
                $instance = new $class($methodRegistry, $evtManager);
                if (!($instance instanceof Method\A_Method)) {
                    throw new \RuntimeException(sprintf(
                        "Class '%s' has to be instance of %s",
                        $class,Method\A_Method::class
                    ));
                }
                $instances[] = $instance;
            }
        }

        return $instances;
    }
563054
public function handle()
    {
        // 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->deployer->run($this->getDeployPaths(), []);

        // 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->deployer->getNotes() as $note) {
            $this->output->writeln($note);
        }
    }
621901
protected function processRegistry($action, Registry $registry, $id, array $output, array $args = array())
    {
        try {

            $output[$id] = call_user_func_array(array($registry, $action), $args);

        } catch (RegistryException $e) {

            $this->errors[$id] = $e;
        }

        return $output;
    }
725175
public function handle(Manager $manager)
    {

        $extensionName = $this->argument('extension');
        if ($extensionName) {
            $extension = $manager->getAvailableExtensions()->findByName($extensionName);

            if ($extension instanceof ExtensionContract) {
                $this->acl->import($this, $extension, true);
            }
        } else {
            $extensions = $manager->getAvailableExtensions()->filterByActivated();

            foreach ($extensions as $extension) {
                $this->acl->import($this, $extension, true);
            }
        }
    }
343933
public function execute() {
		$this->out(__d('cake_notify', 'Clear notifications in progress...'), 1, Shell::NORMAL);
		if ($this->Notification->clearNotifications()) {
			$this->out('<success>' . __d('cake_notify', 'Notifications clear successfully.') . '</success>', 1, Shell::NORMAL);
		} else {
			$this->out('<error>' . __d('cake_notify', 'Notifications clear unsuccessfully.') . '</error>');
		}
	}
85862
public function execute() {
        global $CFG, $DB;

        $timenow = time();

        // Cleanup read and unread notifications.
        if (!empty($CFG->messagingdeleteallnotificationsdelay)) {
            $notificationdeletetime = $timenow - $CFG->messagingdeleteallnotificationsdelay;
            $params = array('notificationdeletetime' => $notificationdeletetime);
            $DB->delete_records_select('notifications', 'timecreated < :notificationdeletetime', $params);
        }

        // Cleanup read notifications.
        if (!empty($CFG->messagingdeletereadnotificationsdelay)) {
            $notificationdeletetime = $timenow - $CFG->messagingdeletereadnotificationsdelay;
            $params = array('notificationdeletetime' => $notificationdeletetime);
            $DB->delete_records_select('notifications', 'timeread < :notificationdeletetime', $params);
        }
    }
1001454
public function handle(AppVersionManagerContract $manager)
    {
        if ($this->option('refresh')) {
            $manager->refresh();

            $this->info('Stored in files values updated, files recreated');
        } elseif ($build = $this->option('set-build')) {
            $manager->setBuild($build);

            $this->info(sprintf('Application build version changed to "%s"', $build));
        } else {
            $this->output->writeln(
                $this->option('build')
                    ? $manager->build()
                    : $manager->formatted()
            );
        }
    }
464851
public function handle()
    {
        if ($location = $this->option('location')) {
            $repository = modules($location);

            if ($repository->count() == 0) {
                $this->error("Your application doesn't have any modules.");
            }

            $this->displayModules($this->getModules($repository));
        } else {
            foreach (modules()->repositories() as $repository) {
                $modules = $repository->all();

                if (count($modules) == 0) {
                    $this->error("Your application doesn't have any modules.");
                }

                $this->displayModules($this->getModules($repository));
            }
        }
    }
229991
public function fire(ManagerRegistry $registry)
    {
        if (!$this->option('sql') && (!$this->laravel->environment('local') && !$this->option('force'))) {
            $this->error('ATTENTION: This operation should not be executed in a production environment.');
            $this->error('Use the incremental update to detect changes during development and use');
            $this->error('the SQL DDL provided to manually update your database in production.');
        }

        $names = $this->option('em') ? [$this->option('em')] : $registry->getManagerNames();

        foreach ($names as $name) {
            $em   = $registry->getManager($name);
            $tool = new SchemaTool($em);

            $this->comment('');
            $this->message('Checking if database connected to <info>' . $name . '</info> entity manager needs updating...',
                'blue');

            // Check if there are updates available
            $sql = $tool->getUpdateSchemaSql(
                $em->getMetadataFactory()->getAllMetadata(),
                $this->option('clean')
            );

            if (0 === count($sql)) {
                return $this->error('Nothing to update - your database is already in sync with the current entity metadata.');
            }

            if ($this->option('sql')) {
                $this->comment('     ' . implode(';     ' . PHP_EOL, $sql));
            } else {
                if ($this->laravel->environment('local') || $this->option('force')) {
                    $this->message('Updating database schema...', 'blue');
                    $tool->updateSchema(
                        $em->getMetadataFactory()->getAllMetadata(),
                        $this->option('clean')
                    );

                    $pluralization = (1 === count($sql)) ? 'query was' : 'queries were';
                    $this->info(sprintf('Database schema updated successfully! "<info>%s</info>" %s executed',
                        count($sql),
                        $pluralization));
                } else {
                    $this->message(sprintf('The Schema-Tool would execute <info>"%s"</info> queries to update the database.',
                        count($sql)));
                }
            }
        }

        if (!$this->option('sql') && (!$this->laravel->environment('local') && !$this->option('force'))) {
            $this->info('');
            $this->message('Please run the operation by passing one - or both - of the following options:');
            $this->comment(sprintf('    <info>php artisan %s --force</info> to execute the command',
                $this->getName()));
            $this->comment(sprintf('    <info>php artisan %s --sql</info> to dump the SQL statements to the screen',
                $this->getName()));
        }
    }
407121
public function handle()
    {
        $translationFiles = $this->manager->files();

        $this->syncKeysFromFiles($translationFiles);

        $this->syncKeysBetweenLanguages($translationFiles);

        $this->info('Done!');
    }
1157125
public function handle(Migrator $migrator)
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        $migrator->makeLogTable();

        $installed_migrations = $migrator->installedMigrationsByDesc();

        foreach ($installed_migrations as $group => $migrations) {
            foreach ($migrations as $data) {
                $this->infoDowngrade($group, $data->version, $data->class);

                $migrator->doDowngrade($group, $data->version);
            }
        }
    }