Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZP-23949: Refactored installers out of kernel
Added service tag ezplatform.installer, with 'type' key. PlatformInstallerBundle contains 'clean' install by default. 'demo' and 'demo-clean' installers are in the demobundle itself.
- Loading branch information
Bertrand Dunogier
committed
Feb 13, 2015
1 parent
c4342b4
commit d2ca6e0
Showing
9 changed files
with
81 additions
and
1,851 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
42 changes: 42 additions & 0 deletions
42
eZ/Bundle/PlatformInstallerBundle/src/DependencyInjection/Compiler/InstallerTagPass.php
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,42 @@ | ||
<?php | ||
/** | ||
* This file is part of the ezpublish-kernel package. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
|
||
namespace EzSystems\PlatformInstallerBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
/** | ||
* Compiles services tagged as ezplatform.installer to %ezplatform.installers% | ||
*/ | ||
class InstallerTagPass implements CompilerPassInterface | ||
{ | ||
public function process( ContainerBuilder $container ) | ||
{ | ||
$installers = []; | ||
|
||
foreach ( $container->findTaggedServiceIds( 'ezplatform.installer' ) as $id => $tags ) | ||
{ | ||
foreach ( $tags as $tag ) | ||
{ | ||
if ( !isset( $tag['type'] ) ) | ||
throw new \LogicException( "ezplatform.installer service tag needs a 'type' attribute to identify the installer. None given for $id." ); | ||
|
||
$installers[$tag['type']] = $id; | ||
} | ||
} | ||
|
||
if ( count( $installers ) == 0 ) | ||
{ | ||
return; | ||
} | ||
|
||
$container->setParameter( 'ezplatform.installers', $installers ); | ||
} | ||
} |
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
47 changes: 0 additions & 47 deletions
47
eZ/Bundle/PlatformInstallerBundle/src/Installer/DemoCleanInstaller.php
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
eZ/Bundle/PlatformInstallerBundle/src/Installer/DemoInstaller.php
This file was deleted.
Oops, something went wrong.
12 changes: 2 additions & 10 deletions
12
eZ/Bundle/PlatformInstallerBundle/src/Resources/config/services.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 |
---|---|---|
@@ -1,23 +1,15 @@ | ||
parameters: | ||
ezplatform.installer.db_based_installer.class: EzSystems\PlatformInstallerBundle\Installer\DbBasedInstaller | ||
ezplatform.installer.clean_installer.class: EzSystems\PlatformInstallerBundle\Installer\CleanInstaller | ||
ezplatform.installer.democlean_installer.class: EzSystems\PlatformInstallerBundle\Installer\DemoCleanInstaller | ||
ezplatform.installer.demo_installer.class: EzSystems\PlatformInstallerBundle\Installer\DemoInstaller | ||
|
||
services: | ||
ezplatform.installer.db_based_installer: | ||
abstract: true | ||
class: %ezplatform.installer.db_based_installer.class% | ||
arguments: [@database_connection] | ||
|
||
ezplatform.installer.democlean_installer: | ||
class: %ezplatform.installer.democlean_installer.class% | ||
parent: ezplatform.installer.db_based_installer | ||
|
||
ezplatform.installer.clean_installer: | ||
class: %ezplatform.installer.clean_installer.class% | ||
parent: ezplatform.installer.db_based_installer | ||
|
||
ezplatform.installer.demo_installer: | ||
class: %ezplatform.installer.demo_installer.class% | ||
parent: ezplatform.installer.db_based_installer | ||
tags: | ||
- {name: ezplatform.installer, type: clean} |
51 changes: 0 additions & 51 deletions
51
eZ/Bundle/PlatformInstallerBundle/src/Resources/config_templates/demo/ezpublish.yml
This file was deleted.
Oops, something went wrong.