Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pimcore Bot
committed
May 15, 2019
1 parent
1afa5e7
commit e2515cd
Showing
7 changed files
with
355 additions
and
361 deletions.
There are no files selected for viewing
99 changes: 49 additions & 50 deletions
99
bundles/CoreBundle/DependencyInjection/Compiler/LegacyTemplatePass.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 |
---|---|---|
@@ -1,50 +1,49 @@ | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler; | ||
|
||
use Pimcore\Bundle\CoreBundle\EventListener\LegacyTemplateListener; | ||
use Pimcore\Bundle\CoreBundle\Templating\LegacyTemplateGuesser; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
class LegacyTemplatePass implements CompilerPassInterface | ||
{ | ||
/** | ||
* Replace SensioFrameworkExtraBundle template guesser & view listener with our implementation to support PHP templates | ||
* | ||
* @inheritDoc | ||
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if ($container->hasDefinition('sensio_framework_extra.view.guesser')) { | ||
$definition = $container->getDefinition('sensio_framework_extra.view.guesser'); | ||
$definition | ||
->setPublic(true) | ||
->setClass(LegacyTemplateGuesser::class) | ||
->addArgument(new Reference('templating')); | ||
} | ||
|
||
|
||
if ($container->hasDefinition('sensio_framework_extra.view.listener')) { | ||
$definition = $container->getDefinition('sensio_framework_extra.view.listener'); | ||
$definition | ||
->setClass(LegacyTemplateListener::class) | ||
->addMethodCall('setTemplateEngine', [ | ||
new Reference('templating') | ||
]); | ||
} | ||
} | ||
} | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler; | ||
|
||
use Pimcore\Bundle\CoreBundle\EventListener\LegacyTemplateListener; | ||
use Pimcore\Bundle\CoreBundle\Templating\LegacyTemplateGuesser; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
class LegacyTemplatePass implements CompilerPassInterface | ||
{ | ||
/** | ||
* Replace SensioFrameworkExtraBundle template guesser & view listener with our implementation to support PHP templates | ||
* | ||
* @inheritDoc | ||
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if ($container->hasDefinition('sensio_framework_extra.view.guesser')) { | ||
$definition = $container->getDefinition('sensio_framework_extra.view.guesser'); | ||
$definition | ||
->setPublic(true) | ||
->setClass(LegacyTemplateGuesser::class) | ||
->addArgument(new Reference('templating')); | ||
} | ||
|
||
if ($container->hasDefinition('sensio_framework_extra.view.listener')) { | ||
$definition = $container->getDefinition('sensio_framework_extra.view.listener'); | ||
$definition | ||
->setClass(LegacyTemplateListener::class) | ||
->addMethodCall('setTemplateEngine', [ | ||
new Reference('templating') | ||
]); | ||
} | ||
} | ||
} |
83 changes: 42 additions & 41 deletions
83
bundles/CoreBundle/DependencyInjection/Compiler/RoutingLoaderPass.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 |
---|---|---|
@@ -1,41 +1,42 @@ | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler; | ||
|
||
use Pimcore\Routing\Loader\AnnotatedRouteControllerLoader; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
/** | ||
* Set annotation loader to our own implementation normalizing admin routes: converts the prefix | ||
* pimcore_pimcoreadmin_ to just pimcore_admin_ | ||
* | ||
*/ | ||
class RoutingLoaderPass implements CompilerPassInterface | ||
{ | ||
/** | ||
* Replace Annotated Routing loader with your implementation to normalizes autogenerated admin routes | ||
* @inheritDoc | ||
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->hasDefinition('routing.loader.annotation')) { | ||
return; | ||
} | ||
|
||
$definition = $container->getDefinition('routing.loader.annotation'); | ||
$definition->setClass(AnnotatedRouteControllerLoader::class); | ||
} | ||
} | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler; | ||
|
||
use Pimcore\Routing\Loader\AnnotatedRouteControllerLoader; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
/** | ||
* Set annotation loader to our own implementation normalizing admin routes: converts the prefix | ||
* pimcore_pimcoreadmin_ to just pimcore_admin_ | ||
* | ||
*/ | ||
class RoutingLoaderPass implements CompilerPassInterface | ||
{ | ||
/** | ||
* Replace Annotated Routing loader with your implementation to normalizes autogenerated admin routes | ||
* | ||
* @inheritDoc | ||
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->hasDefinition('routing.loader.annotation')) { | ||
return; | ||
} | ||
|
||
$definition = $container->getDefinition('routing.loader.annotation'); | ||
$definition->setClass(AnnotatedRouteControllerLoader::class); | ||
} | ||
} |
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
Oops, something went wrong.