diff --git a/Makefile b/Makefile index fb62b57..cfe2b0e 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,8 @@ autoload: make src/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php make src/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php make src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php - make src/ncc/ThirdParty/Symfony/process/autoload_spl.php - make src/ncc/ThirdParty/Symfony/uid/autoload_spl.php + make src/ncc/ThirdParty/Symfony/Process/autoload_spl.php + make src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php make src/ncc/autoload_spl.php cp src/autoload/autoload.php src/ncc/autoload.php @@ -20,13 +20,13 @@ src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php: phpab --output src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php \ src/ncc/ThirdParty/Symfony/polyfill-mbstring -src/ncc/ThirdParty/Symfony/process/autoload_spl.php: - phpab --output src/ncc/ThirdParty/Symfony/process/autoload_spl.php \ - src/ncc/ThirdParty/Symfony/process +src/ncc/ThirdParty/Symfony/Process/autoload_spl.php: + phpab --output src/ncc/ThirdParty/Symfony/Process/autoload_spl.php \ + src/ncc/ThirdParty/Symfony/Process -src/ncc/ThirdParty/Symfony/uid/autoload_spl.php: - phpab --output src/ncc/ThirdParty/Symfony/uid/autoload_spl.php \ - src/ncc/ThirdParty/Symfony/uid +src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php: + phpab --output src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php \ + src/ncc/ThirdParty/Symfony/Uid src/ncc/autoload_spl.php: phpab --output src/ncc/autoload_spl.php \ @@ -60,5 +60,5 @@ clean: rm -f src/ncc/ThirdParty/defuse/php-encryption/autoload_spl.php rm -f src/ncc/ThirdParty/Symfony/polyfill-ctype/autoload_spl.php rm -f src/ncc/ThirdParty/Symfony/polyfill-mbstring/autoload_spl.php - rm -f src/ncc/ThirdParty/Symfony/process/autoload_spl.php - rm -f src/ncc/ThirdParty/Symfony/uid/autoload_spl.php \ No newline at end of file + rm -f src/ncc/ThirdParty/Symfony/Process/autoload_spl.php + rm -f src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php \ No newline at end of file diff --git a/src/autoload/autoload.php b/src/autoload/autoload.php index 78ae9a5..e906f54 100644 --- a/src/autoload/autoload.php +++ b/src/autoload/autoload.php @@ -19,7 +19,7 @@ $third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-mbstring' . DIRECTORY_SEPARATOR . 'autoload_spl.php', $third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'polyfill-mbstring' . DIRECTORY_SEPARATOR . 'bootstrap.php', $third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Process' . DIRECTORY_SEPARATOR . 'autoload_spl.php', - $third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'uid' . DIRECTORY_SEPARATOR . 'autoload_spl.php', + $third_party_path . 'Symfony' . DIRECTORY_SEPARATOR . 'Uid' . DIRECTORY_SEPARATOR . 'autoload_spl.php', ]; foreach($target_files as $file) diff --git a/src/ncc/ThirdParty/Symfony/process/CHANGELOG.md b/src/ncc/ThirdParty/Symfony/Process/CHANGELOG.md similarity index 51% rename from src/ncc/ThirdParty/Symfony/process/CHANGELOG.md rename to src/ncc/ThirdParty/Symfony/Process/CHANGELOG.md index 31b9ee6..09c93d8 100644 --- a/src/ncc/ThirdParty/Symfony/process/CHANGELOG.md +++ b/src/ncc/ThirdParty/Symfony/Process/CHANGELOG.md @@ -4,74 +4,74 @@ CHANGELOG 5.2.0 ----- - * added `Process::setOptions()` to set `Process` specific options + * added `process::setOptions()` to set `process` specific options * added option `create_new_console` to allow a subprocess to continue to run after the main script exited, both on Linux and on Windows 5.1.0 ----- - * added `Process::getStartTime()` to retrieve the start time of the process as float + * added `process::getStartTime()` to retrieve the start time of the process as float 5.0.0 ----- - * removed `Process::inheritEnvironmentVariables()` - * removed `PhpProcess::setPhpBinary()` - * `Process` must be instantiated with a command array, use `Process::fromShellCommandline()` when the command should be parsed by the shell - * removed `Process::setCommandLine()` + * removed `process::inheritEnvironmentVariables()` + * removed `Phpprocess::setPhpBinary()` + * `process` must be instantiated with a command array, use `process::fromShellCommandline()` when the command should be parsed by the shell + * removed `process::setCommandLine()` 4.4.0 ----- - * deprecated `Process::inheritEnvironmentVariables()`: env variables are always inherited. - * added `Process::getLastOutputTime()` method + * deprecated `process::inheritEnvironmentVariables()`: env variables are always inherited. + * added `process::getLastOutputTime()` method 4.2.0 ----- - * added the `Process::fromShellCommandline()` to run commands in a shell wrapper - * deprecated passing a command as string when creating a `Process` instance - * deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods - * added the `Process::waitUntil()` method to wait for the process only for a + * added the `process::fromShellCommandline()` to run commands in a shell wrapper + * deprecated passing a command as string when creating a `process` instance + * deprecated the `process::setCommandline()` and the `Phpprocess::setPhpBinary()` methods + * added the `process::waitUntil()` method to wait for the process only for a specific output, then continue the normal execution of your application 4.1.0 ----- - * added the `Process::isTtySupported()` method that allows to check for TTY support + * added the `process::isTtySupported()` method that allows to check for TTY support * made `PhpExecutableFinder` look for the `PHP_BINARY` env var when searching the php binary - * added the `ProcessSignaledException` class to properly catch signaled process errors + * added the `processSignaledException` class to properly catch signaled process errors 4.0.0 ----- * environment variables will always be inherited * added a second `array $env = []` argument to the `start()`, `run()`, - `mustRun()`, and `restart()` methods of the `Process` class + `mustRun()`, and `restart()` methods of the `process` class * added a second `array $env = []` argument to the `start()` method of the - `PhpProcess` class - * the `ProcessUtils::escapeArgument()` method has been removed + `Phpprocess` class + * the `processUtils::escapeArgument()` method has been removed * the `areEnvironmentVariablesInherited()`, `getOptions()`, and `setOptions()` - methods of the `Process` class have been removed + methods of the `process` class have been removed * support for passing `proc_open()` options has been removed - * removed the `ProcessBuilder` class, use the `Process` class instead - * removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class - * passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not + * removed the `processBuilder` class, use the `process` class instead + * removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `process` class + * passing a not existing working directory to the constructor of the `Symfony\Component\process\process` class is not supported anymore 3.4.0 ----- - * deprecated the ProcessBuilder class - * deprecated calling `Process::start()` without setting a valid working directory beforehand (via `setWorkingDirectory()` or constructor) + * deprecated the processBuilder class + * deprecated calling `process::start()` without setting a valid working directory beforehand (via `setWorkingDirectory()` or constructor) 3.3.0 ----- - * added command line arrays in the `Process` class - * added `$env` argument to `Process::start()`, `run()`, `mustRun()` and `restart()` methods - * deprecated the `ProcessUtils::escapeArgument()` method + * added command line arrays in the `process` class + * added `$env` argument to `process::start()`, `run()`, `mustRun()` and `restart()` methods + * deprecated the `processUtils::escapeArgument()` method * deprecated not inheriting environment variables * deprecated configuring `proc_open()` options * deprecated configuring enhanced Windows compatibility @@ -82,9 +82,9 @@ CHANGELOG * added support for PTY mode * added the convenience method "mustRun" - * deprecation: Process::setStdin() is deprecated in favor of Process::setInput() - * deprecation: Process::getStdin() is deprecated in favor of Process::getInput() - * deprecation: Process::setInput() and ProcessBuilder::setInput() do not accept non-scalar types + * deprecation: process::setStdin() is deprecated in favor of process::setInput() + * deprecation: process::getStdin() is deprecated in favor of process::getInput() + * deprecation: process::setInput() and processBuilder::setInput() do not accept non-scalar types 2.4.0 ----- @@ -94,23 +94,23 @@ CHANGELOG 2.3.0 ----- - * added ProcessUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows - * added Process::signal() - * added Process::getPid() + * added processUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows + * added process::signal() + * added process::getPid() * added support for a TTY mode 2.2.0 ----- - * added ProcessBuilder::setArguments() to reset the arguments on a builder + * added processBuilder::setArguments() to reset the arguments on a builder * added a way to retrieve the standard and error output incrementally - * added Process:restart() + * added process:restart() 2.1.0 ----- * added support for non-blocking processes (start(), wait(), isRunning(), stop()) * enhanced Windows compatibility - * added Process::getExitCodeText() that returns a string representation for + * added process::getExitCodeText() that returns a string representation for the exit code returned by the process - * added ProcessBuilder + * added processBuilder diff --git a/src/ncc/ThirdParty/Symfony/process/Exception/ExceptionInterface.php b/src/ncc/ThirdParty/Symfony/Process/Exception/ExceptionInterface.php similarity index 89% rename from src/ncc/ThirdParty/Symfony/process/Exception/ExceptionInterface.php rename to src/ncc/ThirdParty/Symfony/Process/Exception/ExceptionInterface.php index 35573be..300b0f6 100644 --- a/src/ncc/ThirdParty/Symfony/process/Exception/ExceptionInterface.php +++ b/src/ncc/ThirdParty/Symfony/Process/Exception/ExceptionInterface.php @@ -12,7 +12,7 @@ namespace ncc\ThirdParty\Symfony\process\Exception; /** - * Marker Interface for the Process Component. + * Marker Interface for the process Component. * * @author Johannes M. Schmitt */ diff --git a/src/ncc/ThirdParty/Symfony/process/Exception/InvalidArgumentException.php b/src/ncc/ThirdParty/Symfony/Process/Exception/InvalidArgumentException.php similarity index 89% rename from src/ncc/ThirdParty/Symfony/process/Exception/InvalidArgumentException.php rename to src/ncc/ThirdParty/Symfony/Process/Exception/InvalidArgumentException.php index 4fca12c..74100a5 100644 --- a/src/ncc/ThirdParty/Symfony/process/Exception/InvalidArgumentException.php +++ b/src/ncc/ThirdParty/Symfony/Process/Exception/InvalidArgumentException.php @@ -12,7 +12,7 @@ namespace ncc\ThirdParty\Symfony\process\Exception; /** - * InvalidArgumentException for the Process Component. + * InvalidArgumentException for the process Component. * * @author Romain Neutron */ diff --git a/src/ncc/ThirdParty/Symfony/process/Exception/LogicException.php b/src/ncc/ThirdParty/Symfony/Process/Exception/LogicException.php similarity index 90% rename from src/ncc/ThirdParty/Symfony/process/Exception/LogicException.php rename to src/ncc/ThirdParty/Symfony/Process/Exception/LogicException.php index bff9116..fc5aeef 100644 --- a/src/ncc/ThirdParty/Symfony/process/Exception/LogicException.php +++ b/src/ncc/ThirdParty/Symfony/Process/Exception/LogicException.php @@ -12,7 +12,7 @@ namespace ncc\ThirdParty\Symfony\process\Exception; /** - * LogicException for the Process Component. + * LogicException for the process Component. * * @author Romain Neutron */ diff --git a/src/ncc/ThirdParty/Symfony/process/Exception/ProcessFailedException.php b/src/ncc/ThirdParty/Symfony/Process/Exception/ProcessFailedException.php similarity index 90% rename from src/ncc/ThirdParty/Symfony/process/Exception/ProcessFailedException.php rename to src/ncc/ThirdParty/Symfony/Process/Exception/ProcessFailedException.php index f10b689..020dc39 100644 --- a/src/ncc/ThirdParty/Symfony/process/Exception/ProcessFailedException.php +++ b/src/ncc/ThirdParty/Symfony/Process/Exception/ProcessFailedException.php @@ -18,11 +18,11 @@ use ncc\ThirdParty\Symfony\process\process; * * @author Johannes M. Schmitt */ -class ProcessFailedException extends RuntimeException +class processFailedException extends RuntimeException { private $process; - public function __construct(Process $process) + public function __construct(process $process) { if ($process->isSuccessful()) { throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); @@ -47,7 +47,7 @@ class ProcessFailedException extends RuntimeException $this->process = $process; } - public function getProcess() + public function getprocess() { return $this->process; } diff --git a/src/ncc/ThirdParty/Symfony/process/Exception/ProcessSignaledException.php b/src/ncc/ThirdParty/Symfony/Process/Exception/ProcessSignaledException.php similarity index 78% rename from src/ncc/ThirdParty/Symfony/process/Exception/ProcessSignaledException.php rename to src/ncc/ThirdParty/Symfony/Process/Exception/ProcessSignaledException.php index 9877d22..295588c 100644 --- a/src/ncc/ThirdParty/Symfony/process/Exception/ProcessSignaledException.php +++ b/src/ncc/ThirdParty/Symfony/Process/Exception/ProcessSignaledException.php @@ -18,24 +18,24 @@ use ncc\ThirdParty\Symfony\process\process; * * @author Sullivan Senechal */ -final class ProcessSignaledException extends RuntimeException +final class processSignaledException extends RuntimeException { private $process; - public function __construct(Process $process) + public function __construct(process $process) { $this->process = $process; parent::__construct(sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); } - public function getProcess(): Process + public function getprocess(): process { return $this->process; } public function getSignal(): int { - return $this->getProcess()->getTermSignal(); + return $this->getprocess()->getTermSignal(); } } diff --git a/src/ncc/ThirdParty/Symfony/process/Exception/ProcessTimedOutException.php b/src/ncc/ThirdParty/Symfony/Process/Exception/ProcessTimedOutException.php similarity index 90% rename from src/ncc/ThirdParty/Symfony/process/Exception/ProcessTimedOutException.php rename to src/ncc/ThirdParty/Symfony/Process/Exception/ProcessTimedOutException.php index bfed1d2..6bc52c1 100644 --- a/src/ncc/ThirdParty/Symfony/process/Exception/ProcessTimedOutException.php +++ b/src/ncc/ThirdParty/Symfony/Process/Exception/ProcessTimedOutException.php @@ -18,7 +18,7 @@ use ncc\ThirdParty\Symfony\process\process; * * @author Johannes M. Schmitt */ -class ProcessTimedOutException extends RuntimeException +class processTimedOutException extends RuntimeException { public const TYPE_GENERAL = 1; public const TYPE_IDLE = 2; @@ -26,7 +26,7 @@ class ProcessTimedOutException extends RuntimeException private $process; private $timeoutType; - public function __construct(Process $process, int $timeoutType) + public function __construct(process $process, int $timeoutType) { $this->process = $process; $this->timeoutType = $timeoutType; @@ -38,7 +38,7 @@ class ProcessTimedOutException extends RuntimeException )); } - public function getProcess() + public function getprocess() { return $this->process; } diff --git a/src/ncc/ThirdParty/Symfony/process/Exception/RuntimeException.php b/src/ncc/ThirdParty/Symfony/Process/Exception/RuntimeException.php similarity index 90% rename from src/ncc/ThirdParty/Symfony/process/Exception/RuntimeException.php rename to src/ncc/ThirdParty/Symfony/Process/Exception/RuntimeException.php index cd0bc31..de5e4e0 100644 --- a/src/ncc/ThirdParty/Symfony/process/Exception/RuntimeException.php +++ b/src/ncc/ThirdParty/Symfony/Process/Exception/RuntimeException.php @@ -12,7 +12,7 @@ namespace ncc\ThirdParty\Symfony\process\Exception; /** - * RuntimeException for the Process Component. + * RuntimeException for the process Component. * * @author Johannes M. Schmitt */ diff --git a/src/ncc/ThirdParty/Symfony/process/ExecutableFinder.php b/src/ncc/ThirdParty/Symfony/Process/ExecutableFinder.php similarity index 100% rename from src/ncc/ThirdParty/Symfony/process/ExecutableFinder.php rename to src/ncc/ThirdParty/Symfony/Process/ExecutableFinder.php diff --git a/src/ncc/ThirdParty/Symfony/process/InputStream.php b/src/ncc/ThirdParty/Symfony/Process/InputStream.php similarity index 94% rename from src/ncc/ThirdParty/Symfony/process/InputStream.php rename to src/ncc/ThirdParty/Symfony/Process/InputStream.php index 85ccc2b..c0e1718 100644 --- a/src/ncc/ThirdParty/Symfony/process/InputStream.php +++ b/src/ncc/ThirdParty/Symfony/Process/InputStream.php @@ -14,7 +14,7 @@ namespace ncc\ThirdParty\Symfony\process; use ncc\ThirdParty\Symfony\process\Exception\RuntimeException; /** - * Provides a way to continuously write to the input of a Process until the InputStream is closed. + * Provides a way to continuously write to the input of a process until the InputStream is closed. * * @author Nicolas Grekas * @@ -49,7 +49,7 @@ class InputStream implements \IteratorAggregate if ($this->isClosed()) { throw new RuntimeException(sprintf('"%s" is closed.', static::class)); } - $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); + $this->input[] = processUtils::validateInput(__METHOD__, $input); } /** diff --git a/src/ncc/ThirdParty/Symfony/process/LICENSE b/src/ncc/ThirdParty/Symfony/Process/LICENSE similarity index 100% rename from src/ncc/ThirdParty/Symfony/process/LICENSE rename to src/ncc/ThirdParty/Symfony/Process/LICENSE diff --git a/src/ncc/ThirdParty/Symfony/process/PhpExecutableFinder.php b/src/ncc/ThirdParty/Symfony/Process/PhpExecutableFinder.php similarity index 100% rename from src/ncc/ThirdParty/Symfony/process/PhpExecutableFinder.php rename to src/ncc/ThirdParty/Symfony/Process/PhpExecutableFinder.php diff --git a/src/ncc/ThirdParty/Symfony/process/PhpProcess.php b/src/ncc/ThirdParty/Symfony/Process/PhpProcess.php similarity index 94% rename from src/ncc/ThirdParty/Symfony/process/PhpProcess.php rename to src/ncc/ThirdParty/Symfony/Process/PhpProcess.php index 5b6c665..ade2c00 100644 --- a/src/ncc/ThirdParty/Symfony/process/PhpProcess.php +++ b/src/ncc/ThirdParty/Symfony/Process/PhpProcess.php @@ -15,15 +15,15 @@ use ncc\ThirdParty\Symfony\process\Exception\LogicException; use ncc\ThirdParty\Symfony\process\Exception\RuntimeException; /** - * PhpProcess runs a PHP script in an independent process. + * Phpprocess runs a PHP script in an independent process. * - * $p = new PhpProcess(''); + * $p = new Phpprocess(''); * $p->run(); * print $p->getOutput()."\n"; * * @author Fabien Potencier */ -class PhpProcess extends Process +class Phpprocess extends process { /** * @param string $script The PHP script to run (as a string) diff --git a/src/ncc/ThirdParty/Symfony/process/Pipes/AbstractPipes.php b/src/ncc/ThirdParty/Symfony/Process/Pipes/AbstractPipes.php similarity index 100% rename from src/ncc/ThirdParty/Symfony/process/Pipes/AbstractPipes.php rename to src/ncc/ThirdParty/Symfony/Process/Pipes/AbstractPipes.php diff --git a/src/ncc/ThirdParty/Symfony/process/Pipes/PipesInterface.php b/src/ncc/ThirdParty/Symfony/Process/Pipes/PipesInterface.php similarity index 100% rename from src/ncc/ThirdParty/Symfony/process/Pipes/PipesInterface.php rename to src/ncc/ThirdParty/Symfony/Process/Pipes/PipesInterface.php diff --git a/src/ncc/ThirdParty/Symfony/process/Pipes/UnixPipes.php b/src/ncc/ThirdParty/Symfony/Process/Pipes/UnixPipes.php similarity index 96% rename from src/ncc/ThirdParty/Symfony/process/Pipes/UnixPipes.php rename to src/ncc/ThirdParty/Symfony/Process/Pipes/UnixPipes.php index 07d1c45..bb43cca 100644 --- a/src/ncc/ThirdParty/Symfony/process/Pipes/UnixPipes.php +++ b/src/ncc/ThirdParty/Symfony/Process/Pipes/UnixPipes.php @@ -11,7 +11,7 @@ namespace ncc\ThirdParty\Symfony\process\Pipes; -use ncc\ThirdParty\Symfony\process\Process; +use ncc\ThirdParty\Symfony\process\process; /** * UnixPipes implementation uses unix pipes as handles. @@ -73,7 +73,7 @@ class UnixPipes extends AbstractPipes ]; } - if ($this->ptyMode && Process::isPtySupported()) { + if ($this->ptyMode && process::isPtySupported()) { return [ ['pty'], ['pty'], @@ -110,7 +110,7 @@ class UnixPipes extends AbstractPipes // let's have a look if something changed in streams set_error_handler($this->handleError(...)); - if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { + if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? process::TIMEOUT_PRECISION * 1E6 : 0)) { restore_error_handler(); // if a system call has been interrupted, forget about it, let's try again // otherwise, an error occurred, let's reset pipes diff --git a/src/ncc/ThirdParty/Symfony/process/Pipes/WindowsPipes.php b/src/ncc/ThirdParty/Symfony/Process/Pipes/WindowsPipes.php similarity index 94% rename from src/ncc/ThirdParty/Symfony/process/Pipes/WindowsPipes.php rename to src/ncc/ThirdParty/Symfony/Process/Pipes/WindowsPipes.php index 8c11f38..3174d7a 100644 --- a/src/ncc/ThirdParty/Symfony/process/Pipes/WindowsPipes.php +++ b/src/ncc/ThirdParty/Symfony/Process/Pipes/WindowsPipes.php @@ -12,7 +12,7 @@ namespace ncc\ThirdParty\Symfony\process\Pipes; use ncc\ThirdParty\Symfony\process\Exception\RuntimeException; -use ncc\ThirdParty\Symfony\process\Process; +use ncc\ThirdParty\Symfony\process\process; /** * WindowsPipes implementation uses temporary files as handles. @@ -30,8 +30,8 @@ class WindowsPipes extends AbstractPipes private $fileHandles = []; private $lockHandles = []; private $readBytes = [ - Process::STDOUT => 0, - Process::STDERR => 0, + process::STDOUT => 0, + process::STDERR => 0, ]; private $haveReadSupport; @@ -45,8 +45,8 @@ class WindowsPipes extends AbstractPipes // // @see https://bugs.php.net/51800 $pipes = [ - Process::STDOUT => Process::OUT, - Process::STDERR => Process::ERR, + process::STDOUT => process::OUT, + process::STDERR => process::ERR, ]; $tmpDir = sys_get_temp_dir(); $lastError = 'unknown reason'; @@ -147,9 +147,9 @@ class WindowsPipes extends AbstractPipes if ($blocking) { if ($w) { - @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); + @stream_select($r, $w, $e, 0, process::TIMEOUT_PRECISION * 1E6); } elseif ($this->fileHandles) { - usleep(Process::TIMEOUT_PRECISION * 1E6); + usleep(process::TIMEOUT_PRECISION * 1E6); } } foreach ($this->fileHandles as $type => $fileHandle) { diff --git a/src/ncc/ThirdParty/Symfony/process/Process.php b/src/ncc/ThirdParty/Symfony/Process/Process.php similarity index 95% rename from src/ncc/ThirdParty/Symfony/process/Process.php rename to src/ncc/ThirdParty/Symfony/Process/Process.php index 8f5f6b4..c9f4e0c 100644 --- a/src/ncc/ThirdParty/Symfony/process/Process.php +++ b/src/ncc/ThirdParty/Symfony/Process/Process.php @@ -13,16 +13,16 @@ namespace ncc\ThirdParty\Symfony\process; use ncc\ThirdParty\Symfony\process\Exception\InvalidArgumentException; use ncc\ThirdParty\Symfony\process\Exception\LogicException; -use ncc\ThirdParty\Symfony\process\Exception\ProcessFailedException; -use ncc\ThirdParty\Symfony\process\Exception\ProcessSignaledException; -use ncc\ThirdParty\Symfony\process\Exception\ProcessTimedOutException; +use ncc\ThirdParty\Symfony\process\Exception\processFailedException; +use ncc\ThirdParty\Symfony\process\Exception\processSignaledException; +use ncc\ThirdParty\Symfony\process\Exception\processTimedOutException; use ncc\ThirdParty\Symfony\process\Exception\RuntimeException; use ncc\ThirdParty\Symfony\process\Pipes\PipesInterface; use ncc\ThirdParty\Symfony\process\Pipes\UnixPipes; use ncc\ThirdParty\Symfony\process\Pipes\WindowsPipes; /** - * Process is a thin wrapper around proc_* functions to easily + * process is a thin wrapper around proc_* functions to easily * start independent PHP processes. * * @author Fabien Potencier @@ -30,7 +30,7 @@ use ncc\ThirdParty\Symfony\process\Pipes\WindowsPipes; * * @implements \IteratorAggregate */ -class Process implements \IteratorAggregate +class process implements \IteratorAggregate { public const ERR = 'err'; public const OUT = 'out'; @@ -103,7 +103,7 @@ class Process implements \IteratorAggregate 131 => 'Quit and dump core', 132 => 'Illegal instruction', 133 => 'Trace/breakpoint trap', - 134 => 'Process aborted', + 134 => 'process aborted', 135 => 'Bus error: "access to undefined portion of memory object"', 136 => 'Floating point exception: "erroneous arithmetic operation"', 137 => 'Kill (terminate immediately)', @@ -143,7 +143,7 @@ class Process implements \IteratorAggregate public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60) { if (!\function_exists('proc_open')) { - throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); + throw new LogicException('The process class relies on proc_open, which is not available on your PHP installation.'); } $this->commandline = $command; @@ -167,7 +167,7 @@ class Process implements \IteratorAggregate } /** - * Creates a Process instance as a command-line to be run in a shell wrapper. + * Creates a process instance as a command-line to be run in a shell wrapper. * * Command-lines are parsed by the shell of your OS (/bin/sh on Unix-like, cmd.exe on Windows.) * This allows using e.g. pipes or conditional execution. In this mode, signals are sent to the @@ -176,7 +176,7 @@ class Process implements \IteratorAggregate * In order to inject dynamic values into command-lines, we strongly recommend using placeholders. * This will save escaping values, which is not portable nor secure anyway: * - * $process = Process::fromShellCommandline('my_command "${:MY_VAR}"'); + * $process = process::fromShellCommandline('my_command "${:MY_VAR}"'); * $process->run(null, ['MY_VAR' => $theValue]); * * @param string $command The command line to pass to the shell of the OS @@ -216,7 +216,7 @@ class Process implements \IteratorAggregate public function __clone() { - $this->resetProcessData(); + $this->resetprocessData(); } /** @@ -236,8 +236,8 @@ class Process implements \IteratorAggregate * * @throws RuntimeException When process can't be launched * @throws RuntimeException When process is already running - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal + * @throws processTimedOutException When process timed out + * @throws processSignaledException When process stopped after receiving signal * @throws LogicException In case a callback is provided and output has been disabled * * @final @@ -257,14 +257,14 @@ class Process implements \IteratorAggregate * * @return $this * - * @throws ProcessFailedException if the process didn't terminate successfully + * @throws processFailedException if the process didn't terminate successfully * * @final */ public function mustRun(callable $callback = null, array $env = []): static { if (0 !== $this->run($callback, $env)) { - throw new ProcessFailedException($this); + throw new processFailedException($this); } return $this; @@ -292,10 +292,10 @@ class Process implements \IteratorAggregate public function start(callable $callback = null, array $env = []) { if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); + throw new RuntimeException('process is already running.'); } - $this->resetProcessData(); + $this->resetprocessData(); $this->starttime = $this->lastOutputTime = microtime(true); $this->callback = $this->buildCallback($callback); $this->hasCallback = null !== $callback; @@ -381,7 +381,7 @@ class Process implements \IteratorAggregate public function restart(callable $callback = null, array $env = []): static { if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); + throw new RuntimeException('process is already running.'); } $process = clone $this; @@ -401,20 +401,20 @@ class Process implements \IteratorAggregate * * @return int The exitcode of the process * - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal + * @throws processTimedOutException When process timed out + * @throws processSignaledException When process stopped after receiving signal * @throws LogicException When process is not yet started */ public function wait(callable $callback = null): int { - $this->requireProcessIsStarted(__FUNCTION__); + $this->requireprocessIsStarted(__FUNCTION__); $this->updateStatus(false); if (null !== $callback) { if (!$this->processPipes->haveReadSupport()) { $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait".'); + throw new LogicException('Pass the callback to the "process::start" method or call enableOutput to use a callback with "process::wait".'); } $this->callback = $this->buildCallback($callback); } @@ -431,7 +431,7 @@ class Process implements \IteratorAggregate } if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) { - throw new ProcessSignaledException($this); + throw new processSignaledException($this); } return $this->exitcode; @@ -446,16 +446,16 @@ class Process implements \IteratorAggregate * * @throws RuntimeException When process timed out * @throws LogicException When process is not yet started - * @throws ProcessTimedOutException In case the timeout was reached + * @throws processTimedOutException In case the timeout was reached */ public function waitUntil(callable $callback): bool { - $this->requireProcessIsStarted(__FUNCTION__); + $this->requireprocessIsStarted(__FUNCTION__); $this->updateStatus(false); if (!$this->processPipes->haveReadSupport()) { $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".'); + throw new LogicException('Pass the callback to the "process::start" method or call enableOutput to use a callback with "process::waitUntil".'); } $callback = $this->buildCallback($callback); @@ -600,9 +600,9 @@ class Process implements \IteratorAggregate } /** - * Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). + * Returns an iterator to the output of the process, with the output type as keys (process::OUT/ERR). * - * @param int $flags A bit field of Process::ITER_* flags + * @param int $flags A bit field of process::ITER_* flags * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started @@ -726,7 +726,7 @@ class Process implements \IteratorAggregate /** * Returns the exit code returned by the process. * - * @return int|null The exit status code, null if the Process is not terminated + * @return int|null The exit status code, null if the process is not terminated */ public function getExitCode(): ?int { @@ -741,7 +741,7 @@ class Process implements \IteratorAggregate * This method relies on the Unix exit code status standardization * and might not be relevant for other operating systems. * - * @return string|null A string representation for the exit status code, null if the Process is not terminated + * @return string|null A string representation for the exit status code, null if the process is not terminated * * @see http://tldp.org/LDP/abs/html/exitcodes.html * @see http://en.wikipedia.org/wiki/Unix_signal @@ -772,7 +772,7 @@ class Process implements \IteratorAggregate */ public function hasBeenSignaled(): bool { - $this->requireProcessIsTerminated(__FUNCTION__); + $this->requireprocessIsTerminated(__FUNCTION__); return $this->processInformation['signaled']; } @@ -787,7 +787,7 @@ class Process implements \IteratorAggregate */ public function getTermSignal(): int { - $this->requireProcessIsTerminated(__FUNCTION__); + $this->requireprocessIsTerminated(__FUNCTION__); if ($this->isSigchildEnabled() && -1 === $this->processInformation['termsig']) { throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal cannot be retrieved.'); @@ -805,7 +805,7 @@ class Process implements \IteratorAggregate */ public function hasBeenStopped(): bool { - $this->requireProcessIsTerminated(__FUNCTION__); + $this->requireprocessIsTerminated(__FUNCTION__); return $this->processInformation['stopped']; } @@ -819,7 +819,7 @@ class Process implements \IteratorAggregate */ public function getStopSignal(): int { - $this->requireProcessIsTerminated(__FUNCTION__); + $this->requireprocessIsTerminated(__FUNCTION__); return $this->processInformation['stopsig']; } @@ -1101,7 +1101,7 @@ class Process implements \IteratorAggregate } /** - * Gets the Process input. + * Gets the process input. * * @return resource|string|\Iterator|null */ @@ -1127,7 +1127,7 @@ class Process implements \IteratorAggregate throw new LogicException('Input cannot be set while the process is running.'); } - $this->input = ProcessUtils::validateInput(__METHOD__, $input); + $this->input = processUtils::validateInput(__METHOD__, $input); return $this; } @@ -1138,7 +1138,7 @@ class Process implements \IteratorAggregate * In case you run a background process (with the start method), you should * trigger this method regularly to ensure the process timeout * - * @throws ProcessTimedOutException In case the timeout was reached + * @throws processTimedOutException In case the timeout was reached */ public function checkTimeout() { @@ -1149,13 +1149,13 @@ class Process implements \IteratorAggregate if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) { $this->stop(0); - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL); + throw new processTimedOutException($this, processTimedOutException::TYPE_GENERAL); } if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) { $this->stop(0); - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE); + throw new processTimedOutException($this, processTimedOutException::TYPE_IDLE); } } @@ -1333,7 +1333,7 @@ class Process implements \IteratorAggregate throw new LogicException('Output has been disabled.'); } - $this->requireProcessIsStarted($caller); + $this->requireprocessIsStarted($caller); $this->updateStatus($blocking); } @@ -1411,7 +1411,7 @@ class Process implements \IteratorAggregate /** * Resets data related to the latest run of the process. */ - private function resetProcessData() + private function resetprocessData() { $this->starttime = null; $this->callback = null; @@ -1532,10 +1532,10 @@ class Process implements \IteratorAggregate * * @throws LogicException if the process has not run */ - private function requireProcessIsStarted(string $functionName) + private function requireprocessIsStarted(string $functionName) { if (!$this->isStarted()) { - throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName)); + throw new LogicException(sprintf('process must be started before calling "%s()".', $functionName)); } } @@ -1544,10 +1544,10 @@ class Process implements \IteratorAggregate * * @throws LogicException if the process is not yet terminated */ - private function requireProcessIsTerminated(string $functionName) + private function requireprocessIsTerminated(string $functionName) { if (!$this->isTerminated()) { - throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName)); + throw new LogicException(sprintf('process must be terminated before calling "%s()".', $functionName)); } } diff --git a/src/ncc/ThirdParty/Symfony/process/ProcessUtils.php b/src/ncc/ThirdParty/Symfony/Process/ProcessUtils.php similarity index 91% rename from src/ncc/ThirdParty/Symfony/process/ProcessUtils.php rename to src/ncc/ThirdParty/Symfony/Process/ProcessUtils.php index a977ac3..bd66db2 100644 --- a/src/ncc/ThirdParty/Symfony/process/ProcessUtils.php +++ b/src/ncc/ThirdParty/Symfony/Process/ProcessUtils.php @@ -14,13 +14,13 @@ namespace ncc\ThirdParty\Symfony\process; use ncc\ThirdParty\Symfony\process\Exception\InvalidArgumentException; /** - * ProcessUtils is a bunch of utility methods. + * processUtils is a bunch of utility methods. * * This class contains static methods only and is not meant to be instantiated. * * @author Martin Hasoň */ -class ProcessUtils +class processUtils { /** * This class should not be instantiated. @@ -30,7 +30,7 @@ class ProcessUtils } /** - * Validates and normalizes a Process input. + * Validates and normalizes a process input. * * @param string $caller The name of method call that validates the input * @param mixed $input The input to validate @@ -49,7 +49,7 @@ class ProcessUtils if (\is_scalar($input)) { return (string) $input; } - if ($input instanceof Process) { + if ($input instanceof process) { return $input->getIterator($input::ITER_SKIP_ERR); } if ($input instanceof \Iterator) { diff --git a/src/ncc/ThirdParty/Symfony/process/README.md b/src/ncc/ThirdParty/Symfony/Process/README.md similarity index 85% rename from src/ncc/ThirdParty/Symfony/process/README.md rename to src/ncc/ThirdParty/Symfony/Process/README.md index a371d28..d9d900f 100644 --- a/src/ncc/ThirdParty/Symfony/process/README.md +++ b/src/ncc/ThirdParty/Symfony/Process/README.md @@ -1,12 +1,12 @@ -Process Component +process Component ================= -The Process component executes commands in sub-processes. +The process component executes commands in sub-processes. Sponsor ------- -The Process component for Symfony 6.1 is [backed][1] by [SensioLabs][2]. +The process component for Symfony 6.1 is [backed][1] by [SensioLabs][2]. As the creator of Symfony, SensioLabs supports companies using Symfony, with an offering encompassing consultancy, expertise, services, training, and technical diff --git a/src/ncc/ThirdParty/Symfony/process/VERSION b/src/ncc/ThirdParty/Symfony/Process/VERSION similarity index 100% rename from src/ncc/ThirdParty/Symfony/process/VERSION rename to src/ncc/ThirdParty/Symfony/Process/VERSION diff --git a/src/ncc/ThirdParty/Symfony/uid/AbstractUid.php b/src/ncc/ThirdParty/Symfony/Uid/AbstractUid.php similarity index 99% rename from src/ncc/ThirdParty/Symfony/uid/AbstractUid.php rename to src/ncc/ThirdParty/Symfony/Uid/AbstractUid.php index 8bbe31b..97611fc 100644 --- a/src/ncc/ThirdParty/Symfony/uid/AbstractUid.php +++ b/src/ncc/ThirdParty/Symfony/Uid/AbstractUid.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * @author Nicolas Grekas diff --git a/src/ncc/ThirdParty/Symfony/uid/BinaryUtil.php b/src/ncc/ThirdParty/Symfony/Uid/BinaryUtil.php similarity index 99% rename from src/ncc/ThirdParty/Symfony/uid/BinaryUtil.php rename to src/ncc/ThirdParty/Symfony/Uid/BinaryUtil.php index ea14627..2f278d7 100644 --- a/src/ncc/ThirdParty/Symfony/uid/BinaryUtil.php +++ b/src/ncc/ThirdParty/Symfony/Uid/BinaryUtil.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * @internal diff --git a/src/ncc/ThirdParty/Symfony/Uid/CHANGELOG.md b/src/ncc/ThirdParty/Symfony/Uid/CHANGELOG.md new file mode 100644 index 0000000..6b6605b --- /dev/null +++ b/src/ncc/ThirdParty/Symfony/Uid/CHANGELOG.md @@ -0,0 +1,29 @@ +CHANGELOG +========= + +5.4 +--- + + * Add `NilUlid` + +5.3 +--- + + * The component is not marked as `@experimental` anymore + * Add `AbstractUid::fromBinary()`, `AbstractUid::fromBase58()`, `AbstractUid::fromBase32()` and `AbstractUid::fromRfc4122()` + * [BC BREAK] Replace `UuidV1::getTime()`, `UuidV6::getTime()` and `Ulid::getTime()` by `UuidV1::getDateTime()`, `UuidV6::getDateTime()` and `Ulid::getDateTime()` + * Add `Uuid::NAMESPACE_*` constants from RFC4122 + * Add `UlidFactory`, `UuidFactory`, `RandomBasedUuidFactory`, `TimeBasedUuidFactory` and `NameBasedUuidFactory` + * Add commands to generate and inspect UUIDs and ULIDs + +5.2.0 +----- + + * made UUIDv6 always return truly random node fields to prevent leaking the MAC of the host + +5.1.0 +----- + + * added support for UUID + * added support for ULID + * added the component diff --git a/src/ncc/ThirdParty/Symfony/Uid/Command/GenerateUlidCommand.php b/src/ncc/ThirdParty/Symfony/Uid/Command/GenerateUlidCommand.php new file mode 100644 index 0000000..5ce7e86 --- /dev/null +++ b/src/ncc/ThirdParty/Symfony/Uid/Command/GenerateUlidCommand.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ncc\ThirdParty\Symfony\uid\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use ncc\ThirdParty\Symfony\Uid\Factory\UlidFactory; + +#[AsCommand(name: 'ulid:generate', description: 'Generate a ULID')] +class GenerateUlidCommand extends Command +{ + private const FORMAT_OPTIONS = [ + 'base32', + 'base58', + 'rfc4122', + ]; + + private UlidFactory $factory; + + public function __construct(UlidFactory $factory = null) + { + $this->factory = $factory ?? new UlidFactory(); + + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + protected function configure(): void + { + $this + ->setDefinition([ + new InputOption('time', null, InputOption::VALUE_REQUIRED, 'The ULID timestamp: a parsable date/time string'), + new InputOption('count', 'c', InputOption::VALUE_REQUIRED, 'The number of ULID to generate', 1), + new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'The ULID output format: base32, base58 or rfc4122', 'base32'), + ]) + ->setHelp(<<<'EOF' +The %command.name% command generates a ULID. + + php %command.full_name% + +To specify the timestamp: + + php %command.full_name% --time="2021-02-16 14:09:08" + +To generate several ULIDs: + + php %command.full_name% --count=10 + +To output a specific format: + + php %command.full_name% --format=rfc4122 +EOF + ) + ; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); + + if (null !== $time = $input->getOption('time')) { + try { + $time = new \DateTimeImmutable($time); + } catch (\Exception $e) { + $io->error(sprintf('Invalid timestamp "%s": %s', $time, str_replace('DateTimeImmutable::__construct(): ', '', $e->getMessage()))); + + return 1; + } + } + + $formatOption = $input->getOption('format'); + + if (\in_array($formatOption, self::FORMAT_OPTIONS)) { + $format = 'to'.ucfirst($formatOption); + } else { + $io->error(sprintf('Invalid format "%s", did you mean "base32", "base58" or "rfc4122"?', $input->getOption('format'))); + + return 1; + } + + $count = (int) $input->getOption('count'); + try { + for ($i = 0; $i < $count; ++$i) { + $output->writeln($this->factory->create($time)->$format()); + } + } catch (\Exception $e) { + $io->error($e->getMessage()); + + return 1; + } + + return 0; + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues(self::FORMAT_OPTIONS); + } + } +} diff --git a/src/ncc/ThirdParty/Symfony/Uid/Command/GenerateUuidCommand.php b/src/ncc/ThirdParty/Symfony/Uid/Command/GenerateUuidCommand.php new file mode 100644 index 0000000..02a6aad --- /dev/null +++ b/src/ncc/ThirdParty/Symfony/Uid/Command/GenerateUuidCommand.php @@ -0,0 +1,216 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ncc\ThirdParty\Symfony\uid\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use ncc\ThirdParty\Symfony\Uid\Factory\UuidFactory; +use ncc\ThirdParty\Symfony\uid\Uuid; + +#[AsCommand(name: 'uuid:generate', description: 'Generate a UUID')] +class GenerateUuidCommand extends Command +{ + private UuidFactory $factory; + + public function __construct(UuidFactory $factory = null) + { + $this->factory = $factory ?? new UuidFactory(); + + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + protected function configure(): void + { + $this + ->setDefinition([ + new InputOption('time-based', null, InputOption::VALUE_REQUIRED, 'The timestamp, to generate a time-based UUID: a parsable date/time string'), + new InputOption('node', null, InputOption::VALUE_REQUIRED, 'The UUID whose node part should be used as the node of the generated UUID'), + new InputOption('name-based', null, InputOption::VALUE_REQUIRED, 'The name, to generate a name-based UUID'), + new InputOption('namespace', null, InputOption::VALUE_REQUIRED, 'The UUID to use at the namespace for named-based UUIDs, predefined namespaces keywords "dns", "url", "oid" and "x500" are accepted'), + new InputOption('random-based', null, InputOption::VALUE_NONE, 'To generate a random-based UUID'), + new InputOption('count', 'c', InputOption::VALUE_REQUIRED, 'The number of UUID to generate', 1), + new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'The UUID output format: rfc4122, base58 or base32', 'rfc4122'), + ]) + ->setHelp(<<<'EOF' +The %command.name% generates a UUID. + + php %command.full_name% + +To generate a time-based UUID: + + php %command.full_name% --time-based=now + +To specify a time-based UUID's node: + + php %command.full_name% --time-based=@1613480254 --node=fb3502dc-137e-4849-8886-ac90d07f64a7 + +To generate a name-based UUID: + + php %command.full_name% --name-based=foo + +To specify a name-based UUID's namespace: + + php %command.full_name% --name-based=bar --namespace=fb3502dc-137e-4849-8886-ac90d07f64a7 + +To generate a random-based UUID: + + php %command.full_name% --random-based + +To generate several UUIDs: + + php %command.full_name% --count=10 + +To output a specific format: + + php %command.full_name% --format=base58 +EOF + ) + ; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); + + $time = $input->getOption('time-based'); + $node = $input->getOption('node'); + $name = $input->getOption('name-based'); + $namespace = $input->getOption('namespace'); + $random = $input->getOption('random-based'); + + if (false !== ($time ?? $name ?? $random) && 1 < ((null !== $time) + (null !== $name) + $random)) { + $io->error('Only one of "--time-based", "--name-based" or "--random-based" can be provided at a time.'); + + return 1; + } + + if (null === $time && null !== $node) { + $io->error('Option "--node" can only be used with "--time-based".'); + + return 1; + } + + if (null === $name && null !== $namespace) { + $io->error('Option "--namespace" can only be used with "--name-based".'); + + return 1; + } + + switch (true) { + case null !== $time: + if (null !== $node) { + try { + $node = Uuid::fromString($node); + } catch (\InvalidArgumentException $e) { + $io->error(sprintf('Invalid node "%s": %s', $node, $e->getMessage())); + + return 1; + } + } + + try { + new \DateTimeImmutable($time); + } catch (\Exception $e) { + $io->error(sprintf('Invalid timestamp "%s": %s', $time, str_replace('DateTimeImmutable::__construct(): ', '', $e->getMessage()))); + + return 1; + } + + $create = function () use ($node, $time): Uuid { + return $this->factory->timeBased($node)->create(new \DateTimeImmutable($time)); + }; + break; + + case null !== $name: + if ($namespace && !\in_array($namespace, ['dns', 'url', 'oid', 'x500'], true)) { + try { + $namespace = Uuid::fromString($namespace); + } catch (\InvalidArgumentException $e) { + $io->error(sprintf('Invalid namespace "%s": %s', $namespace, $e->getMessage())); + + return 1; + } + } + + $create = function () use ($namespace, $name): Uuid { + try { + $factory = $this->factory->nameBased($namespace); + } catch (\LogicException) { + throw new \InvalidArgumentException('Missing namespace: use the "--namespace" option or configure a default namespace in the underlying factory.'); + } + + return $factory->create($name); + }; + break; + + case $random: + $create = $this->factory->randomBased()->create(...); + break; + + default: + $create = $this->factory->create(...); + break; + } + + $formatOption = $input->getOption('format'); + + if (\in_array($formatOption, $this->getAvailableFormatOptions())) { + $format = 'to'.ucfirst($formatOption); + } else { + $io->error(sprintf('Invalid format "%s", did you mean "base32", "base58" or "rfc4122"?', $formatOption)); + + return 1; + } + + $count = (int) $input->getOption('count'); + try { + for ($i = 0; $i < $count; ++$i) { + $output->writeln($create()->$format()); + } + } catch (\Exception $e) { + $io->error($e->getMessage()); + + return 1; + } + + return 0; + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues($this->getAvailableFormatOptions()); + } + } + + private function getAvailableFormatOptions(): array + { + return [ + 'base32', + 'base58', + 'rfc4122', + ]; + } +} diff --git a/src/ncc/ThirdParty/Symfony/Uid/Command/InspectUlidCommand.php b/src/ncc/ThirdParty/Symfony/Uid/Command/InspectUlidCommand.php new file mode 100644 index 0000000..9555e66 --- /dev/null +++ b/src/ncc/ThirdParty/Symfony/Uid/Command/InspectUlidCommand.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ncc\ThirdParty\Symfony\uid\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\TableSeparator; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use ncc\ThirdParty\Symfony\uid\Ulid; + +#[AsCommand(name: 'ulid:inspect', description: 'Inspect a ULID')] +class InspectUlidCommand extends Command +{ + /** + * {@inheritdoc} + */ + protected function configure(): void + { + $this + ->setDefinition([ + new InputArgument('ulid', InputArgument::REQUIRED, 'The ULID to inspect'), + ]) + ->setHelp(<<<'EOF' +The %command.name% displays information about a ULID. + + php %command.full_name% 01EWAKBCMWQ2C94EXNN60ZBS0Q + php %command.full_name% 1BVdfLn3ERmbjYBLCdaaLW + php %command.full_name% 01771535-b29c-b898-923b-b5a981f5e417 +EOF + ) + ; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); + + try { + $ulid = Ulid::fromString($input->getArgument('ulid')); + } catch (\InvalidArgumentException $e) { + $io->error($e->getMessage()); + + return 1; + } + + $io->table(['Label', 'Value'], [ + ['toBase32 (canonical)', (string) $ulid], + ['toBase58', $ulid->toBase58()], + ['toRfc4122', $ulid->toRfc4122()], + new TableSeparator(), + ['Time', $ulid->getDateTime()->format('Y-m-d H:i:s.v \U\T\C')], + ]); + + return 0; + } +} diff --git a/src/ncc/ThirdParty/Symfony/Uid/Command/InspectUuidCommand.php b/src/ncc/ThirdParty/Symfony/Uid/Command/InspectUuidCommand.php new file mode 100644 index 0000000..101007b --- /dev/null +++ b/src/ncc/ThirdParty/Symfony/Uid/Command/InspectUuidCommand.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ncc\ThirdParty\Symfony\uid\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\TableSeparator; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use ncc\ThirdParty\Symfony\uid\Uuid; +use ncc\ThirdParty\Symfony\uid\UuidV1; +use ncc\ThirdParty\Symfony\uid\UuidV6; + +#[AsCommand(name: 'uuid:inspect', description: 'Inspect a UUID')] +class InspectUuidCommand extends Command +{ + /** + * {@inheritdoc} + */ + protected function configure(): void + { + $this + ->setDefinition([ + new InputArgument('uuid', InputArgument::REQUIRED, 'The UUID to inspect'), + ]) + ->setHelp(<<<'EOF' +The %command.name% displays information about a UUID. + + php %command.full_name% a7613e0a-5986-11eb-a861-2bf05af69e52 + php %command.full_name% MfnmaUvvQ1h8B14vTwt6dX + php %command.full_name% 57C4Z0MPC627NTGR9BY1DFD7JJ +EOF + ) + ; + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); + + try { + /** @var Uuid $uuid */ + $uuid = Uuid::fromString($input->getArgument('uuid')); + } catch (\InvalidArgumentException $e) { + $io->error($e->getMessage()); + + return 1; + } + + if (-1 === $version = uuid_type($uuid)) { + $version = 'nil'; + } elseif (0 === $version || 2 === $version || 6 < $version) { + $version = 'unknown'; + } + + $rows = [ + ['Version', $version], + ['toRfc4122 (canonical)', (string) $uuid], + ['toBase58', $uuid->toBase58()], + ['toBase32', $uuid->toBase32()], + ]; + + if ($uuid instanceof UuidV1 || $uuid instanceof UuidV6) { + $rows[] = new TableSeparator(); + $rows[] = ['Time', $uuid->getDateTime()->format('Y-m-d H:i:s.u \U\T\C')]; + } + + $io->table(['Label', 'Value'], $rows); + + return 0; + } +} diff --git a/src/ncc/ThirdParty/Symfony/uid/Factory/NameBasedUuidFactory.php b/src/ncc/ThirdParty/Symfony/Uid/Factory/NameBasedUuidFactory.php similarity index 85% rename from src/ncc/ThirdParty/Symfony/uid/Factory/NameBasedUuidFactory.php rename to src/ncc/ThirdParty/Symfony/Uid/Factory/NameBasedUuidFactory.php index d1231fe..783919b 100644 --- a/src/ncc/ThirdParty/Symfony/uid/Factory/NameBasedUuidFactory.php +++ b/src/ncc/ThirdParty/Symfony/Uid/Factory/NameBasedUuidFactory.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid\Factory; +namespace ncc\ThirdParty\Symfony\uid\Factory; -use ncc\Symfony\Component\Uid\Uuid; -use ncc\Symfony\Component\Uid\UuidV3; -use ncc\Symfony\Component\Uid\UuidV5; +use ncc\ThirdParty\Symfony\uid\Uuid; +use ncc\ThirdParty\Symfony\uid\UuidV3; +use ncc\ThirdParty\Symfony\uid\UuidV5; class NameBasedUuidFactory { diff --git a/src/ncc/ThirdParty/Symfony/uid/Factory/RandomBasedUuidFactory.php b/src/ncc/ThirdParty/Symfony/Uid/Factory/RandomBasedUuidFactory.php similarity index 85% rename from src/ncc/ThirdParty/Symfony/uid/Factory/RandomBasedUuidFactory.php rename to src/ncc/ThirdParty/Symfony/Uid/Factory/RandomBasedUuidFactory.php index b3db863..32383ae 100644 --- a/src/ncc/ThirdParty/Symfony/uid/Factory/RandomBasedUuidFactory.php +++ b/src/ncc/ThirdParty/Symfony/Uid/Factory/RandomBasedUuidFactory.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid\Factory; +namespace ncc\ThirdParty\Symfony\uid\Factory; -use ncc\Symfony\Component\Uid\UuidV4; +use ncc\ThirdParty\Symfony\uid\UuidV4; class RandomBasedUuidFactory { diff --git a/src/ncc/ThirdParty/Symfony/uid/Factory/TimeBasedUuidFactory.php b/src/ncc/ThirdParty/Symfony/Uid/Factory/TimeBasedUuidFactory.php similarity index 82% rename from src/ncc/ThirdParty/Symfony/uid/Factory/TimeBasedUuidFactory.php rename to src/ncc/ThirdParty/Symfony/Uid/Factory/TimeBasedUuidFactory.php index 203a786..1f45a0e 100644 --- a/src/ncc/ThirdParty/Symfony/uid/Factory/TimeBasedUuidFactory.php +++ b/src/ncc/ThirdParty/Symfony/Uid/Factory/TimeBasedUuidFactory.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid\Factory; +namespace ncc\ThirdParty\Symfony\uid\Factory; -use ncc\Symfony\Component\Uid\Uuid; -use ncc\Symfony\Component\Uid\UuidV1; -use ncc\Symfony\Component\Uid\UuidV6; +use ncc\ThirdParty\Symfony\uid\Uuid; +use ncc\ThirdParty\Symfony\uid\UuidV1; +use ncc\ThirdParty\Symfony\uid\UuidV6; class TimeBasedUuidFactory { diff --git a/src/ncc/ThirdParty/Symfony/uid/Factory/UlidFactory.php b/src/ncc/ThirdParty/Symfony/Uid/Factory/UlidFactory.php similarity index 83% rename from src/ncc/ThirdParty/Symfony/uid/Factory/UlidFactory.php rename to src/ncc/ThirdParty/Symfony/Uid/Factory/UlidFactory.php index e777d6e..7806329 100644 --- a/src/ncc/ThirdParty/Symfony/uid/Factory/UlidFactory.php +++ b/src/ncc/ThirdParty/Symfony/Uid/Factory/UlidFactory.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid\Factory; +namespace ncc\ThirdParty\Symfony\uid\Factory; -use ncc\Symfony\Component\Uid\Ulid; +use ncc\ThirdParty\Symfony\uid\Ulid; class UlidFactory { diff --git a/src/ncc/ThirdParty/Symfony/uid/Factory/UuidFactory.php b/src/ncc/ThirdParty/Symfony/Uid/Factory/UuidFactory.php similarity index 92% rename from src/ncc/ThirdParty/Symfony/uid/Factory/UuidFactory.php rename to src/ncc/ThirdParty/Symfony/Uid/Factory/UuidFactory.php index 7159702..973353d 100644 --- a/src/ncc/ThirdParty/Symfony/uid/Factory/UuidFactory.php +++ b/src/ncc/ThirdParty/Symfony/Uid/Factory/UuidFactory.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid\Factory; +namespace ncc\ThirdParty\Symfony\uid\Factory; -use ncc\Symfony\Component\Uid\Uuid; -use ncc\Symfony\Component\Uid\UuidV1; -use ncc\Symfony\Component\Uid\UuidV4; -use ncc\Symfony\Component\Uid\UuidV5; -use ncc\Symfony\Component\Uid\UuidV6; +use ncc\ThirdParty\Symfony\uid\Uuid; +use ncc\ThirdParty\Symfony\uid\UuidV1; +use ncc\ThirdParty\Symfony\uid\UuidV4; +use ncc\ThirdParty\Symfony\uid\UuidV5; +use ncc\ThirdParty\Symfony\uid\UuidV6; class UuidFactory { diff --git a/src/ncc/ThirdParty/Symfony/uid/LICENSE b/src/ncc/ThirdParty/Symfony/Uid/LICENSE similarity index 100% rename from src/ncc/ThirdParty/Symfony/uid/LICENSE rename to src/ncc/ThirdParty/Symfony/Uid/LICENSE diff --git a/src/ncc/ThirdParty/Symfony/uid/NilUlid.php b/src/ncc/ThirdParty/Symfony/Uid/NilUlid.php similarity index 90% rename from src/ncc/ThirdParty/Symfony/uid/NilUlid.php rename to src/ncc/ThirdParty/Symfony/Uid/NilUlid.php index 5f03354..d4d5be7 100644 --- a/src/ncc/ThirdParty/Symfony/uid/NilUlid.php +++ b/src/ncc/ThirdParty/Symfony/Uid/NilUlid.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; class NilUlid extends Ulid { diff --git a/src/ncc/ThirdParty/Symfony/uid/NilUuid.php b/src/ncc/ThirdParty/Symfony/Uid/NilUuid.php similarity index 92% rename from src/ncc/ThirdParty/Symfony/uid/NilUuid.php rename to src/ncc/ThirdParty/Symfony/Uid/NilUuid.php index ba97bb2..3067bf1 100644 --- a/src/ncc/ThirdParty/Symfony/uid/NilUuid.php +++ b/src/ncc/ThirdParty/Symfony/Uid/NilUuid.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * @author Grégoire Pineau diff --git a/src/ncc/ThirdParty/Symfony/uid/README.md b/src/ncc/ThirdParty/Symfony/Uid/README.md similarity index 100% rename from src/ncc/ThirdParty/Symfony/uid/README.md rename to src/ncc/ThirdParty/Symfony/Uid/README.md diff --git a/src/ncc/ThirdParty/Symfony/uid/Ulid.php b/src/ncc/ThirdParty/Symfony/Uid/Ulid.php similarity index 99% rename from src/ncc/ThirdParty/Symfony/uid/Ulid.php rename to src/ncc/ThirdParty/Symfony/Uid/Ulid.php index 3303f31..cabfec3 100644 --- a/src/ncc/ThirdParty/Symfony/uid/Ulid.php +++ b/src/ncc/ThirdParty/Symfony/Uid/Ulid.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * A ULID is lexicographically sortable and contains a 48-bit timestamp and 80-bit of crypto-random entropy. diff --git a/src/ncc/ThirdParty/Symfony/uid/Uuid.php b/src/ncc/ThirdParty/Symfony/Uid/Uuid.php similarity index 99% rename from src/ncc/ThirdParty/Symfony/uid/Uuid.php rename to src/ncc/ThirdParty/Symfony/Uid/Uuid.php index 86e1609..bc50219 100644 --- a/src/ncc/ThirdParty/Symfony/uid/Uuid.php +++ b/src/ncc/ThirdParty/Symfony/Uid/Uuid.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * @author Grégoire Pineau @@ -72,7 +72,6 @@ class Uuid extends AbstractUid UuidV6::TYPE => new UuidV6($uuid), default => new self($uuid), }; - } final public static function v1(): UuidV1 diff --git a/src/ncc/ThirdParty/Symfony/uid/UuidV1.php b/src/ncc/ThirdParty/Symfony/Uid/UuidV1.php similarity index 98% rename from src/ncc/ThirdParty/Symfony/uid/UuidV1.php rename to src/ncc/ThirdParty/Symfony/Uid/UuidV1.php index e6572c1..c293930 100644 --- a/src/ncc/ThirdParty/Symfony/uid/UuidV1.php +++ b/src/ncc/ThirdParty/Symfony/Uid/UuidV1.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * A v1 UUID contains a 60-bit timestamp and 62 extra unique bits. diff --git a/src/ncc/ThirdParty/Symfony/uid/UuidV3.php b/src/ncc/ThirdParty/Symfony/Uid/UuidV3.php similarity index 92% rename from src/ncc/ThirdParty/Symfony/uid/UuidV3.php rename to src/ncc/ThirdParty/Symfony/Uid/UuidV3.php index 8797315..1edc81a 100644 --- a/src/ncc/ThirdParty/Symfony/uid/UuidV3.php +++ b/src/ncc/ThirdParty/Symfony/Uid/UuidV3.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * A v3 UUID contains an MD5 hash of another UUID and a name. diff --git a/src/ncc/ThirdParty/Symfony/uid/UuidV4.php b/src/ncc/ThirdParty/Symfony/Uid/UuidV4.php similarity index 95% rename from src/ncc/ThirdParty/Symfony/uid/UuidV4.php rename to src/ncc/ThirdParty/Symfony/Uid/UuidV4.php index 632508b..c82d8f5 100644 --- a/src/ncc/ThirdParty/Symfony/uid/UuidV4.php +++ b/src/ncc/ThirdParty/Symfony/Uid/UuidV4.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * A v4 UUID contains a 122-bit random number. diff --git a/src/ncc/ThirdParty/Symfony/uid/UuidV5.php b/src/ncc/ThirdParty/Symfony/Uid/UuidV5.php similarity index 92% rename from src/ncc/ThirdParty/Symfony/uid/UuidV5.php rename to src/ncc/ThirdParty/Symfony/Uid/UuidV5.php index 5f72f68..473740d 100644 --- a/src/ncc/ThirdParty/Symfony/uid/UuidV5.php +++ b/src/ncc/ThirdParty/Symfony/Uid/UuidV5.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * A v5 UUID contains a SHA1 hash of another UUID and a name. diff --git a/src/ncc/ThirdParty/Symfony/uid/UuidV6.php b/src/ncc/ThirdParty/Symfony/Uid/UuidV6.php similarity index 98% rename from src/ncc/ThirdParty/Symfony/uid/UuidV6.php rename to src/ncc/ThirdParty/Symfony/Uid/UuidV6.php index 07c2f5f..f267565 100644 --- a/src/ncc/ThirdParty/Symfony/uid/UuidV6.php +++ b/src/ncc/ThirdParty/Symfony/Uid/UuidV6.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace ncc\Symfony\Component\Uid; +namespace ncc\ThirdParty\Symfony\Uid; /** * A v6 UUID is lexicographically sortable and contains a 60-bit timestamp and 62 extra unique bits. diff --git a/src/ncc/ThirdParty/Symfony/Uid/VERSION b/src/ncc/ThirdParty/Symfony/Uid/VERSION new file mode 100644 index 0000000..d7ff925 --- /dev/null +++ b/src/ncc/ThirdParty/Symfony/Uid/VERSION @@ -0,0 +1 @@ +6.1.3 \ No newline at end of file diff --git a/src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php b/src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php new file mode 100644 index 0000000..12412b9 --- /dev/null +++ b/src/ncc/ThirdParty/Symfony/Uid/autoload_spl.php @@ -0,0 +1,40 @@ + '/AbstractUid.php', + 'ncc\\thirdparty\\symfony\\uid\\binaryutil' => '/BinaryUtil.php', + 'ncc\\thirdparty\\symfony\\uid\\command\\generateulidcommand' => '/Command/GenerateUlidCommand.php', + 'ncc\\thirdparty\\symfony\\uid\\command\\generateuuidcommand' => '/Command/GenerateUuidCommand.php', + 'ncc\\thirdparty\\symfony\\uid\\command\\inspectulidcommand' => '/Command/InspectUlidCommand.php', + 'ncc\\thirdparty\\symfony\\uid\\command\\inspectuuidcommand' => '/Command/InspectUuidCommand.php', + 'ncc\\thirdparty\\symfony\\uid\\factory\\namebaseduuidfactory' => '/Factory/NameBasedUuidFactory.php', + 'ncc\\thirdparty\\symfony\\uid\\factory\\randombaseduuidfactory' => '/Factory/RandomBasedUuidFactory.php', + 'ncc\\thirdparty\\symfony\\uid\\factory\\timebaseduuidfactory' => '/Factory/TimeBasedUuidFactory.php', + 'ncc\\thirdparty\\symfony\\uid\\factory\\ulidfactory' => '/Factory/UlidFactory.php', + 'ncc\\thirdparty\\symfony\\uid\\factory\\uuidfactory' => '/Factory/UuidFactory.php', + 'ncc\\thirdparty\\symfony\\uid\\nilulid' => '/NilUlid.php', + 'ncc\\thirdparty\\symfony\\uid\\niluuid' => '/NilUuid.php', + 'ncc\\thirdparty\\symfony\\uid\\ulid' => '/Ulid.php', + 'ncc\\thirdparty\\symfony\\uid\\uuid' => '/Uuid.php', + 'ncc\\thirdparty\\symfony\\uid\\uuidv1' => '/UuidV1.php', + 'ncc\\thirdparty\\symfony\\uid\\uuidv3' => '/UuidV3.php', + 'ncc\\thirdparty\\symfony\\uid\\uuidv4' => '/UuidV4.php', + 'ncc\\thirdparty\\symfony\\uid\\uuidv5' => '/UuidV5.php', + 'ncc\\thirdparty\\symfony\\uid\\uuidv6' => '/UuidV6.php' + ); + } + $cn = strtolower($class); + if (isset($classes[$cn])) { + require __DIR__ . $classes[$cn]; + } + }, + true, + false +); +// @codeCoverageIgnoreEnd diff --git a/src/ncc/ThirdParty/Symfony/uid/VERSION b/src/ncc/ThirdParty/Symfony/uid/VERSION deleted file mode 100644 index 358e78e..0000000 --- a/src/ncc/ThirdParty/Symfony/uid/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.1.0 \ No newline at end of file diff --git a/src/ncc/autoload.php b/src/ncc/autoload.php new file mode 100644 index 0000000..e906f54 --- /dev/null +++ b/src/ncc/autoload.php @@ -0,0 +1,34 @@ +