diff --git a/README.md b/README.md index 7a57a13..3c1fec4 100644 --- a/README.md +++ b/README.md @@ -10,28 +10,8 @@ ObjectIndex helps you create rich indices and query your Object-Data using re-us ## Getting started * Since Object-Index depends on CoreShops IndexBundle, and the IndexBundle only exists in DEV yet, you need to set your "minimum-stability" to "dev" in your composer.json * Install via composer ```composer require dpfaffenbauer/object-index dev-master``` - * Load needed Bundles: - ```php - addBundles(array( - new \JMS\SerializerBundle\JMSSerializerBundle(), - - new \CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle(), - new \CoreShop\Bundle\IndexBundle\CoreShopIndexBundle(), - - new \FOS\RestBundle\FOSRestBundle(), - new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), - new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), - ), 120); - } - ``` - * Open Extension Manager in Pimcore and enable/install Plugin - * It sometimes happens to me that assets are not getting installed right from pimcore, therefore run ```bin/console assets:install --symlink``` - * Install via Pimcore Extension Manager + * Enable via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:enable ObjectIndexBundle``` + * Install via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:install ObjectIndexBundle``` * After Installation within Pimcore Extension Manager, you have to reload Pimcore * You now have a new Menu Entry for Indexes and Filters diff --git a/src/Installer.php b/src/Installer.php index fbf81e6..a37fe05 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -5,34 +5,35 @@ use Doctrine\DBAL\Migrations\Version; use Doctrine\DBAL\Schema\Schema; use Pimcore\Extension\Bundle\Installer\MigrationInstaller; -use Symfony\Bundle\FrameworkBundle\Console\Application; +use Pimcore\Console\Application; use Symfony\Component\Console\Input\ArrayInput; class Installer extends MigrationInstaller { /** - * {@inheritdoc} + * */ protected function beforeInstallMigration() { $kernel = \Pimcore::getKernel(); $application = new Application($kernel); $application->setAutoExit(false); - $options = ['command' => 'doctrine:schema:update']; - $options = array_merge($options, ['--no-interaction' => true, '--force' => true]); + $options = ['command' => 'coreshop:resources:install']; + $options = array_merge($options, ['--no-interaction' => true, '--application-name object_index']); $application->run(new ArrayInput($options)); - $options = ['command' => 'cache:clear']; - $options = array_merge($options, ['--no-warmup']); + $options = ['command' => 'doctrine:schema:update']; + $options = array_merge($options, ['--no-interaction' => true, '--force' => true]); $application->run(new ArrayInput($options)); } + /** * {@inheritdoc} */ public function migrateInstall(Schema $schema, Version $version) { - //Nothing to do here + } /** @@ -40,6 +41,6 @@ public function migrateInstall(Schema $schema, Version $version) */ public function migrateUninstall(Schema $schema, Version $version) { - //Nothing to do here + } } diff --git a/src/ObjectIndexBundle.php b/src/ObjectIndexBundle.php index 15a5328..1d9d765 100644 --- a/src/ObjectIndexBundle.php +++ b/src/ObjectIndexBundle.php @@ -2,33 +2,57 @@ namespace ObjectIndexBundle; -use ObjectIndexBundle\Installer\PimcoreInstaller; -use Pimcore\Extension\Bundle\AbstractPimcoreBundle; +use CoreShop\Bundle\IndexBundle\CoreShopIndexBundle; +use CoreShop\Bundle\ResourceBundle\AbstractResourceBundle; +use CoreShop\Bundle\ResourceBundle\ComposerPackageBundleInterface; +use CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle; +use Pimcore\Extension\Bundle\PimcoreBundleInterface; +use Pimcore\HttpKernel\BundleCollection\BundleCollection; -class ObjectIndexBundle extends AbstractPimcoreBundle +class ObjectIndexBundle extends AbstractResourceBundle implements PimcoreBundleInterface, ComposerPackageBundleInterface { /** * {@inheritdoc} */ - public function getNiceName() + public static function registerDependentBundles(BundleCollection $collection) { - return 'Object Index'; + parent::registerDependentBundles($collection); + + $collection->addBundle(new CoreShopIndexBundle(), 2400); } /** * {@inheritdoc} */ - public function getDescription() + public function getPackageName() { - return 'ObjectIndex lets you create Indexes and Filters of Objects'; + return 'dpfaffenbauer/pimcore-object-index'; + } + + /** + * {@inheritdoc} + */ + public function getSupportedDrivers() + { + return [ + CoreShopResourceBundle::DRIVER_PIMCORE, + ]; } /** * {@inheritdoc} */ - public function getVersion() + public function getNiceName() { - return '1.0.0'; + return 'Object Index'; + } + + /** + * {@inheritdoc} + */ + public function getDescription() + { + return 'ObjectIndex lets you create Indexes and Filters of Objects'; } /** @@ -52,16 +76,7 @@ public function getAdminIframePath() */ public function getJsPaths() { - $jsFiles = []; - - if ($this->container->hasParameter('coreshop.application.pimcore.admin.js')) { - $jsFiles = array_merge( - $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('coreshop.application.pimcore.admin.js')), - $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('object_index.pimcore.admin.js')) - ); - } - - return $jsFiles; + return []; } /** @@ -69,16 +84,7 @@ public function getJsPaths() */ public function getCssPaths() { - $cssFiles = []; - - if ($this->container->hasParameter('coreshop.application.pimcore.admin.css')) { - $cssFiles = array_merge( - $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('coreshop.application.pimcore.admin.css')), - $this->container->get('coreshop.resource_loader')->loadResources($this->container->getParameter('object_index.pimcore.admin.css')) - ); - } - - return $cssFiles; + return []; } /**