Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
85
vendor/league/commonmark/src/Xml/FallbackNodeXmlRenderer.php
vendored
Normal file
85
vendor/league/commonmark/src/Xml/FallbackNodeXmlRenderer.php
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the league/commonmark package.
|
||||
*
|
||||
* (c) Colin O'Dell <colinodell@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace League\CommonMark\Xml;
|
||||
|
||||
use League\CommonMark\Node\Block\AbstractBlock;
|
||||
use League\CommonMark\Node\Inline\AbstractInline;
|
||||
use League\CommonMark\Node\Node;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class FallbackNodeXmlRenderer implements XmlNodeRendererInterface
|
||||
{
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*
|
||||
* @psalm-allow-private-mutation
|
||||
*/
|
||||
private array $classCache = [];
|
||||
|
||||
/**
|
||||
* @psalm-allow-private-mutation
|
||||
*/
|
||||
public function getXmlTagName(Node $node): string
|
||||
{
|
||||
$className = \get_class($node);
|
||||
if (isset($this->classCache[$className])) {
|
||||
return $this->classCache[$className];
|
||||
}
|
||||
|
||||
$type = $node instanceof AbstractBlock ? 'block' : 'inline';
|
||||
$shortName = \strtolower((new \ReflectionClass($node))->getShortName());
|
||||
|
||||
return $this->classCache[$className] = \sprintf('custom_%s_%s', $type, $shortName);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getXmlAttributes(Node $node): array
|
||||
{
|
||||
$attrs = [];
|
||||
foreach ($node->data->export() as $k => $v) {
|
||||
if (self::isValueUsable($v)) {
|
||||
$attrs[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$reflClass = new \ReflectionClass($node);
|
||||
foreach ($reflClass->getProperties() as $property) {
|
||||
if (\in_array($property->getDeclaringClass()->getName(), [Node::class, AbstractBlock::class, AbstractInline::class], true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$property->setAccessible(true);
|
||||
$value = $property->getValue($node);
|
||||
if (self::isValueUsable($value)) {
|
||||
$attrs[$property->getName()] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $attrs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $var
|
||||
*
|
||||
* @psalm-pure
|
||||
*/
|
||||
private static function isValueUsable($var): bool
|
||||
{
|
||||
return \is_string($var) || \is_int($var) || \is_float($var) || \is_bool($var);
|
||||
}
|
||||
}
|
||||
59
vendor/league/commonmark/src/Xml/MarkdownToXmlConverter.php
vendored
Normal file
59
vendor/league/commonmark/src/Xml/MarkdownToXmlConverter.php
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the league/commonmark package.
|
||||
*
|
||||
* (c) Colin O'Dell <colinodell@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace League\CommonMark\Xml;
|
||||
|
||||
use League\CommonMark\ConverterInterface;
|
||||
use League\CommonMark\Environment\EnvironmentInterface;
|
||||
use League\CommonMark\Exception\CommonMarkException;
|
||||
use League\CommonMark\Output\RenderedContentInterface;
|
||||
use League\CommonMark\Parser\MarkdownParser;
|
||||
use League\CommonMark\Parser\MarkdownParserInterface;
|
||||
use League\CommonMark\Renderer\DocumentRendererInterface;
|
||||
|
||||
final class MarkdownToXmlConverter implements ConverterInterface
|
||||
{
|
||||
/** @psalm-readonly */
|
||||
private MarkdownParserInterface $parser;
|
||||
|
||||
/** @psalm-readonly */
|
||||
private DocumentRendererInterface $renderer;
|
||||
|
||||
public function __construct(EnvironmentInterface $environment)
|
||||
{
|
||||
$this->parser = new MarkdownParser($environment);
|
||||
$this->renderer = new XmlRenderer($environment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts Markdown to XML
|
||||
*
|
||||
* @throws CommonMarkException
|
||||
*/
|
||||
public function convert(string $input): RenderedContentInterface
|
||||
{
|
||||
return $this->renderer->renderDocument($this->parser->parse($input));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts CommonMark to HTML.
|
||||
*
|
||||
* @see MarkdownToXmlConverter::convert()
|
||||
*
|
||||
* @throws CommonMarkException
|
||||
*/
|
||||
public function __invoke(string $input): RenderedContentInterface
|
||||
{
|
||||
return $this->convert($input);
|
||||
}
|
||||
}
|
||||
28
vendor/league/commonmark/src/Xml/XmlNodeRendererInterface.php
vendored
Normal file
28
vendor/league/commonmark/src/Xml/XmlNodeRendererInterface.php
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the league/commonmark package.
|
||||
*
|
||||
* (c) Colin O'Dell <colinodell@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace League\CommonMark\Xml;
|
||||
|
||||
use League\CommonMark\Node\Node;
|
||||
|
||||
interface XmlNodeRendererInterface
|
||||
{
|
||||
public function getXmlTagName(Node $node): string;
|
||||
|
||||
/**
|
||||
* @return array<string, string|int|float|bool>
|
||||
*
|
||||
* @psalm-return array<string, scalar>
|
||||
*/
|
||||
public function getXmlAttributes(Node $node): array;
|
||||
}
|
||||
143
vendor/league/commonmark/src/Xml/XmlRenderer.php
vendored
Normal file
143
vendor/league/commonmark/src/Xml/XmlRenderer.php
vendored
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace League\CommonMark\Xml;
|
||||
|
||||
use League\CommonMark\Environment\EnvironmentInterface;
|
||||
use League\CommonMark\Event\DocumentPreRenderEvent;
|
||||
use League\CommonMark\Exception\InvalidArgumentException;
|
||||
use League\CommonMark\Node\Block\Document;
|
||||
use League\CommonMark\Node\Node;
|
||||
use League\CommonMark\Node\StringContainerInterface;
|
||||
use League\CommonMark\Output\RenderedContent;
|
||||
use League\CommonMark\Output\RenderedContentInterface;
|
||||
use League\CommonMark\Renderer\DocumentRendererInterface;
|
||||
use League\CommonMark\Util\Xml;
|
||||
|
||||
final class XmlRenderer implements DocumentRendererInterface
|
||||
{
|
||||
private const INDENTATION = ' ';
|
||||
|
||||
private EnvironmentInterface $environment;
|
||||
|
||||
private XmlNodeRendererInterface $fallbackRenderer;
|
||||
|
||||
/** @var array<class-string, XmlNodeRendererInterface> */
|
||||
private array $rendererCache = [];
|
||||
|
||||
public function __construct(EnvironmentInterface $environment)
|
||||
{
|
||||
$this->environment = $environment;
|
||||
$this->fallbackRenderer = new FallbackNodeXmlRenderer();
|
||||
}
|
||||
|
||||
public function renderDocument(Document $document): RenderedContentInterface
|
||||
{
|
||||
$this->environment->dispatch(new DocumentPreRenderEvent($document, 'xml'));
|
||||
|
||||
// Indentation is purely cosmetic, so it's capped to keep the output size linear
|
||||
// (rather than quadratic) with respect to the depth of the document.
|
||||
$maxIndent = $this->getMaxIndentationLevel();
|
||||
|
||||
$xml = '<?xml version="1.0" encoding="UTF-8"?>';
|
||||
|
||||
$indent = 0;
|
||||
$walker = $document->walker();
|
||||
while ($event = $walker->next()) {
|
||||
$node = $event->getNode();
|
||||
|
||||
$closeImmediately = ! $node->hasChildren();
|
||||
$selfClosing = $closeImmediately && ! $node instanceof StringContainerInterface;
|
||||
|
||||
$renderer = $this->findXmlRenderer($node);
|
||||
$tagName = $renderer->getXmlTagName($node);
|
||||
|
||||
if ($event->isEntering()) {
|
||||
$attrs = $renderer->getXmlAttributes($node);
|
||||
|
||||
$xml .= "\n" . \str_repeat(self::INDENTATION, \min($indent, $maxIndent));
|
||||
$xml .= self::tag($tagName, $attrs, $selfClosing);
|
||||
|
||||
if ($node instanceof StringContainerInterface) {
|
||||
$xml .= Xml::escape($node->getLiteral());
|
||||
}
|
||||
|
||||
if ($closeImmediately && ! $selfClosing) {
|
||||
$xml .= self::tag('/' . $tagName);
|
||||
}
|
||||
|
||||
if (! $closeImmediately) {
|
||||
$indent++;
|
||||
}
|
||||
} elseif (! $closeImmediately) {
|
||||
$indent--;
|
||||
$xml .= "\n" . \str_repeat(self::INDENTATION, \min($indent, $maxIndent));
|
||||
$xml .= self::tag('/' . $tagName);
|
||||
}
|
||||
}
|
||||
|
||||
return new RenderedContent($document, $xml . "\n");
|
||||
}
|
||||
|
||||
private function getMaxIndentationLevel(): int
|
||||
{
|
||||
return $this->environment->getConfiguration()->get('xml/max_indentation_level');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string|int|float|bool> $attrs
|
||||
*/
|
||||
private static function tag(string $name, array $attrs = [], bool $selfClosing = false): string
|
||||
{
|
||||
$result = '<' . $name;
|
||||
foreach ($attrs as $key => $value) {
|
||||
$result .= \sprintf(' %s="%s"', $key, self::convertAndEscape($value));
|
||||
}
|
||||
|
||||
if ($selfClosing) {
|
||||
$result .= ' /';
|
||||
}
|
||||
|
||||
$result .= '>';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|int|float|bool $value
|
||||
*/
|
||||
private static function convertAndEscape($value): string
|
||||
{
|
||||
if (\is_string($value)) {
|
||||
return Xml::escape($value);
|
||||
}
|
||||
|
||||
if (\is_int($value) || \is_float($value)) {
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
if (\is_bool($value)) {
|
||||
return $value ? 'true' : 'false';
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException('$value must be a string, int, float, or bool');
|
||||
}
|
||||
|
||||
private function findXmlRenderer(Node $node): XmlNodeRendererInterface
|
||||
{
|
||||
$class = \get_class($node);
|
||||
|
||||
if (\array_key_exists($class, $this->rendererCache)) {
|
||||
return $this->rendererCache[$class];
|
||||
}
|
||||
|
||||
foreach ($this->environment->getRenderersForClass($class) as $renderer) {
|
||||
if ($renderer instanceof XmlNodeRendererInterface) {
|
||||
return $this->rendererCache[$class] = $renderer;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->rendererCache[$class] = $this->fallbackRenderer;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue