loadToDatabase example


    private function synchronizeSnippets(Template $template)
    {
        $directory = $this->pathResolver->getSnippetDirectory($template);

        if (!file_exists($directory) || !$this->snippetConfig['writeToDb']) {
            return;
        }

        $namespace = $this->util->getSnippetNamespace($template);

        $this->snippetWriter->loadToDatabase(
            $directory,
            false,
            $namespace
        );
    }

    /** * Helper function which returns the theme information of the * passed theme. * Used to update the Shopware\Models\Shop\Template entity with * the theme data. * * @return array */
'plugin' => $bootstrap,
                ]
            );

            $plugin->setInstalled(new DateTime());
            $plugin->setUpdated(new DateTime());
            $em->flush($plugin);
            $this->write();

            $em->flush();

            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'Snippets/');
            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'snippets/');
            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'Resources/snippet/');

            // Clear proxy cache             $this->Application()->Hooks()->getProxyFactory()->clearCache();
        }

        $db = $this->Application()->Container()->get('db');

        $resourceId = $db->fetchOne(
            "SELECT id FROM s_core_acl_resources WHERE name = 'widgets'"
        );
if (is_file($bootstrap->getPath() . '/Resources/cronjob.xml')) {
            $this->installCronjob($plugin$bootstrap->getPath() . '/Resources/cronjob.xml');
        }

        if (file_exists($bootstrap->getPath() . '/Resources/snippets')) {
            $this->installSnippets($bootstrap);
        }
    }

    private function installSnippets(PluginBootstrap $bootstrap)
    {
        $this->snippetHandler->loadToDatabase($bootstrap->getPath() . '/Resources/snippets/');
    }

    /** * @param string $file * * @throws Exception */
    private function installForm(Plugin $plugin$file)
    {
        $xmlConfigReader = new XmlConfigReader();
        $config = $xmlConfigReader->read($file);

        
throw new RuntimeException('Parameter kernel.root_dir has to be an string');
        }

        $source = $input->getOption('source');
        if (!\is_string($source)) {
            throw new RuntimeException('Option "source" needs to be a string');
        }

        $sourceDir = $rootDir . '/' . $source . '/';

        $databaseLoader->setOutput($output);
        $databaseLoader->loadToDatabase($sourceDir$force);

        // Import plugin snippets         if ($input->getOption('include-plugins')) {
            $pluginRepository = $this->container->get('shopware.model_manager')->getRepository(Plugin::class);

            /** @var Plugin[] $plugins */
            $plugins = $pluginRepository->findBy(['active' => true]);

            $pluginDirectories = $this->container->getParameter('shopware.plugin_directories');

            if (!\is_array($pluginDirectories)) {
                
Home | Imprint | This part of the site doesn't use cookies.