Initial Drupal 11 with DDEV setup

This commit is contained in:
gluebox
2025-10-08 11:39:17 -04:00
commit 89ef74b305
25344 changed files with 2599172 additions and 0 deletions

View File

@ -0,0 +1,44 @@
{% import '@lib/di.twig' as di %}
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }};
{% apply sort_namespaces %}
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
{% if services %}
{{ di.use(services) }}
{% endif %}
{% endapply %}
/**
* @todo Add a description for the middleware.
*/
final class {{ class }} implements HttpKernelInterface {
{% if services %}
/**
* Constructs {{ class|article }} object.
*/
public function __construct(
{{ di.signature(services) }}
) {}
{% endif %}
/**
* {@inheritdoc}
*/
public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE): Response {
// @todo Modify the request here.
$response = $this->httpKernel->handle($request, $type, $catch);
// @todo Modify the response here.
{% if SUT_TEST %}
$response->headers->set('x-middleware-handle-test', NULL);
{% endif %}
return $response;
}
}

View File

@ -0,0 +1,9 @@
{% import '@lib/di.twig' as di %}
services:
{{ machine_name }}.middleware:
class: Drupal\{{ machine_name }}\{{ class }}
{% if service_arguments %}
arguments: [{{ di.arguments(service_arguments) }}]
{% endif %}
tags:
- { name: http_middleware, priority: 10 }