-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #965 from dpfaffenbauer/standalone-index-bundle
[IndexBundle] improve standalone usage
- Loading branch information
Showing
6 changed files
with
164 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* CoreShop. | ||
* | ||
* This source file is subject to the GNU General Public License version 3 (GPLv3) | ||
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt | ||
* files that are distributed with this source code. | ||
* | ||
* @copyright Copyright (c) 2015-2019 Dominik Pfaffenbauer (https://www.pfaffenbauer.at) | ||
* @license https://www.coreshop.org/license GNU General Public License version 3 (GPLv3) | ||
*/ | ||
|
||
namespace CoreShop\Bundle\IndexBundle; | ||
|
||
use Doctrine\DBAL\Migrations\Version; | ||
use Doctrine\DBAL\Schema\Schema; | ||
use Pimcore\Extension\Bundle\Installer\MigrationInstaller; | ||
use Pimcore\Console\Application; | ||
use Symfony\Component\Console\Input\ArrayInput; | ||
|
||
class Installer extends MigrationInstaller | ||
{ | ||
/** | ||
* | ||
*/ | ||
protected function beforeInstallMigration() | ||
{ | ||
$kernel = \Pimcore::getKernel(); | ||
$application = new Application($kernel); | ||
$application->setAutoExit(false); | ||
$options = ['command' => 'coreshop:resources:install']; | ||
$options = array_merge($options, ['--no-interaction' => true, '--application-name object_index']); | ||
$application->run(new ArrayInput($options)); | ||
|
||
$options = ['command' => 'coreshop:resources:create-tables']; | ||
$options = array_merge($options, ['application-name' => 'coreshop', '--no-interaction' => true, '--force' => true]); | ||
$application->run(new ArrayInput($options)); | ||
} | ||
|
||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function migrateInstall(Schema $schema, Version $version) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function migrateUninstall(Schema $schema, Version $version) | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/CoreShop/Bundle/IndexBundle/Resources/config/services/installer.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
services: | ||
_defaults: | ||
autowire: true | ||
autoconfigure: true | ||
public: false | ||
|
||
CoreShop\Bundle\IndexBundle\Installer: | ||
public: true | ||
arguments: | ||
$bundle: "@=service('kernel').getBundle('CoreShopIndexBundle')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters