Manager example

break;

                case 'clear':
                    $io->comment('Clear database');
                    $database->emptyDatabase($dbConfig['dbname']);
                    break;

                case 'import':
                    $io->comment('Import database');
                    $database->importFile($dbConfig['dbname']$rootDir . '/_sql/install/latest.sql');

                    $migrationManger = new Manager($connection$rootDir . '/_sql/migrations');
                    $migrationManger->run();
                    break;

                case 'importDemodata':
                    $io->comment('Import demodata');
                    $database->importFile($dbConfig['dbname']$rootDir . '/_sql/demo/latest.sql');
                    break;

                case 'setupShop':
                    $io->comment('Setup shop');
                    $url = $this->parseUrl($input);
                    

    public function onInitResourcePasswordEncoder(Enlight_Event_EventArgs $args): Manager
    {
        // Get a list of all available hashes         /** @var array<PasswordEncoderInterface> $availableHasher */
        $availableHasher = Shopware()->Events()->filter(
            'Shopware_Components_Password_Manager_AddEncoder',
            [],
            ['subject' => $this]
        );

        $passwordManager = new Manager(
            $this->Application()->Config()
        );

        foreach ($availableHasher as $encoder) {
            $passwordManager->addEncoder($encoder);
        }

        return $passwordManager;
    }

    /** * This method registers shopware's default hash algorithm * * @return PasswordEncoderInterface[] */

        $connection = $this->getContainer()->get(PDO::class);

        $rootDir = $this->container->getParameter('kernel.root_dir');

        if (!\is_string($rootDir)) {
            throw new RuntimeException('Parameter kernel.root_dir has to be an string');
        }

        $mode = $input->getOption('mode');

        $migrationManger = new Manager($connection$rootDir . '/_sql/migrations');
        $migrationManger->run($mode);

        return 0;
    }
}
Home | Imprint | This part of the site doesn't use cookies.