Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\CoreBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
/**
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
class AdapterCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
if (!$container->has('sonata.core.model.adapter.chain')) {
return;
}
$definition = $container->findDefinition('sonata.core.model.adapter.chain');
if ($container->has('doctrine')) {
$definition->addMethodCall('addAdapter', array(new Reference('sonata.core.model.adapter.doctrine_orm')));
} else {
$container->removeDefinition('sonata.core.model.adapter.doctrine_orm');
}
if ($container->has('doctrine_phpcr')) {
$definition->addMethodCall('addAdapter', array(new Reference('sonata.core.model.adapter.doctrine_phpcr')));
} else {
$container->removeDefinition('sonata.core.model.adapter.doctrine_phpcr');
}
}
}

View File

@@ -0,0 +1,56 @@
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\CoreBundle\DependencyInjection\Compiler;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class FormFactoryCompilerPass extends FormPass
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
$typeIdx = array();
foreach ($container->findTaggedServiceIds('form.type') as $id => $tags) {
$typeIdx[] = $id;
}
$typeExtensionIdx = array();
foreach ($container->findTaggedServiceIds('form.type_extension') as $id => $tag) {
$typeExtensionIdx[] = $id;
}
$container->setParameter('sonata.core.form.types', $typeIdx);
$container->setParameter('sonata.core.form.type_extensions', $typeExtensionIdx);
// nothing to do
if (!$container->hasDefinition('sonata.core.form.extension.dependency')) {
return;
}
// get factories
$original = $container->getDefinition('form.extension');
parent::process($container);
$factory = $container->getDefinition('sonata.core.form.extension.dependency');
$factory->replaceArgument(1, $original->getArgument(1));
$factory->replaceArgument(2, $original->getArgument(2));
$factory->replaceArgument(3, $original->getArgument(3));
$container->removeDefinition('form.extension');
$container->removeDefinition('sonata.core.form.extension.dependency');
$container->setDefinition('form.extension', $factory);
}
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\CoreBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
/**
* @author Hugo Briand <briand@ekino.com>
*/
class StatusRendererCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
foreach ($container->findTaggedServiceIds('sonata.status.renderer') as $id => $attributes) {
$container
->getDefinition('sonata.core.twig.status_extension')
->addMethodCall('addStatusService', array(new Reference($id)))
;
}
}
}