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
145
vendor/league/csv/src/Bom.php
vendored
Normal file
145
vendor/league/csv/src/Bom.php
vendored
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* League.Csv (https://csv.thephpleague.com)
|
||||
*
|
||||
* (c) Ignace Nyamagana Butera <nyamsprod@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace League\Csv;
|
||||
|
||||
use SplFileObject;
|
||||
use Stringable;
|
||||
use Throwable;
|
||||
use ValueError;
|
||||
|
||||
enum Bom: string
|
||||
{
|
||||
case Utf32Le = "\xFF\xFE\x00\x00";
|
||||
case Utf32Be = "\x00\x00\xFE\xFF";
|
||||
case Utf16Be = "\xFE\xFF";
|
||||
case Utf16Le = "\xFF\xFE";
|
||||
case Utf8 = "\xEF\xBB\xBF";
|
||||
|
||||
public static function fromSequence(mixed $sequence): self
|
||||
{
|
||||
return self::tryFromSequence($sequence)
|
||||
?? throw new ValueError('No BOM sequence could be found on the given sequence.');
|
||||
}
|
||||
|
||||
public static function tryFromSequence(mixed $sequence): ?self
|
||||
{
|
||||
$str = match (true) {
|
||||
$sequence instanceof SplFileObject,
|
||||
$sequence instanceof Stream => self::getContents($sequence, 4, 0),
|
||||
is_resource($sequence) => stream_get_contents($sequence, 4, 0),
|
||||
$sequence instanceof AbstractCsv => $sequence->getInputBOM(),
|
||||
$sequence instanceof Stringable,
|
||||
is_string($sequence) => substr((string) $sequence, 0, 4),
|
||||
default => $sequence,
|
||||
};
|
||||
|
||||
if (!is_string($str) || '' === rtrim($str)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (self::cases() as $bom) {
|
||||
if (str_starts_with($str, $bom->value)) {
|
||||
return $bom;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static function getContents(Stream|SplFileObject $sequence, int $length, int $offset): ?string
|
||||
{
|
||||
$position = $sequence->ftell();
|
||||
if (false === $position) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
$sequence->fseek($offset);
|
||||
$str = $sequence->fread($length);
|
||||
$sequence->fseek($position);
|
||||
if (false === $str) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $str;
|
||||
} catch (Throwable) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function fromEncoding(string $name): self
|
||||
{
|
||||
return self::tryFromEncoding($name)
|
||||
?? throw new ValueError('Unknown or unsupported BOM name `'.$name.'`.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://unicode.org/faq/utf_bom.html#gen7
|
||||
*/
|
||||
public static function tryFromEncoding(string $name): ?self
|
||||
{
|
||||
return match (strtoupper(str_replace(['_', '-'], '', $name))) {
|
||||
'UTF8' => self::Utf8,
|
||||
'UTF16',
|
||||
'UTF16BE' => self::Utf16Be,
|
||||
'UTF16LE' => self::Utf16Le,
|
||||
'UTF32',
|
||||
'UTF32BE' => self::Utf32Be,
|
||||
'UTF32LE' => self::Utf32Le,
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
|
||||
public function length(): int
|
||||
{
|
||||
return strlen($this->value);
|
||||
}
|
||||
|
||||
public function encoding(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Utf16Le => 'UTF-16LE',
|
||||
self::Utf16Be => 'UTF-16BE',
|
||||
self::Utf32Le => 'UTF-32LE',
|
||||
self::Utf32Be => 'UTF-32BE',
|
||||
self::Utf8 => 'UTF-8',
|
||||
};
|
||||
}
|
||||
|
||||
public function isUtf8(): bool
|
||||
{
|
||||
return match ($this) {
|
||||
self::Utf8 => true,
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
|
||||
public function isUtf16(): bool
|
||||
{
|
||||
return match ($this) {
|
||||
self::Utf16Le,
|
||||
self::Utf16Be => true,
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
|
||||
public function isUtf32(): bool
|
||||
{
|
||||
return match ($this) {
|
||||
self::Utf32Le,
|
||||
self::Utf32Be => true,
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue