Initial commit: CloudOps infrastructure platform

This commit is contained in:
root
2026-04-09 19:58:57 +02:00
commit 1166a52f26
7762 changed files with 839452 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Mautic\DashboardBundle\Factory;
use Mautic\CacheBundle\Cache\CacheProviderTagAwareInterface;
use Mautic\CoreBundle\Helper\CoreParametersHelper;
use Mautic\CoreBundle\Helper\PathsHelper;
use Mautic\CoreBundle\Helper\UserHelper;
use Mautic\CoreBundle\Security\Permissions\CorePermissions;
use Mautic\DashboardBundle\Entity\Widget;
use Mautic\DashboardBundle\Event\WidgetDetailEvent;
use Symfony\Contracts\Translation\TranslatorInterface;
class WidgetDetailEventFactory
{
public function __construct(
private TranslatorInterface $translator,
private CacheProviderTagAwareInterface $cacheProvider,
private CorePermissions $corePermissions,
private UserHelper $userHelper,
private CoreParametersHelper $coreParametersHelper,
private PathsHelper $pathsHelper,
) {
}
public function create(Widget $widget): WidgetDetailEvent
{
$cacheDir = $this->coreParametersHelper->get('cached_data_dir', $this->pathsHelper->getSystemPath('cache', true));
$event = new WidgetDetailEvent($this->translator, $this->corePermissions, $widget, $this->cacheProvider);
$event->setCacheDir($cacheDir, $this->userHelper->getUser()->getId());
return $event;
}
}