backports murph-skeleton
This commit is contained in:
parent
0a924b2551
commit
3c1636d517
|
@ -439,3 +439,7 @@ table.table-fixed, .table-fixed > table {
|
|||
fieldset.form-group {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-fullscreen, .editor-toolbar.fullscreen {
|
||||
z-index: 2000;
|
||||
}
|
||||
|
|
|
@ -40,12 +40,21 @@ class SymfonyCacheManager
|
|||
{
|
||||
$application = new Application($this->kernel);
|
||||
$application->setAutoExit(false);
|
||||
$output = new BufferedOutput();
|
||||
|
||||
$input = new ArrayInput([
|
||||
'command' => 'cache:clear',
|
||||
'-e' => $this->kernel->getEnvironment(),
|
||||
'--no-warmup' => null,
|
||||
]);
|
||||
|
||||
$application->run($input, $output);
|
||||
|
||||
$input = new ArrayInput([
|
||||
'command' => 'cache:warmup',
|
||||
'-e' => $this->kernel->getEnvironment(),
|
||||
]);
|
||||
|
||||
$output = new BufferedOutput();
|
||||
$application->run($input, $output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,15 +12,17 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|||
*/
|
||||
abstract class EntityManagerEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
static protected int $priority = 0;
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [
|
||||
EntityManagerEvent::CREATE_EVENT => 'onCreate',
|
||||
EntityManagerEvent::UPDATE_EVENT => 'onUpdate',
|
||||
EntityManagerEvent::DELETE_EVENT => 'onDelete',
|
||||
EntityManagerEvent::PRE_CREATE_EVENT => 'onPreCreate',
|
||||
EntityManagerEvent::PRE_UPDATE_EVENT => 'onPreUpdate',
|
||||
EntityManagerEvent::PRE_DELETE_EVENT => 'onPreDelete',
|
||||
EntityManagerEvent::CREATE_EVENT => ['onCreate', self::$priority],
|
||||
EntityManagerEvent::UPDATE_EVENT => ['onUpdate', self::$priority],
|
||||
EntityManagerEvent::DELETE_EVENT => ['onDelete', self::$priority],
|
||||
EntityManagerEvent::PRE_CREATE_EVENT => ['onPreCreate', self::$priority],
|
||||
EntityManagerEvent::PRE_UPDATE_EVENT => ['onPreUpdate', self::$priority],
|
||||
EntityManagerEvent::PRE_DELETE_EVENT => ['onPreDelete', self::$priority],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class MenuEventSubscriber extends EntityManagerEventSubscriber
|
|||
|
||||
$this->nodeRepository->persistAsFirstChild($childNode, $rootNode);
|
||||
|
||||
$this->cacheManager->cleanAll();
|
||||
$this->cacheManager->cleanRouting();
|
||||
}
|
||||
|
||||
public function onUpdate(EntityManagerEvent $event)
|
||||
|
|
|
@ -21,6 +21,7 @@ class SiteEventSubscriber extends EntityManagerEventSubscriber
|
|||
{
|
||||
protected KernelInterface $kernel;
|
||||
protected SymfonyCacheManager $cacheManager;
|
||||
static protected int $priority = -1;
|
||||
|
||||
public function __construct(KernelInterface $kernel, SymfonyCacheManager $cacheManager)
|
||||
{
|
||||
|
@ -39,11 +40,7 @@ class SiteEventSubscriber extends EntityManagerEventSubscriber
|
|||
return;
|
||||
}
|
||||
|
||||
if ($event->getEntity() instanceof Node) {
|
||||
$this->cacheManager->cleanRouting();
|
||||
} else {
|
||||
$this->cacheManager->cleanAll();
|
||||
}
|
||||
}
|
||||
|
||||
public function onCreate(EntityManagerEvent $event)
|
||||
|
|
Loading…
Reference in a new issue