protected function reconcileRootUser(OutputInterface $output)
    {
        if ($this->isDbSetup === false) {
            return true;
        }
        /** @var UsersRepository $repo */
        $repo = $this->app['storage']->getRepository(Entity\Users::class);
        if ($repo->count() > 0) {
            return true;
        }

        $this->step(++$this->step, 'Creating First User');
        if (!$this->io->confirm('Would you like to create the first user now?', false)) {
            return true;
        }

        $command = $this->getApplication()->find('user:add');
        $input = new ArrayInput([
            'role'     => ['root'],
            '--enable' => true,
        ]);
        $result = $command->run($input, $output);
        if ($result === 0) {
            $this->firstUser = $input->getArguments();
        }

        return $result === 0;
    }
protected function reconcileRootUser(OutputInterface $output)
    {
        if ($this->isDbSetup === false) {
            return true;
        }
        /** @var UsersRepository $repo */
        $repo = $this->app['storage']->getRepository(Entity\Users::class);
        if ($repo->count() > 0) {
            return true;
        }

        $this->step(++$this->step, 'Creating First User');
        if (!$this->io->confirm('Would you like to create the first user now?', false)) {
            return true;
        }

        $command = $this->getApplication()->find('user:add');
        $input = new ArrayInput([
            'role'     => ['root'],
            '--enable' => true,
        ]);
        $result = $command->run($input, $output);
        if ($result === 0) {
            $this->firstUser = $input->getArguments();
        }

        return $result === 0;
    }
protected function reconcileRootUser ( OutputInterface $ output ) { if ( $ this -> isDbSetup === false ) { return true ; } /** @var UsersRepository $repo */ $ repo = $ this -> app [ 'storage' ] -> getRepository ( Entity \ Users :: class ) ; if ( $ repo -> count ( ) > 0 ) { return true ; } $ this -> step ( ++ $ this -> step , 'Creating First User' ) ; if ( ! $ this -> io -> confirm ( 'Would you like to create the first user now?' , false ) ) { return true ; } $ command = $ this -> getApplication ( ) -> find ( 'user:add' ) ; $ input = new ArrayInput ( [ 'role' => [ 'root' ] , '--enable' => true , ] ) ; $ result = $ command -> run ( $ input , $ output ) ; if ( $ result === 0 ) { $ this -> firstUser = $ input -> getArguments ( ) ; } return $ result === 0 ; }
Create first user, with the "root" role.

Only executes when no users are present in the database, and must be run
after the database check/update.

@param OutputInterface $output

@return bool
Create first user with the root role .