Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
49
vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php
vendored
Executable file
49
vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Provider\Node;
|
||||
|
||||
use Ramsey\Uuid\Exception\NodeException;
|
||||
use Ramsey\Uuid\Provider\NodeProviderInterface;
|
||||
use Ramsey\Uuid\Type\Hexadecimal;
|
||||
|
||||
/**
|
||||
* FallbackNodeProvider retrieves the system node ID by stepping through a list of providers until a node ID can be obtained
|
||||
*/
|
||||
class FallbackNodeProvider implements NodeProviderInterface
|
||||
{
|
||||
/**
|
||||
* @param iterable<NodeProviderInterface> $providers Array of node providers
|
||||
*/
|
||||
public function __construct(private iterable $providers)
|
||||
{
|
||||
}
|
||||
|
||||
public function getNode(): Hexadecimal
|
||||
{
|
||||
$lastProviderException = null;
|
||||
|
||||
foreach ($this->providers as $provider) {
|
||||
try {
|
||||
return $provider->getNode();
|
||||
} catch (NodeException $exception) {
|
||||
$lastProviderException = $exception;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
throw new NodeException(message: 'Unable to find a suitable node provider', previous: $lastProviderException);
|
||||
}
|
||||
}
|
||||
58
vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php
vendored
Executable file
58
vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php
vendored
Executable file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Provider\Node;
|
||||
|
||||
use Ramsey\Collection\AbstractCollection;
|
||||
use Ramsey\Uuid\Provider\NodeProviderInterface;
|
||||
use Ramsey\Uuid\Type\Hexadecimal;
|
||||
|
||||
/**
|
||||
* A collection of NodeProviderInterface objects
|
||||
*
|
||||
* @deprecated this class has been deprecated and will be removed in 5.0.0. The use-case for this class comes from a
|
||||
* pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced at runtime:
|
||||
* that is no longer necessary, now that you can safely verify your code to be correct and use more generic types
|
||||
* like `iterable<T>` instead.
|
||||
*
|
||||
* @extends AbstractCollection<NodeProviderInterface>
|
||||
*/
|
||||
class NodeProviderCollection extends AbstractCollection
|
||||
{
|
||||
public function getType(): string
|
||||
{
|
||||
return NodeProviderInterface::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-constructs the object from its serialized form
|
||||
*
|
||||
* @param string $serialized The serialized PHP string to unserialize into a UuidInterface instance
|
||||
*/
|
||||
public function unserialize($serialized): void
|
||||
{
|
||||
/** @var array<array-key, NodeProviderInterface> $data */
|
||||
$data = unserialize($serialized, [
|
||||
'allowed_classes' => [
|
||||
Hexadecimal::class,
|
||||
RandomNodeProvider::class,
|
||||
StaticNodeProvider::class,
|
||||
SystemNodeProvider::class,
|
||||
],
|
||||
]);
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
$this->data = array_filter($data, fn ($unserialized): bool => $unserialized instanceof NodeProviderInterface);
|
||||
}
|
||||
}
|
||||
55
vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php
vendored
Executable file
55
vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Provider\Node;
|
||||
|
||||
use Ramsey\Uuid\Exception\RandomSourceException;
|
||||
use Ramsey\Uuid\Provider\NodeProviderInterface;
|
||||
use Ramsey\Uuid\Type\Hexadecimal;
|
||||
use Throwable;
|
||||
|
||||
use function bin2hex;
|
||||
use function dechex;
|
||||
use function hex2bin;
|
||||
use function hexdec;
|
||||
use function str_pad;
|
||||
use function substr;
|
||||
|
||||
use const STR_PAD_LEFT;
|
||||
|
||||
/**
|
||||
* RandomNodeProvider generates a random node ID
|
||||
*
|
||||
* @link https://www.rfc-editor.org/rfc/rfc9562#section-6.10 RFC 9562, 6.10. UUIDs That Do Not Identify the Host
|
||||
*/
|
||||
class RandomNodeProvider implements NodeProviderInterface
|
||||
{
|
||||
public function getNode(): Hexadecimal
|
||||
{
|
||||
try {
|
||||
$nodeBytes = random_bytes(6);
|
||||
} catch (Throwable $exception) {
|
||||
throw new RandomSourceException($exception->getMessage(), (int) $exception->getCode(), $exception);
|
||||
}
|
||||
|
||||
// Split the node bytes for math on 32-bit systems.
|
||||
$nodeMsb = substr($nodeBytes, 0, 3);
|
||||
$nodeLsb = substr($nodeBytes, 3);
|
||||
|
||||
// Set the multicast bit; see RFC 9562, section 6.10.
|
||||
$nodeMsb = hex2bin(str_pad(dechex(hexdec(bin2hex($nodeMsb)) | 0x010000), 6, '0', STR_PAD_LEFT));
|
||||
|
||||
return new Hexadecimal(str_pad(bin2hex($nodeMsb . $nodeLsb), 12, '0', STR_PAD_LEFT));
|
||||
}
|
||||
}
|
||||
65
vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php
vendored
Executable file
65
vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php
vendored
Executable file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Provider\Node;
|
||||
|
||||
use Ramsey\Uuid\Exception\InvalidArgumentException;
|
||||
use Ramsey\Uuid\Provider\NodeProviderInterface;
|
||||
use Ramsey\Uuid\Type\Hexadecimal;
|
||||
|
||||
use function dechex;
|
||||
use function hexdec;
|
||||
use function str_pad;
|
||||
use function substr;
|
||||
|
||||
use const STR_PAD_LEFT;
|
||||
|
||||
/**
|
||||
* StaticNodeProvider provides a static node value with the multicast bit set
|
||||
*
|
||||
* @link https://www.rfc-editor.org/rfc/rfc9562#section-6.10 RFC 9562, 6.10. UUIDs That Do Not Identify the Host
|
||||
*/
|
||||
class StaticNodeProvider implements NodeProviderInterface
|
||||
{
|
||||
private Hexadecimal $node;
|
||||
|
||||
/**
|
||||
* @param Hexadecimal $node The static node value to use
|
||||
*/
|
||||
public function __construct(Hexadecimal $node)
|
||||
{
|
||||
if (strlen($node->toString()) > 12) {
|
||||
throw new InvalidArgumentException('Static node value cannot be greater than 12 hexadecimal characters');
|
||||
}
|
||||
|
||||
$this->node = $this->setMulticastBit($node);
|
||||
}
|
||||
|
||||
public function getNode(): Hexadecimal
|
||||
{
|
||||
return $this->node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the multicast bit for the static node value
|
||||
*/
|
||||
private function setMulticastBit(Hexadecimal $node): Hexadecimal
|
||||
{
|
||||
$nodeHex = str_pad($node->toString(), 12, '0', STR_PAD_LEFT);
|
||||
$firstOctet = substr($nodeHex, 0, 2);
|
||||
$firstOctet = str_pad(dechex(hexdec($firstOctet) | 0x01), 2, '0', STR_PAD_LEFT);
|
||||
|
||||
return new Hexadecimal($firstOctet . substr($nodeHex, 2));
|
||||
}
|
||||
}
|
||||
184
vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
vendored
Executable file
184
vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
vendored
Executable file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the ramsey/uuid library
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Provider\Node;
|
||||
|
||||
use Ramsey\Uuid\Exception\NodeException;
|
||||
use Ramsey\Uuid\Provider\NodeProviderInterface;
|
||||
use Ramsey\Uuid\Type\Hexadecimal;
|
||||
|
||||
use function array_filter;
|
||||
use function array_map;
|
||||
use function array_walk;
|
||||
use function count;
|
||||
use function ob_get_clean;
|
||||
use function ob_start;
|
||||
use function preg_match;
|
||||
use function preg_match_all;
|
||||
use function reset;
|
||||
use function str_contains;
|
||||
use function str_replace;
|
||||
use function strtolower;
|
||||
use function strtoupper;
|
||||
use function substr;
|
||||
|
||||
use const GLOB_NOSORT;
|
||||
use const PREG_PATTERN_ORDER;
|
||||
|
||||
/**
|
||||
* SystemNodeProvider retrieves the system node ID, if possible
|
||||
*
|
||||
* The system node ID, or host ID, is often the same as the MAC address for a network interface on the host.
|
||||
*/
|
||||
class SystemNodeProvider implements NodeProviderInterface
|
||||
{
|
||||
/**
|
||||
* Pattern to match nodes in `ifconfig` and `ipconfig` output.
|
||||
*/
|
||||
private const IFCONFIG_PATTERN = '/[^:]([0-9a-f]{2}([:-])[0-9a-f]{2}(\2[0-9a-f]{2}){4})[^:]/i';
|
||||
|
||||
/**
|
||||
* Pattern to match nodes in sysfs stream output.
|
||||
*/
|
||||
private const SYSFS_PATTERN = '/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i';
|
||||
|
||||
public function getNode(): Hexadecimal
|
||||
{
|
||||
$node = $this->getNodeFromSystem();
|
||||
|
||||
if ($node === '') {
|
||||
throw new NodeException('Unable to fetch a node for this system');
|
||||
}
|
||||
|
||||
return new Hexadecimal($node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the system node if found
|
||||
*/
|
||||
protected function getNodeFromSystem(): string
|
||||
{
|
||||
/** @var string | null $node */
|
||||
static $node = null;
|
||||
|
||||
if ($node !== null) {
|
||||
return $node;
|
||||
}
|
||||
|
||||
// First, try a Linux-specific approach.
|
||||
$node = $this->getSysfs();
|
||||
|
||||
if ($node === '') {
|
||||
// Search ifconfig output for MAC addresses & return the first one.
|
||||
$node = $this->getIfconfig();
|
||||
}
|
||||
|
||||
$node = str_replace([':', '-'], '', $node);
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the network interface configuration for the system
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
protected function getIfconfig(): string
|
||||
{
|
||||
if (str_contains(strtolower((string) ini_get('disable_functions')), 'passthru')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/** @var string $phpOs */
|
||||
$phpOs = constant('PHP_OS');
|
||||
|
||||
ob_start();
|
||||
switch (strtoupper(substr($phpOs, 0, 3))) {
|
||||
case 'WIN':
|
||||
passthru('ipconfig /all 2>&1');
|
||||
|
||||
break;
|
||||
case 'DAR':
|
||||
passthru('ifconfig 2>&1');
|
||||
|
||||
break;
|
||||
case 'FRE':
|
||||
passthru('netstat -i -f link 2>&1');
|
||||
|
||||
break;
|
||||
case 'LIN':
|
||||
default:
|
||||
passthru('netstat -ie 2>&1');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$ifconfig = (string) ob_get_clean();
|
||||
|
||||
if (preg_match_all(self::IFCONFIG_PATTERN, $ifconfig, $matches, PREG_PATTERN_ORDER)) {
|
||||
foreach ($matches[1] as $iface) {
|
||||
if ($iface !== '00:00:00:00:00:00' && $iface !== '00-00-00-00-00-00') {
|
||||
return $iface;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns MAC address from the first system interface via the sysfs interface
|
||||
*/
|
||||
protected function getSysfs(): string
|
||||
{
|
||||
/** @var string $phpOs */
|
||||
$phpOs = constant('PHP_OS');
|
||||
|
||||
if (strtoupper($phpOs) !== 'LINUX') {
|
||||
return '';
|
||||
}
|
||||
|
||||
$addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT);
|
||||
|
||||
if ($addressPaths === false || count($addressPaths) === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/** @var array<array-key, string> $macs */
|
||||
$macs = [];
|
||||
|
||||
array_walk($addressPaths, function (string $addressPath) use (&$macs): void {
|
||||
if (is_readable($addressPath)) {
|
||||
$macs[] = file_get_contents($addressPath);
|
||||
}
|
||||
});
|
||||
|
||||
/** @var callable $trim */
|
||||
$trim = 'trim';
|
||||
|
||||
$macs = array_map($trim, $macs);
|
||||
|
||||
// Remove invalid entries.
|
||||
$macs = array_filter($macs, function (mixed $address): bool {
|
||||
assert(is_string($address));
|
||||
|
||||
return $address !== '00:00:00:00:00:00' && preg_match(self::SYSFS_PATTERN, $address);
|
||||
});
|
||||
|
||||
/** @var bool | string $mac */
|
||||
$mac = reset($macs);
|
||||
|
||||
return (string) $mac;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user