From f489aff090e527a9ea674fb7fb7118434a9c27f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= Date: Wed, 4 Nov 2026 12:18:34 +0100 Subject: [PATCH 1/3] Add comprehensive stream utilities in `Runtime` **Details:** - Introduced multiple stream utility classes in the `Runtime` component, adhering to PHP 8.2 standards: - `Wrapper`: Handles stream wrapper registration, unregistration, and restoration. - `Socket`: Provides wrappers for stream socket creation, management, and communication. - `Read`: Implements utilities for reading stream contents and lines. - `Write`: (Not included) Placeholder for future write capabilities. - `Select`: Allows monitoring streams for I/O readiness. - `Inspection`: Inspects stream properties like locality, terminal connection, and lock support. - `Configuration`: Configures stream behavior (timeouts, buffers, chunk size). - `Path`: Resolves file paths through the include path. - `Bucket`: Manages stream bucket brigades for advanced stream filters. - Ensured immutability with the `readonly` keyword. - Each class integrates low-level PHP functions with type-safety and structured API designs. - Added PHPDoc for all methods, outlining expected behavior, parameters, and return values. This update significantly enhances the `Runtime` component with robust native stream handling utilities for diverse use cases. --- src/Stream/Bucket.php | 119 ++++++++ src/Stream/Configuration.php | 154 ++++++++++ src/Stream/Context.php | 176 +++++++++++ src/Stream/Enum/BufferMode.php | 42 +++ src/Stream/Enum/ClientFlag.php | 48 +++ src/Stream/Enum/CryptoClientMethod.php | 132 ++++++++ src/Stream/Enum/CryptoServerMethod.php | 132 ++++++++ src/Stream/Enum/FilterFlag.php | 42 +++ src/Stream/Enum/FilterFlushFlag.php | 42 +++ src/Stream/Enum/FilterStatus.php | 42 +++ src/Stream/Enum/InternalStreamFlag.php | 48 +++ src/Stream/Enum/NotificationCode.php | 84 ++++++ src/Stream/Enum/NotificationSeverity.php | 42 +++ src/Stream/Enum/ReceiveFlag.php | 48 +++ src/Stream/Enum/SendFlag.php | 36 +++ src/Stream/Enum/ServerFlag.php | 36 +++ src/Stream/Enum/ShutdownMode.php | 42 +++ src/Stream/Enum/SocketDomain.php | 42 +++ src/Stream/Enum/SocketProtocol.php | 54 ++++ src/Stream/Enum/SocketType.php | 54 ++++ src/Stream/Enum/WrapperCastMode.php | 36 +++ src/Stream/Enum/WrapperDirectoryFlag.php | 36 +++ src/Stream/Enum/WrapperMetadataOperation.php | 60 ++++ src/Stream/Enum/WrapperOpenFlag.php | 48 +++ src/Stream/Enum/WrapperOption.php | 48 +++ src/Stream/Enum/WrapperRegistrationFlag.php | 36 +++ src/Stream/Enum/WrapperStatFlag.php | 48 +++ src/Stream/Filter.php | 153 ++++++++++ src/Stream/Inspection.php | 95 ++++++ src/Stream/Metadata.php | 70 +++++ src/Stream/Path.php | 50 ++++ src/Stream/Read.php | 89 ++++++ src/Stream/Select.php | 73 +++++ src/Stream/Socket.php | 299 +++++++++++++++++++ src/Stream/Transfer.php | 65 ++++ src/Stream/Wrapper.php | 117 ++++++++ 36 files changed, 2738 insertions(+) create mode 100644 src/Stream/Bucket.php create mode 100644 src/Stream/Configuration.php create mode 100644 src/Stream/Context.php create mode 100644 src/Stream/Enum/BufferMode.php create mode 100644 src/Stream/Enum/ClientFlag.php create mode 100644 src/Stream/Enum/CryptoClientMethod.php create mode 100644 src/Stream/Enum/CryptoServerMethod.php create mode 100644 src/Stream/Enum/FilterFlag.php create mode 100644 src/Stream/Enum/FilterFlushFlag.php create mode 100644 src/Stream/Enum/FilterStatus.php create mode 100644 src/Stream/Enum/InternalStreamFlag.php create mode 100644 src/Stream/Enum/NotificationCode.php create mode 100644 src/Stream/Enum/NotificationSeverity.php create mode 100644 src/Stream/Enum/ReceiveFlag.php create mode 100644 src/Stream/Enum/SendFlag.php create mode 100644 src/Stream/Enum/ServerFlag.php create mode 100644 src/Stream/Enum/ShutdownMode.php create mode 100644 src/Stream/Enum/SocketDomain.php create mode 100644 src/Stream/Enum/SocketProtocol.php create mode 100644 src/Stream/Enum/SocketType.php create mode 100644 src/Stream/Enum/WrapperCastMode.php create mode 100644 src/Stream/Enum/WrapperDirectoryFlag.php create mode 100644 src/Stream/Enum/WrapperMetadataOperation.php create mode 100644 src/Stream/Enum/WrapperOpenFlag.php create mode 100644 src/Stream/Enum/WrapperOption.php create mode 100644 src/Stream/Enum/WrapperRegistrationFlag.php create mode 100644 src/Stream/Enum/WrapperStatFlag.php create mode 100644 src/Stream/Filter.php create mode 100644 src/Stream/Inspection.php create mode 100644 src/Stream/Metadata.php create mode 100644 src/Stream/Path.php create mode 100644 src/Stream/Read.php create mode 100644 src/Stream/Select.php create mode 100644 src/Stream/Socket.php create mode 100644 src/Stream/Transfer.php create mode 100644 src/Stream/Wrapper.php diff --git a/src/Stream/Bucket.php b/src/Stream/Bucket.php new file mode 100644 index 0000000..7ee19d3 --- /dev/null +++ b/src/Stream/Bucket.php @@ -0,0 +1,119 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; +use StreamBucket; + +use function stream_bucket_make_writeable; +use function stream_bucket_new; +use function stream_bucket_append; +use function stream_bucket_prepend; + +/** + * ### PHP Runtime Stream Bucket Utilities + * + * Provides low-level wrappers for managing buckets within PHP stream filter brigades. + * + * Supports creating buckets, retrieving writable buckets, and adding buckets to the beginning or end of a brigade. + * + * This component preserves native PHP stream bucket behavior. + * @since 1.0.0 + */ +final readonly class Bucket extends NativeRuntime { + + /** + * ### Retrieves a writable bucket + * + * Retrieves and removes the next bucket from the specified bucket brigade. + * + * Returns null when no bucket is available. + * @since 1.0.0 + * + * @param resource $brigade

+ * Bucket brigade resource from which a writable bucket will be retrieved. + *

+ * + * @return null|StreamBucket Writable stream bucket, or null when the brigade contains no available buckets. + */ + public static function makeWriteable (mixed $brigade):?StreamBucket { + + return stream_bucket_make_writeable($brigade); + + } + + /** + * ### Creates a new stream bucket + * + * Creates a new bucket containing the specified data and associates it with the provided stream. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource associated with the new bucket. + *

+ * @param string $data

+ * Data to store in the newly created bucket. + *

+ * + * @return StreamBucket Newly created stream bucket. + */ + public static function create (mixed $stream, string $data):StreamBucket { + + return stream_bucket_new($stream, $data); + + } + + /** + * ### Appends a bucket to a brigade + * + * Adds the specified bucket to the end of the provided bucket brigade. + * @since 1.0.0 + * + * @param resource $brigade

+ * Bucket brigade resource to modify. + *

+ * @param StreamBucket $bucket

+ * Stream bucket to append to the brigade. + *

+ * + * @return void + */ + public static function append (mixed $brigade, StreamBucket $bucket):void { + + stream_bucket_append($brigade, $bucket); + + } + + /** + * ### Prepends a bucket to a brigade + * + * Adds the specified bucket to the beginning of the provided bucket brigade. + * @since 1.0.0 + * + * @param resource $brigade

+ * Bucket brigade resource to modify. + *

+ * @param StreamBucket $bucket

+ * Stream bucket to prepend to the brigade. + *

+ * + * @return void + */ + public static function prepend (mixed $brigade, StreamBucket $bucket):void { + + stream_bucket_prepend($brigade, $bucket); + + } + +} \ No newline at end of file diff --git a/src/Stream/Configuration.php b/src/Stream/Configuration.php new file mode 100644 index 0000000..6c9b473 --- /dev/null +++ b/src/Stream/Configuration.php @@ -0,0 +1,154 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_set_blocking; +use function stream_set_timeout; +use function stream_set_read_buffer; +use function stream_set_write_buffer; +use function stream_set_chunk_size; + +/** + * ### PHP Runtime Stream Configuration Utilities + * + * Provides low-level wrappers for configuring native PHP stream behavior. + * + * Supports blocking modes, timeouts, buffering, and chunk sizes while preserving the behavior of the underlying PHP + * functions. + * @since 1.0.0 + */ +final readonly class Configuration extends NativeRuntime { + + /** + * ### Sets the blocking mode of a stream + * + * Enables or disables blocking mode on the specified stream. + * + * In blocking mode, supported operations may wait until data becomes available. In non-blocking mode, operations + * may return without waiting for the requested data. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to configure. + *

+ * @param bool $blocking

+ * True to enable blocking mode, false to enable non-blocking mode. + *

+ * + * @return bool True on success, false on failure. + */ + public static function setBlocking (mixed $stream, bool $blocking):bool { + + return stream_set_blocking($stream, $blocking); + + } + + /** + * ### Sets the timeout of a stream + * + * Configures the timeout for read and write operations on the specified stream. + * + * The timeout is expressed in seconds and microseconds. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to configure. + *

+ * @param int<0, max> $seconds

+ * Timeout duration in seconds. + *

+ * @param int<0, max> $microseconds [optional]

+ * Additional timeout duration in microseconds. + *

+ * + * @return bool True on success, false on failure. + */ + public static function setTimeout (mixed $stream, int $seconds, int $microseconds = 0):bool { + + return stream_set_timeout($stream, $seconds, $microseconds); + + } + + /** + * ### Sets the read buffer size of a stream + * + * Configures the read buffer used by the specified stream. + * + * A buffer size of zero disables read buffering. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to configure. + *

+ * @param int<0, max> $size

+ * Read buffer size in bytes. + *

+ * + * @return int Zero on success, or a nonzero value on failure. + */ + public static function setReadBuffer (mixed $stream, int $size):int { + + return stream_set_read_buffer($stream, $size); + + } + + /** + * ### Sets the write buffer size of a stream + * + * Configures the write buffer used by the specified stream. + * + * A buffer size of zero disables write buffering. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to configure. + *

+ * @param int<0, max> $size

+ * Write buffer size in bytes. + *

+ * + * @return int Zero on success, or a nonzero value on failure. + */ + public static function setWriteBuffer (mixed $stream, int $size):int { + + return stream_set_write_buffer($stream, $size); + + } + + /** + * ### Sets the chunk size of a stream + * + * Changes the chunk size used by the specified stream. + * + * The previous chunk size is returned when the operation succeeds. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to configure. + *

+ * @param positive-int $size

+ * New chunk size in bytes. + *

+ * + * @return int Previous chunk size on success. + */ + public static function setChunkSize (mixed $stream, int $size):int { + + return stream_set_chunk_size($stream, $size); + + } + +} \ No newline at end of file diff --git a/src/Stream/Context.php b/src/Stream/Context.php new file mode 100644 index 0000000..3c4b82d --- /dev/null +++ b/src/Stream/Context.php @@ -0,0 +1,176 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.3 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_context_create; +use function stream_context_get_default; +use function stream_context_get_options; +use function stream_context_get_params; +use function stream_context_set_default; +use function stream_context_set_options; +use function stream_context_set_params; + +/** + * ### PHP Runtime Stream Context Utilities + * + * Provides low-level wrappers for creating, retrieving, and configuring PHP stream contexts. + * + * Stream contexts define options and parameters used by stream wrappers when opening or operating on streams. + * + * This class preserves native PHP stream context behavior. + * @since 1.0.0 + */ +final readonly class Context extends NativeRuntime { + + /** + * ### Creates a stream context + * + * Creates a stream context with the specified options and parameters. + * @since 1.0.0 + * + * @param array> $options [optional]

+ * Associative array of wrapper-specific context options. + *

+ * @param array $params [optional]

+ * Associative array of context parameters. + *

+ * + * @return resource Stream context resource. + */ + public static function create (array $options = [], array $params = []):mixed { + + return stream_context_create($options, $params); + + } + + /** + * ### Gets the default stream context + * + * Returns the default stream context, optionally updating its options. + * @since 1.0.0 + * + * @param array> $options [optional]

+ * Context options to apply to the default context. + *

+ * + * @return resource Default stream context resource. + */ + public static function getDefault (array $options = []):mixed { + + return stream_context_get_default($options); + + } + + /** + * ### Gets stream context options + * + * Returns the options configured for the specified stream or context. + * @since 1.0.0 + * + * @param resource $context

+ * Stream or stream context resource. + *

+ * + * @return array> Stream context options. + */ + public static function getOptions (mixed $context):array { + + /** @var array> */ + return stream_context_get_options($context); + + } + + /** + * ### Gets stream context parameters + * + * Returns the parameters and options associated with a stream or stream context. + * @since 1.0.0 + * + * @param resource $context

+ * Stream or stream context resource. + *

+ * + * @return array Stream context parameters. + */ + public static function getParams (mixed $context):array { + + return stream_context_get_params($context); + + } + + /** + * ### Sets the default stream context + * + * Updates the default stream context using the specified options. + * + * The changes affect later operations that use the default stream context. + * @since 1.0.0 + * + * @param array> $options

+ * Wrapper-specific context options. + *

+ * + * @return resource Default stream context resource. + */ + public static function setDefault (array $options):mixed { + + return stream_context_set_default($options); + + } + + /** + * ### Sets a stream context option + * + * Configures an option for the specified stream context. + * @since 1.0.0 + * + * @param resource $context

+ * Stream or stream context resource. + *

+ * @param array> $options

+ * Associative array of context options. + *

+ * + * @return true Always returns true. + */ + public static function setOptions (mixed $context, array $options):true { + + return stream_context_set_options($context, $options); + + } + + /** + * ### Sets stream context parameters + * + * Updates the parameters associated with the specified stream context. + * @since 1.0.0 + * + * @param resource $context

+ * Stream or stream context resource. + *

+ * @param array $params

+ * Context parameters to apply. + *

+ * + * @return true Always returns true. + */ + public static function setParams (mixed $context, array $params):true { + + return stream_context_set_params($context, $params); + + } + +} \ No newline at end of file diff --git a/src/Stream/Enum/BufferMode.php b/src/Stream/Enum/BufferMode.php new file mode 100644 index 0000000..2c2a5c3 --- /dev/null +++ b/src/Stream/Enum/BufferMode.php @@ -0,0 +1,42 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Buffer Mode + * + * Defines native PHP stream constants for buffermode operations. + * @since 1.0.0 + */ +enum BufferMode:int { + + /** + * ### Disables buffering. + * @since 1.0.0 + */ + case NONE = STREAM_BUFFER_NONE; + + /** + * ### Enables line buffering. + * @since 1.0.0 + */ + case LINE = STREAM_BUFFER_LINE; + + /** + * ### Enables full buffering. + * @since 1.0.0 + */ + case FULL = STREAM_BUFFER_FULL; + +} diff --git a/src/Stream/Enum/ClientFlag.php b/src/Stream/Enum/ClientFlag.php new file mode 100644 index 0000000..450017f --- /dev/null +++ b/src/Stream/Enum/ClientFlag.php @@ -0,0 +1,48 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Client Flag + * + * Defines native PHP stream constants for clientflag operations. + * @since 1.0.0 + */ +enum ClientFlag:int { + + /** + * ### Establishes a client socket connection. + * @since 1.0.0 + */ + case CONNECT = STREAM_CLIENT_CONNECT; + + /** + * ### Initiates a non-blocking client socket connection. + * @since 1.0.0 + */ + case ASYNC_CONNECT = STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT; + + /** + * ### Establishes a persistent client socket connection. + * @since 1.0.0 + */ + case PERSISTENT_CONNECT = STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT; + + /** + * ### Initiates a persistent non-blocking client socket connection. + * @since 1.0.0 + */ + case ASYNC_PERSISTENT_CONNECT = STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT | STREAM_CLIENT_PERSISTENT; + +} diff --git a/src/Stream/Enum/CryptoClientMethod.php b/src/Stream/Enum/CryptoClientMethod.php new file mode 100644 index 0000000..c49319e --- /dev/null +++ b/src/Stream/Enum/CryptoClientMethod.php @@ -0,0 +1,132 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Crypto Client Method + * + * Defines native PHP stream constants for cryptoclientmethod operations. + * @since 1.0.0 + */ +enum CryptoClientMethod:int { + + /** + * ### Enables the ANY cryptographic method for client streams. + * @since 1.0.0 + */ + case ANY = STREAM_CRYPTO_METHOD_ANY_CLIENT; + + /** + * ### Enables the SSLv2 cryptographic method for client streams. + * @since 1.0.0 + */ + case SSLV2 = STREAM_CRYPTO_METHOD_SSLv2_CLIENT; + + /** + * ### Enables the SSLv3 cryptographic method for client streams. + * @since 1.0.0 + */ + case SSLV3 = STREAM_CRYPTO_METHOD_SSLv3_CLIENT; + + /** + * ### Enables the SSLv23 cryptographic method for client streams. + * @since 1.0.0 + */ + case SSLV23 = STREAM_CRYPTO_METHOD_SSLv23_CLIENT; + + /** + * ### Enables the TLS cryptographic method for client streams. + * @since 1.0.0 + */ + case TLS = STREAM_CRYPTO_METHOD_TLS_CLIENT; + + /** + * ### Enables the TLSv1_0 cryptographic method for client streams. + * @since 1.0.0 + */ + case TLSV1_0 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT; + + /** + * ### Enables the TLSv1_1 cryptographic method for client streams. + * @since 1.0.0 + */ + case TLSV1_1 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + + /** + * ### Enables the TLSv1_2 cryptographic method for client streams. + * @since 1.0.0 + */ + case TLSV1_2 = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + + /** + * ### Enables the TLSv1_3 cryptographic method for client streams. + * @since 1.0.0 + */ + case TLSV1_3 = STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; + + /** + * ### Allows TLS versions 1.0, 1.1 for client streams. + * @since 1.0.0 + */ + case TLS_10_11 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + + /** + * ### Allows TLS versions 1.0, 1.2 for client streams. + * @since 1.0.0 + */ + case TLS_10_12 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + + /** + * ### Allows TLS versions 1.0, 1.3 for client streams. + * @since 1.0.0 + */ + case TLS_10_13 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; + + /** + * ### Allows TLS versions 1.1, 1.2 for client streams. + * @since 1.0.0 + */ + case TLS_11_12 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + + /** + * ### Allows TLS versions 1.1, 1.3 for client streams. + * @since 1.0.0 + */ + case TLS_11_13 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; + + /** + * ### Allows TLS versions 1.2, 1.3 for client streams. + * @since 1.0.0 + */ + case TLS_12_13 = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; + + /** + * ### Allows TLS versions 1.0, 1.1, 1.3 for client streams. + * @since 1.0.0 + */ + case TLS_10_11_13 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; + + /** + * ### Allows TLS versions 1.0, 1.2, 1.3 for client streams. + * @since 1.0.0 + */ + case TLS_10_12_13 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; + + /** + * ### Allows TLS versions 1.1, 1.2, 1.3 for client streams. + * @since 1.0.0 + */ + case TLS_11_12_13 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; + +} diff --git a/src/Stream/Enum/CryptoServerMethod.php b/src/Stream/Enum/CryptoServerMethod.php new file mode 100644 index 0000000..b69df45 --- /dev/null +++ b/src/Stream/Enum/CryptoServerMethod.php @@ -0,0 +1,132 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Crypto Server Method + * + * Defines native PHP stream constants for cryptoservermethod operations. + * @since 1.0.0 + */ +enum CryptoServerMethod:int { + + /** + * ### Enables the ANY cryptographic method for server streams. + * @since 1.0.0 + */ + case ANY = STREAM_CRYPTO_METHOD_ANY_SERVER; + + /** + * ### Enables the SSLv2 cryptographic method for server streams. + * @since 1.0.0 + */ + case SSLV2 = STREAM_CRYPTO_METHOD_SSLv2_SERVER; + + /** + * ### Enables the SSLv3 cryptographic method for server streams. + * @since 1.0.0 + */ + case SSLV3 = STREAM_CRYPTO_METHOD_SSLv3_SERVER; + + /** + * ### Enables the TLS cryptographic method for server streams. + * @since 1.0.0 + */ + case TLS = STREAM_CRYPTO_METHOD_TLS_SERVER; + + /** + * ### Enables the TLSv1_0 cryptographic method for server streams. + * @since 1.0.0 + */ + case TLSV1_0 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER; + + /** + * ### Enables the TLSv1_1 cryptographic method for server streams. + * @since 1.0.0 + */ + case TLSV1_1 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER; + + /** + * ### Enables the TLSv1_2 cryptographic method for server streams. + * @since 1.0.0 + */ + case TLSV1_2 = STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; + + /** + * ### Enables the TLSv1_3 cryptographic method for server streams. + * @since 1.0.0 + */ + case TLSV1_3 = STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; + + /** + * ### Allows TLS versions 1.0, 1.1 for server streams. + * @since 1.0.0 + */ + case TLS_10_11 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_1_SERVER; + + /** + * ### Allows TLS versions 1.0, 1.2 for server streams. + * @since 1.0.0 + */ + case TLS_10_12 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; + + /** + * ### Allows TLS versions 1.0, 1.3 for server streams. + * @since 1.0.0 + */ + case TLS_10_13 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; + + /** + * ### Allows TLS versions 1.1, 1.2 for server streams. + * @since 1.0.0 + */ + case TLS_11_12 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; + + /** + * ### Allows TLS versions 1.1, 1.3 for server streams. + * @since 1.0.0 + */ + case TLS_11_13 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; + + /** + * ### Allows TLS versions 1.2, 1.3 for server streams. + * @since 1.0.0 + */ + case TLS_12_13 = STREAM_CRYPTO_METHOD_TLSv1_2_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; + + /** + * ### Allows TLS versions 1.0, 1.1, 1.2 for server streams. + * @since 1.0.0 + */ + case TLS_10_11_12 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; + + /** + * ### Allows TLS versions 1.0, 1.1, 1.3 for server streams. + * @since 1.0.0 + */ + case TLS_10_11_13 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; + + /** + * ### Allows TLS versions 1.0, 1.2, 1.3 for server streams. + * @since 1.0.0 + */ + case TLS_10_12_13 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; + + /** + * ### Allows TLS versions 1.1, 1.2, 1.3 for server streams. + * @since 1.0.0 + */ + case TLS_11_12_13 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; + +} diff --git a/src/Stream/Enum/FilterFlag.php b/src/Stream/Enum/FilterFlag.php new file mode 100644 index 0000000..c45c662 --- /dev/null +++ b/src/Stream/Enum/FilterFlag.php @@ -0,0 +1,42 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Filter Flag + * + * Defines native PHP stream constants for filterflag operations. + * @since 1.0.0 + */ +enum FilterFlag:int { + + /** + * ### Applies a stream filter during reading. + * @since 1.0.0 + */ + case READ = STREAM_FILTER_READ; + + /** + * ### Applies a stream filter during writing. + * @since 1.0.0 + */ + case WRITE = STREAM_FILTER_WRITE; + + /** + * ### Applies a stream filter during reading and writing. + * @since 1.0.0 + */ + case READ_WRITE = STREAM_FILTER_ALL; + +} diff --git a/src/Stream/Enum/FilterFlushFlag.php b/src/Stream/Enum/FilterFlushFlag.php new file mode 100644 index 0000000..84c265f --- /dev/null +++ b/src/Stream/Enum/FilterFlushFlag.php @@ -0,0 +1,42 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Filter Flush Flag + * + * Defines native PHP stream constants for filterflushflag operations. + * @since 1.0.0 + */ +enum FilterFlushFlag:int { + + /** + * ### Indicates normal filter processing. + * @since 1.0.0 + */ + case NORMAL = PSFS_FLAG_NORMAL; + + /** + * ### Indicates an incremental filter flush. + * @since 1.0.0 + */ + case INCREMENTAL = PSFS_FLAG_FLUSH_INC; + + /** + * ### Indicates the final flush before closing. + * @since 1.0.0 + */ + case CLOSE = PSFS_FLAG_FLUSH_CLOSE; + +} diff --git a/src/Stream/Enum/FilterStatus.php b/src/Stream/Enum/FilterStatus.php new file mode 100644 index 0000000..ea4b12c --- /dev/null +++ b/src/Stream/Enum/FilterStatus.php @@ -0,0 +1,42 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Filter Status + * + * Defines native PHP stream constants for filterstatus operations. + * @since 1.0.0 + */ +enum FilterStatus:int { + + /** + * ### Passes produced buckets to the next stream filter. + * @since 1.0.0 + */ + case PASS_ON = PSFS_PASS_ON; + + /** + * ### Requests more input before producing output. + * @since 1.0.0 + */ + case FEED_ME = PSFS_FEED_ME; + + /** + * ### Reports an unrecoverable filter error. + * @since 1.0.0 + */ + case ERROR_FATAL = PSFS_ERR_FATAL; + +} diff --git a/src/Stream/Enum/InternalStreamFlag.php b/src/Stream/Enum/InternalStreamFlag.php new file mode 100644 index 0000000..8cab3a8 --- /dev/null +++ b/src/Stream/Enum/InternalStreamFlag.php @@ -0,0 +1,48 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Internal Stream Flag + * + * Defines native PHP stream constants for internalstreamflag operations. + * @since 1.0.0 + */ +enum InternalStreamFlag:int { + + /** + * ### Specifies no internal stream flags. + * @since 1.0.0 + */ + case NONE = 0; + + /** + * ### Disables plugin URL wrappers. + * @since 1.0.0 + */ + case IGNORE_URL = STREAM_IGNORE_URL; + + /** + * ### Requires a seekable stream. + * @since 1.0.0 + */ + case MUST_SEEK = STREAM_MUST_SEEK; + + /** + * ### Disables URL wrappers and requires a seekable stream. + * @since 1.0.0 + */ + case IGNORE_URL_MUST_SEEK = STREAM_IGNORE_URL | STREAM_MUST_SEEK; + +} diff --git a/src/Stream/Enum/NotificationCode.php b/src/Stream/Enum/NotificationCode.php new file mode 100644 index 0000000..1cac77e --- /dev/null +++ b/src/Stream/Enum/NotificationCode.php @@ -0,0 +1,84 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Notification Code + * + * Defines native PHP stream constants for notificationcode operations. + * @since 1.0.0 + */ +enum NotificationCode:int { + + /** + * ### Reports remote address resolution. + * @since 1.0.0 + */ + case RESOLVE = STREAM_NOTIFY_RESOLVE; + + /** + * ### Reports that a connection has been established. + * @since 1.0.0 + */ + case CONNECT = STREAM_NOTIFY_CONNECT; + + /** + * ### Reports that authentication is required. + * @since 1.0.0 + */ + case AUTH_REQUIRED = STREAM_NOTIFY_AUTH_REQUIRED; + + /** + * ### Reports the detected MIME type. + * @since 1.0.0 + */ + case MIME_TYPE_IS = STREAM_NOTIFY_MIME_TYPE_IS; + + /** + * ### Reports the detected resource size. + * @since 1.0.0 + */ + case FILE_SIZE_IS = STREAM_NOTIFY_FILE_SIZE_IS; + + /** + * ### Reports redirection to another resource. + * @since 1.0.0 + */ + case REDIRECTED = STREAM_NOTIFY_REDIRECTED; + + /** + * ### Reports stream transfer progress. + * @since 1.0.0 + */ + case PROGRESS = STREAM_NOTIFY_PROGRESS; + + /** + * ### Reports that the stream has completed. + * @since 1.0.0 + */ + case COMPLETED = STREAM_NOTIFY_COMPLETED; + + /** + * ### Reports a stream operation failure. + * @since 1.0.0 + */ + case FAILURE = STREAM_NOTIFY_FAILURE; + + /** + * ### Reports the result of authentication. + * @since 1.0.0 + */ + case AUTH_RESULT = STREAM_NOTIFY_AUTH_RESULT; + +} diff --git a/src/Stream/Enum/NotificationSeverity.php b/src/Stream/Enum/NotificationSeverity.php new file mode 100644 index 0000000..5868078 --- /dev/null +++ b/src/Stream/Enum/NotificationSeverity.php @@ -0,0 +1,42 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Notification Severity + * + * Defines native PHP stream constants for notificationseverity operations. + * @since 1.0.0 + */ +enum NotificationSeverity:int { + + /** + * ### Reports an informational notification. + * @since 1.0.0 + */ + case INFO = STREAM_NOTIFY_SEVERITY_INFO; + + /** + * ### Reports a noncritical warning. + * @since 1.0.0 + */ + case WARNING = STREAM_NOTIFY_SEVERITY_WARN; + + /** + * ### Reports a critical error. + * @since 1.0.0 + */ + case ERROR = STREAM_NOTIFY_SEVERITY_ERR; + +} diff --git a/src/Stream/Enum/ReceiveFlag.php b/src/Stream/Enum/ReceiveFlag.php new file mode 100644 index 0000000..c63e989 --- /dev/null +++ b/src/Stream/Enum/ReceiveFlag.php @@ -0,0 +1,48 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Receive Flag + * + * Defines native PHP stream constants for receiveflag operations. + * @since 1.0.0 + */ +enum ReceiveFlag:int { + + /** + * ### Receives socket data without additional flags. + * @since 1.0.0 + */ + case NONE = 0; + + /** + * ### Receives out-of-band socket data. + * @since 1.0.0 + */ + case OUT_OF_BAND = STREAM_OOB; + + /** + * ### Reads socket data without consuming it. + * @since 1.0.0 + */ + case PEEK = STREAM_PEEK; + + /** + * ### Peeks at out-of-band socket data. + * @since 1.0.0 + */ + case OUT_OF_BAND_PEEK = STREAM_OOB | STREAM_PEEK; + +} diff --git a/src/Stream/Enum/SendFlag.php b/src/Stream/Enum/SendFlag.php new file mode 100644 index 0000000..d59956b --- /dev/null +++ b/src/Stream/Enum/SendFlag.php @@ -0,0 +1,36 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Send Flag + * + * Defines native PHP stream constants for sendflag operations. + * @since 1.0.0 + */ +enum SendFlag:int { + + /** + * ### Sends socket data without additional flags. + * @since 1.0.0 + */ + case NONE = 0; + + /** + * ### Sends out-of-band socket data. + * @since 1.0.0 + */ + case OUT_OF_BAND = STREAM_OOB; + +} diff --git a/src/Stream/Enum/ServerFlag.php b/src/Stream/Enum/ServerFlag.php new file mode 100644 index 0000000..13e7272 --- /dev/null +++ b/src/Stream/Enum/ServerFlag.php @@ -0,0 +1,36 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Server Flag + * + * Defines native PHP stream constants for serverflag operations. + * @since 1.0.0 + */ +enum ServerFlag:int { + + /** + * ### Binds a server socket without listening. + * @since 1.0.0 + */ + case BIND = STREAM_SERVER_BIND; + + /** + * ### Binds and listens on a connection-oriented server socket. + * @since 1.0.0 + */ + case BIND_LISTEN = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; + +} diff --git a/src/Stream/Enum/ShutdownMode.php b/src/Stream/Enum/ShutdownMode.php new file mode 100644 index 0000000..ba5542f --- /dev/null +++ b/src/Stream/Enum/ShutdownMode.php @@ -0,0 +1,42 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Shutdown Mode + * + * Defines native PHP stream constants for shutdownmode operations. + * @since 1.0.0 + */ +enum ShutdownMode:int { + + /** + * ### Disables further reception of data. + * @since 1.0.0 + */ + case READ = STREAM_SHUT_RD; + + /** + * ### Disables further transmission of data. + * @since 1.0.0 + */ + case WRITE = STREAM_SHUT_WR; + + /** + * ### Disables further reception and transmission of data. + * @since 1.0.0 + */ + case READ_WRITE = STREAM_SHUT_RDWR; + +} diff --git a/src/Stream/Enum/SocketDomain.php b/src/Stream/Enum/SocketDomain.php new file mode 100644 index 0000000..29d1283 --- /dev/null +++ b/src/Stream/Enum/SocketDomain.php @@ -0,0 +1,42 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Socket Domain + * + * Defines native PHP stream constants for socketdomain operations. + * @since 1.0.0 + */ +enum SocketDomain:int { + + /** + * ### Uses the IPv4 protocol family. + * @since 1.0.0 + */ + case IPV4 = STREAM_PF_INET; + + /** + * ### Uses the IPv6 protocol family. + * @since 1.0.0 + */ + case IPV6 = STREAM_PF_INET6; + + /** + * ### Uses the Unix domain socket protocol family. + * @since 1.0.0 + */ + case UNIX = STREAM_PF_UNIX; + +} diff --git a/src/Stream/Enum/SocketProtocol.php b/src/Stream/Enum/SocketProtocol.php new file mode 100644 index 0000000..38b29f1 --- /dev/null +++ b/src/Stream/Enum/SocketProtocol.php @@ -0,0 +1,54 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Socket Protocol + * + * Defines native PHP stream constants for socketprotocol operations. + * @since 1.0.0 + */ +enum SocketProtocol:int { + + /** + * ### Uses the Internet Protocol. + * @since 1.0.0 + */ + case IP = STREAM_IPPROTO_IP; + + /** + * ### Uses the Internet Control Message Protocol. + * @since 1.0.0 + */ + case ICMP = STREAM_IPPROTO_ICMP; + + /** + * ### Uses raw IP packets. + * @since 1.0.0 + */ + case RAW = STREAM_IPPROTO_RAW; + + /** + * ### Uses the Transmission Control Protocol. + * @since 1.0.0 + */ + case TCP = STREAM_IPPROTO_TCP; + + /** + * ### Uses the User Datagram Protocol. + * @since 1.0.0 + */ + case UDP = STREAM_IPPROTO_UDP; + +} diff --git a/src/Stream/Enum/SocketType.php b/src/Stream/Enum/SocketType.php new file mode 100644 index 0000000..363b7de --- /dev/null +++ b/src/Stream/Enum/SocketType.php @@ -0,0 +1,54 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Socket Type + * + * Defines native PHP stream constants for sockettype operations. + * @since 1.0.0 + */ +enum SocketType:int { + + /** + * ### Provides a sequenced, reliable, bidirectional byte stream. + * @since 1.0.0 + */ + case STREAM = STREAM_SOCK_STREAM; + + /** + * ### Provides connectionless datagram messages. + * @since 1.0.0 + */ + case DATAGRAM = STREAM_SOCK_DGRAM; + + /** + * ### Provides access to raw network protocols. + * @since 1.0.0 + */ + case RAW = STREAM_SOCK_RAW; + + /** + * ### Provides reliably delivered datagram messages. + * @since 1.0.0 + */ + case RELIABLE_DATAGRAM = STREAM_SOCK_RDM; + + /** + * ### Provides a sequenced packet socket. + * @since 1.0.0 + */ + case SEQUENCED_PACKET = STREAM_SOCK_SEQPACKET; + +} diff --git a/src/Stream/Enum/WrapperCastMode.php b/src/Stream/Enum/WrapperCastMode.php new file mode 100644 index 0000000..82e4cc5 --- /dev/null +++ b/src/Stream/Enum/WrapperCastMode.php @@ -0,0 +1,36 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Wrapper Cast Mode + * + * Defines native PHP stream constants for wrappercastmode operations. + * @since 1.0.0 + */ +enum WrapperCastMode:int { + + /** + * ### Casts a wrapper stream for general use. + * @since 1.0.0 + */ + case AS_STREAM = STREAM_CAST_AS_STREAM; + + /** + * ### Casts a wrapper stream for stream selection. + * @since 1.0.0 + */ + case FOR_SELECT = STREAM_CAST_FOR_SELECT; + +} diff --git a/src/Stream/Enum/WrapperDirectoryFlag.php b/src/Stream/Enum/WrapperDirectoryFlag.php new file mode 100644 index 0000000..b209e58 --- /dev/null +++ b/src/Stream/Enum/WrapperDirectoryFlag.php @@ -0,0 +1,36 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Wrapper Directory Flag + * + * Defines native PHP stream constants for wrapperdirectoryflag operations. + * @since 1.0.0 + */ +enum WrapperDirectoryFlag:int { + + /** + * ### Creates or removes a directory without recursion. + * @since 1.0.0 + */ + case NONE = 0; + + /** + * ### Requests recursive directory handling. + * @since 1.0.0 + */ + case RECURSIVE = STREAM_MKDIR_RECURSIVE; + +} diff --git a/src/Stream/Enum/WrapperMetadataOperation.php b/src/Stream/Enum/WrapperMetadataOperation.php new file mode 100644 index 0000000..e15b6cd --- /dev/null +++ b/src/Stream/Enum/WrapperMetadataOperation.php @@ -0,0 +1,60 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Wrapper Metadata Operation + * + * Defines native PHP stream constants for wrappermetadataoperation operations. + * @since 1.0.0 + */ +enum WrapperMetadataOperation:int { + + /** + * ### Updates timestamps for a stream resource. + * @since 1.0.0 + */ + case TOUCH = STREAM_META_TOUCH; + + /** + * ### Changes the numeric owner of a stream resource. + * @since 1.0.0 + */ + case OWNER = STREAM_META_OWNER; + + /** + * ### Changes the owner by name. + * @since 1.0.0 + */ + case OWNER_NAME = STREAM_META_OWNER_NAME; + + /** + * ### Changes the numeric group of a stream resource. + * @since 1.0.0 + */ + case GROUP = STREAM_META_GROUP; + + /** + * ### Changes the group by name. + * @since 1.0.0 + */ + case GROUP_NAME = STREAM_META_GROUP_NAME; + + /** + * ### Changes permissions on a stream resource. + * @since 1.0.0 + */ + case ACCESS = STREAM_META_ACCESS; + +} diff --git a/src/Stream/Enum/WrapperOpenFlag.php b/src/Stream/Enum/WrapperOpenFlag.php new file mode 100644 index 0000000..66b0adc --- /dev/null +++ b/src/Stream/Enum/WrapperOpenFlag.php @@ -0,0 +1,48 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8..1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Wrapper Open Flag + * + * Defines native PHP stream constants for wrapperopenflag operations. + * @since 1.0.0 + */ +enum WrapperOpenFlag:int { + + /** + * ### Opens a wrapper resource without additional flags. + * @since 1.0.0 + */ + case NONE = 0; + + /** + * ### Uses the configured include path. + * @since 1.0.0 + */ + case USE_PATH = STREAM_USE_PATH; + + /** + * ### Requests reporting of wrapper errors. + * @since 1.0.0 + */ + case REPORT_ERRORS = STREAM_REPORT_ERRORS; + + /** + * ### Uses the include path and requests error reporting. + * @since 1.0.0 + */ + case USE_PATH_REPORT_ERRORS = STREAM_USE_PATH | STREAM_REPORT_ERRORS; + +} diff --git a/src/Stream/Enum/WrapperOption.php b/src/Stream/Enum/WrapperOption.php new file mode 100644 index 0000000..322c212 --- /dev/null +++ b/src/Stream/Enum/WrapperOption.php @@ -0,0 +1,48 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Wrapper Option + * + * Defines native PHP stream constants for wrapperoption operations. + * @since 1.0.0 + */ +enum WrapperOption:int { + + /** + * ### Changes the stream blocking mode. + * @since 1.0.0 + */ + case BLOCKING = STREAM_OPTION_BLOCKING; + + /** + * ### Changes the stream read buffer. + * @since 1.0.0 + */ + case READ_BUFFER = STREAM_OPTION_READ_BUFFER; + + /** + * ### Changes the stream write buffer. + * @since 1.0.0 + */ + case WRITE_BUFFER = STREAM_OPTION_WRITE_BUFFER; + + /** + * ### Changes the stream read timeout. + * @since 1.0.0 + */ + case READ_TIMEOUT = STREAM_OPTION_READ_TIMEOUT; + +} diff --git a/src/Stream/Enum/WrapperRegistrationFlag.php b/src/Stream/Enum/WrapperRegistrationFlag.php new file mode 100644 index 0000000..8189a62 --- /dev/null +++ b/src/Stream/Enum/WrapperRegistrationFlag.php @@ -0,0 +1,36 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Wrapper Registration Flag + * + * Defines native PHP stream constants for wrapperregistrationflag operations. + * @since 1.0.0 + */ +enum WrapperRegistrationFlag:int { + + /** + * ### Registers a stream wrapper without URL semantics. + * @since 1.0.0 + */ + case NONE = 0; + + /** + * ### Registers the wrapper as a URL-aware protocol. + * @since 1.0.0 + */ + case IS_URL = STREAM_IS_URL; + +} diff --git a/src/Stream/Enum/WrapperStatFlag.php b/src/Stream/Enum/WrapperStatFlag.php new file mode 100644 index 0000000..ad8475c --- /dev/null +++ b/src/Stream/Enum/WrapperStatFlag.php @@ -0,0 +1,48 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.1 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream\Enum; + +/** + * ### Wrapper Stat Flag + * + * Defines native PHP stream constants for wrapperstatflag operations. + * @since 1.0.0 + */ +enum WrapperStatFlag:int { + + /** + * ### Requests resource statistics without additional flags. + * @since 1.0.0 + */ + case NONE = 0; + + /** + * ### Requests information about a symbolic link itself. + * @since 1.0.0 + */ + case LINK = STREAM_URL_STAT_LINK; + + /** + * ### Suppresses error reporting during stat operations. + * @since 1.0.0 + */ + case QUIET = STREAM_URL_STAT_QUIET; + + /** + * ### Requests link statistics without error reporting. + * @since 1.0.0 + */ + case LINK_QUIET = STREAM_URL_STAT_LINK | STREAM_URL_STAT_QUIET; + +} diff --git a/src/Stream/Filter.php b/src/Stream/Filter.php new file mode 100644 index 0000000..90fd3cc --- /dev/null +++ b/src/Stream/Filter.php @@ -0,0 +1,153 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; +use FireHub\Runtime\Stream\Enum\FilterFlag; + +use function stream_filter_append; +use function stream_filter_prepend; +use function stream_filter_remove; +use function stream_get_filters; +use function stream_filter_register; + +/** + * ### PHP Runtime Stream Filter Utilities + * + * Provides low-level wrappers for managing PHP stream filters. + * + * Stream filters allow data to be processed while reading from or writing to a stream. Filters can transform, + * encode, decode, or otherwise modify data passing through a stream. + * + * This component preserves native PHP stream filter behavior. + * @since 1.0.0 + */ +final readonly class Filter extends NativeRuntime { + + /** + * ### Appends a filter to a stream + * + * Adds a filter to the end of the specified stream's filter chain. + * + * The filter processes data when the stream is read from or written to, depending on the specified read/write mode. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to which the filter will be attached. + *

+ * @param string $filter_name

+ * Name of the filter to append. + *

+ * @param \FireHub\Runtime\Stream\Enum\FilterFlag $flag [optional]

+ * Read and write filter modes. + *

+ * @param mixed $params [optional]

+ * Optional filter parameters. + *

+ * + * @return resource|false Filter resource on success, false on failure. + */ + public static function append (mixed $stream, string $filter_name, FilterFlag $flag = FilterFlag::READ_WRITE, mixed $params = null):mixed { + + return stream_filter_append($stream, $filter_name, $flag->value, $params); + + } + + /** + * ### Prepends a filter to a stream + * + * Adds a filter to the beginning of the specified stream's filter chain. + * + * The filter processes data before filters are already attached to the same filter chain. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to which the filter will be attached. + *

+ * @param string $filter_name

+ * Name of the filter to prepend. + *

+ * @param \FireHub\Runtime\Stream\Enum\FilterFlag $flag [optional]

+ * Read and write filter modes. + *

+ * @param mixed $params [optional]

+ * Optional filter parameters. + *

+ * + * @return resource|false Filter resource on success, false on failure. + */ + public static function prepend (mixed $stream, string $filter_name, FilterFlag $flag, mixed $params = null):mixed { + + return stream_filter_prepend($stream, $filter_name, $flag->value, $params); + + } + + /** + * ### Removes a filter from a stream + * + * Removes a previously attached filter from its stream. + * + * Any buffered data remaining in the filter may be flushed before the filter is removed. + * @since 1.0.0 + * + * @param resource $filter

+ * Filter resource returned by append() or prepend(). + *

+ * + * @return bool True on success, false on failure. + */ + public static function remove (mixed $filter):bool { + + return stream_filter_remove($filter); + + } + + /** + * ### Gets registered stream filters + * + * Returns the names of all stream filters registered in the current PHP environment. + * @since 1.0.0 + * + * @return list Registered stream filter names. + */ + public static function get ():array { + + return stream_get_filters(); + + } + + /** + * ### Registers a user-defined stream filter + * + * Registers a custom stream filter under the specified name. + * + * The filter class must extend the native PHP php_user_filter class. + * @since 1.0.0 + * + * @param string $filter_name

+ * Name under which the filter will be registered. + *

+ * @param class-string<\php_user_filter> $class

+ * Fully qualified name of the filter implementation class. + *

+ * + * @return bool True on success, false on failure. + */ + public static function register (string $filter_name, string $class):bool { + + return stream_filter_register($filter_name, $class); + + } + +} \ No newline at end of file diff --git a/src/Stream/Inspection.php b/src/Stream/Inspection.php new file mode 100644 index 0000000..9051b5f --- /dev/null +++ b/src/Stream/Inspection.php @@ -0,0 +1,95 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_is_local; +use function stream_isatty; +use function stream_supports_lock; + +/** + * ### PHP Runtime Stream Inspection Utilities + * + * Provides low-level wrappers for inspecting native PHP stream properties. + * + * Supports checking whether a stream is local, connected to a terminal, or capable of supporting file locking. + * + * This component preserves native PHP stream inspection behavior. + * @since 1.0.0 + */ +final readonly class Inspection extends NativeRuntime { + + /** + * ### Checks whether a stream is local + * + * Determines whether the specified stream resource or URL refers to a local stream. + * + * Locality is determined by the underlying PHP stream wrapper. + * @since 1.0.0 + * + * @param resource|string $stream

+ * Stream resource or URL to inspect. + *

+ * + * @return bool True if the stream is local, false otherwise. + */ + public static function isLocal (mixed $stream):bool { + + return stream_is_local($stream); + + } + + /** + * ### Checks whether a stream is connected to a terminal + * + * Determines whether the specified stream resource is associated with an interactive terminal. + * + * This operation is equivalent to the native PHP stream_isatty() function. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to inspect. + *

+ * + * @return bool True if the stream is connected to a terminal, false otherwise. + */ + public static function isATty (mixed $stream):bool { + + return stream_isatty($stream); + + } + + /** + * ### Checks whether a stream supports locking + * + * Determines whether the specified stream resource supports file locking through the underlying stream + * implementation. + * + * Support for locking does not guarantee that a particular lock acquisition will succeed. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource to inspect. + *

+ * + * @return bool True if the stream supports locking, false otherwise. + */ + public static function supportsLock (mixed $stream):bool { + + return stream_supports_lock($stream); + + } + +} \ No newline at end of file diff --git a/src/Stream/Metadata.php b/src/Stream/Metadata.php new file mode 100644 index 0000000..0cdde71 --- /dev/null +++ b/src/Stream/Metadata.php @@ -0,0 +1,70 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_get_meta_data; +use function stream_get_transports; + +/** + * ### PHP Runtime Stream Metadata Utilities + * + * Provides low-level wrappers for retrieving native PHP stream metadata and available stream transport protocols. + * + * This component preserves native PHP stream metadata behavior. + * @since 1.0.0 + */ +final readonly class Metadata extends NativeRuntime { + + /** + * ### Gets stream metadata + * + * Retrieves metadata associated with the specified stream resource. + * + * The returned information may include the stream's access mode, blocking status, timeout status, end-of-file + * status, URI, wrapper type, stream type, and seekability. + * + * Available metadata entries depend on the underlying stream. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource from which metadata will be retrieved. + *

+ * + * @return array Associative array containing stream metadata. + */ + public static function get (mixed $stream):array { + + return stream_get_meta_data($stream); + + } + + /** + * ### Gets available stream transports + * + * Returns the names of all socket transport protocols supported by the current PHP environment. + * + * Available transport depends on the operating system and installed PHP extensions. + * @since 1.0.0 + * + * @return list Available stream transport protocol names. + */ + public static function transports ():array { + + return stream_get_transports(); + + } + +} \ No newline at end of file diff --git a/src/Stream/Path.php b/src/Stream/Path.php new file mode 100644 index 0000000..509bae1 --- /dev/null +++ b/src/Stream/Path.php @@ -0,0 +1,50 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_resolve_include_path; + +/** + * ### PHP Runtime Stream Path Utilities + * + * Provides low-level wrappers for resolving file paths using the configured PHP include path. + * + * This component preserves native PHP stream path resolution behavior. + * @since 1.0.0 + */ +final readonly class Path extends NativeRuntime { + + /** + * ### Resolves a file path + * + * Resolves the specified filename against the configured PHP include path. + * + * Returns the resolved absolute path when the file is found, or false when the file cannot be resolved. + * @since 1.0.0 + * + * @param string $filename

+ * Name or path of the file to resolve using the configured PHP include path. + *

+ * + * @return string|false Resolved absolute file path on success, false if the file cannot be found. + */ + public static function resolve (string $filename):string|false { + + return stream_resolve_include_path($filename); + + } + +} \ No newline at end of file diff --git a/src/Stream/Read.php b/src/Stream/Read.php new file mode 100644 index 0000000..0ed5903 --- /dev/null +++ b/src/Stream/Read.php @@ -0,0 +1,89 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_get_contents; +use function stream_get_line; + +/** + * ### PHP Runtime Stream Reading Utilities + * + * Provides low-level wrappers for reading data from PHP streams. + * + * Supports reading the remaining contents of a stream and reading data up to a specified delimiter. + * + * This component preserves native PHP stream reading behavior. + * @since 1.0.0 + */ +final readonly class Read extends NativeRuntime { + + /** + * ### Reads the remaining contents of a stream + * + * Reads data from the current stream position until the end of the stream or until the specified maximum number + * of bytes has been read. + * + * An optional offset can be provided to change the position from which reading begins. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource from which data will be read. + *

+ * @param int $length [optional]

+ * Maximum number of bytes to read. A value of -1 reads all remaining bytes. + *

+ * @param int $offset [optional]

+ * Offset from which reading begins. A value of -1 uses the current stream position. + *

+ * + * @return string|false Read data on success, false on failure. + */ + public static function contents (mixed $stream, int $length = -1, int $offset = -1):string|false { + + return stream_get_contents($stream, $length, $offset); + + } + + /** + * ### Reads a line from a stream + * + * Reads data from the current stream position until the specified delimiter is encountered, the maximum number + * of bytes has been read, or the end of the stream is reached. + * + * The delimiter is not included in the returned string. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream resource from which data will be read. + *

+ * @param int $length

+ * Maximum number of bytes to read. + *

+ * @param string $delimiter [optional]

+ * Delimiter indicating where reading should stop. + * + * An empty string reads data without delimiter matching. + *

+ * + * @return string|false Read data on success, false on failure. + */ + public static function line (mixed $stream, int $length, string $delimiter = ''):string|false { + + return stream_get_line($stream, $length, $delimiter); + + } + +} \ No newline at end of file diff --git a/src/Stream/Select.php b/src/Stream/Select.php new file mode 100644 index 0000000..f66d4b5 --- /dev/null +++ b/src/Stream/Select.php @@ -0,0 +1,73 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_select; + +/** + * ### PHP Runtime Stream Selection Utilities + * + * Provides low-level wrappers for monitoring multiple PHP streams for readiness to perform input and output + * operations. + * + * Supports monitoring readable, writable, and exceptional stream conditions while preserving native PHP stream + * selection behavior. + * @since 1.0.0 + */ +final readonly class Select extends NativeRuntime { + + /** + * ### Selects streams ready for I/O operations + * + * Monitors the specified streams for readiness to perform reading, writing, or exceptional operations. + * + * The input arrays are modified to contain only the streams that satisfy their respective readiness conditions. + * + * A null timeout waits indefinitely, while a timeout of zero seconds and zero microseconds performs a + * non-blocking poll. + * @since 1.0.0 + * + * @param null|array &$read

+ * Streams to monitor for reading. Modified to contain only streams ready for reading. + *

+ * @param null|array &$write

+ * Streams to monitor for writing. Modified to contain only streams ready for writing. + *

+ * @param null|array &$except

+ * Streams to monitor for exceptional conditions. Modified to contain only streams with exceptional conditions. + *

+ * @param null|int $seconds

+ * Maximum number of seconds to wait. Null waits indefinitely. + *

+ * @param null|int<0, 999999> $microseconds

+ * Additional timeout duration in microseconds. + *

+ * + * @return int|false Number of ready streams on success, or false on failure. + */ + public static function select (?array &$read, ?array &$write, ?array &$except, ?int $seconds, ?int $microseconds = null):int|false { + + return stream_select( + $read, + $write, + $except, + $seconds, + $microseconds + ); + + } + +} \ No newline at end of file diff --git a/src/Stream/Socket.php b/src/Stream/Socket.php new file mode 100644 index 0000000..f3bad5c --- /dev/null +++ b/src/Stream/Socket.php @@ -0,0 +1,299 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; +use FireHub\Runtime\Stream\Enum\{ + ClientFlag, CryptoClientMethod, CryptoServerMethod, ReceiveFlag, SendFlag, ServerFlag, ShutdownMode, SocketDomain, + SocketProtocol, SocketType +}; + +use function stream_socket_client; +use function stream_socket_server; +use function stream_socket_accept; +use function stream_socket_enable_crypto; +use function stream_socket_get_name; +use function stream_socket_pair; +use function stream_socket_recvfrom; +use function stream_socket_sendto; +use function stream_socket_shutdown; + +/** + * ### PHP Runtime Stream Socket Utilities + * + * Provides low-level wrappers for creating, connecting, accepting, configuring, and communicating through PHP stream + * sockets. + * + * Supports native PHP socket transports, including TCP, UDP, Unix domain sockets, and encrypted transports. + * + * This component preserves native PHP stream socket behavior. + * @since 1.0.0 + */ +final readonly class Socket extends NativeRuntime { + + /** + * ### Opens a client socket connection + * + * Opens a stream socket connection to the specified remote address. + * @since 1.0.0 + * + * @param string $address

+ * Remote socket address, including the transport protocol. + *

+ * @param null|int &$error_code [optional]

+ * Receives the system-level error code if the connection fails. + *

+ * @param null|string &$error_message [optional]

+ * Receives the error message if the connection fails. + *

+ * @param null|float &$timeout [optional]

+ * Connection timeout in seconds. Null uses the default socket timeout. + *

+ * @param \FireHub\Runtime\Stream\Enum\ClientFlag $flag [optional]

+ * Connection mode and persistence flags. + *

+ * @param null|resource $context [optional]

+ * Optional stream context containing transport-specific options. + *

+ * + * @return resource|false Connected socket resource on success, false on failure. + */ + public static function client (string $address, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null, ClientFlag $flag = ClientFlag::CONNECT, mixed $context = null):mixed { + + return stream_socket_client( + $address, + $error_code, + $error_message, + $timeout, + $flag->value, + $context + ); + + } + + /** + * ### Creates a server socket + * + * Creates a stream socket server bound to the specified local address. + * @since 1.0.0 + * + * @param string $address

+ * Local socket address, including the transport protocol. + *

+ * @param null|int &$error_code [optional]

+ * Receives the system-level error code if the server cannot be created. + *

+ * @param null|string &$error_message [optional]

+ * Receives the error message if the server cannot be created. + *

+ * @param \FireHub\Runtime\Stream\Enum\ServerFlag $flag [optional]

+ * Binding and listening flags. + *

+ * @param null|resource $context [optional]

+ * Optional stream context containing server-specific options. + *

+ * + * @return resource|false Server socket resource on success, false on failure. + */ + public static function server (string $address, ?int &$error_code = null, ?string &$error_message = null, ServerFlag $flag = ServerFlag::BIND_LISTEN, mixed $context = null):mixed { + + return stream_socket_server( + $address, + $error_code, + $error_message, + $flag->value, + $context + ); + + } + + /** + * ### Accepts a connection on a server socket + * + * Accepts an incoming connection on an existing listening server socket. + * @since 1.0.0 + * + * @param resource $server_socket

+ * Listening server socket resource. + *

+ * @param null|float $timeout [optional]

+ * Maximum time to wait for an incoming connection, in seconds. + * Null uses the default socket timeout. + *

+ * @param null|string &$peer_name [optional]

+ * Receives the remote peer address when a connection is accepted. + *

+ * @param-out mixed $peer_name + * + * @return resource|false Accepted connection resource on success, false on failure. + */ + public static function accept (mixed $server_socket, ?float $timeout = null, ?string &$peer_name = null):mixed { + + return stream_socket_accept($server_socket, $timeout, $peer_name); + + } + + /** + * ### Enables or disables encryption on a socket + * + * Enables or disables encryption on an existing stream socket. + * + * For non-blocking streams, the operation may return zero when additional data is required to complete the + * encryption handshake. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream socket resource. + *

+ * @param bool $enable

+ * Whether to enable or disable encryption. + *

+ * @param null|\FireHub\Runtime\Stream\Enum\CryptoClientMethod|\FireHub\Runtime\Stream\Enum\CryptoServerMethod $crypto_method [optional]

+ * Cryptographic method for the client or server. + *

+ * @param null|resource $session_stream [optional]

+ * Optional stream resource used to reuse an existing encryption session. + *

+ * + * @return bool|int True on success, false on failure, or zero when additional data is required to complete the + * handshake. + */ + public static function enableCrypto (mixed $stream, bool $enable, CryptoClientMethod|CryptoServerMethod|null $crypto_method = null, mixed $session_stream = null):bool|int { + + return stream_socket_enable_crypto($stream, $enable, $crypto_method?->value, $session_stream); + + } + + /** + * ### Gets the local or remote socket name + * + * Retrieves the local or remote address associated with a stream socket. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream socket resource. + *

+ * @param bool $remote

+ * Whether to retrieve the remote address. False retrieves the local address. + *

+ * + * @return string|false Socket address on success, false on failure. + */ + public static function getName (mixed $stream, bool $remote):string|false { + + return stream_socket_get_name($stream, $remote); + + } + + /** + * ### Creates a pair of connected sockets + * + * Creates two connected stream sockets using the specified domain, socket type, and protocol. + * @since 1.0.0 + * + * @param \FireHub\Runtime\Stream\Enum\SocketDomain $domain

+ * Socket protocol family. + *

+ * @param \FireHub\Runtime\Stream\Enum\SocketType $type

+ * Socket communication type. + *

+ * @param \FireHub\Runtime\Stream\Enum\SocketProtocol $protocol

+ * Socket transport protocol. + *

+ * + * @return array|false Pair of connected socket resources on success, false on failure. + */ + public static function pair (SocketDomain $domain, SocketType $type, SocketProtocol $protocol):array|false { + + return stream_socket_pair($domain->value, $type->value, $protocol->value); + + } + + /** + * ### Receives data from a socket + * + * Receives data from a connected or unconnected stream socket. + * @since 1.0.0 + * + * @param resource $socket

+ * Stream socket resource. + *

+ * @param int<1, max> $length

+ * Maximum number of bytes to receive. + *

+ * @param \FireHub\Runtime\Stream\Enum\ReceiveFlag $flag [optional]

+ * Receive behavior flags. + *

+ * @param null|string $address [optional]

+ * Receives the address of the sender when available. + *

+ * @param-out mixed $address + * + * @return string|false Received data on success, false on failure. + */ + public static function receive (mixed $socket, int $length, ReceiveFlag $flag = ReceiveFlag::NONE, ?string &$address = null):string|false { + + return stream_socket_recvfrom($socket, $length, $flag->value, $address); + + } + + /** + * ### Sends data through a socket + * + * Sends data through a connected stream socket or to a specified destination address. + * @since 1.0.0 + * + * @param resource $socket

+ * Stream socket resource. + *

+ * @param string $data

+ * Data to send through the socket. + *

+ * @param \FireHub\Runtime\Stream\Enum\SendFlag $flag [optional]

+ * Send behavior flags. + *

+ * @param string $address [optional]

+ * Destination address. An empty string uses the connected peer. + *

+ * + * @return int|false Number of bytes sent on success, false on failure. + */ + public static function send (mixed $socket, string $data, SendFlag $flag = SendFlag::NONE, string $address = ''):int|false { + + return stream_socket_sendto($socket, $data, $flag->value, $address); + + } + + /** + * ### Shuts down a socket connection + * + * Shuts down the reading direction, writing direction, or both directions of an existing socket connection. + * @since 1.0.0 + * + * @param resource $stream

+ * Stream socket resource. + *

+ * @param \FireHub\Runtime\Stream\Enum\ShutdownMode $mode

+ * Direction of shutdown. + *

+ * + * @return bool True on success, false on failure. + */ + public static function shutdown (mixed $stream, ShutdownMode $mode):bool { + + return stream_socket_shutdown($stream, $mode->value); + + } + +} \ No newline at end of file diff --git a/src/Stream/Transfer.php b/src/Stream/Transfer.php new file mode 100644 index 0000000..73dd20c --- /dev/null +++ b/src/Stream/Transfer.php @@ -0,0 +1,65 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; + +use function stream_copy_to_stream; + +/** + * ### PHP Runtime Stream Transfer Utilities + * + * Provides low-level wrappers for transferring data between PHP streams. + * + * Supports copying stream contents with optional length and offset parameters while preserving native PHP stream + * behavior. + * @since 1.0.0 + */ +final readonly class Transfer extends NativeRuntime { + + /** + * ### Copies data between streams + * + * Copies data from the source stream to the destination stream. + * + * By default, copies all remaining data from the current position of the source stream. + * + * An optional maximum length limits the number of bytes copied. An optional offset specifies the position in the + * source stream from which copying begins. + * @since 1.0.0 + * + * @param resource $source

+ * Source stream resource from which data will be read. + *

+ * @param resource $destination

+ * Destination stream resource to which data will be written. + *

+ * @param int $length [optional]

+ * Maximum number of bytes to copy. A value of -1 copies all remaining data from the source stream. + *

+ * @param int $offset [optional]

+ * Offset in the source stream from which copying begins. + * + * A value of zero uses the current stream position. + *

+ * + * @return int|false Number of bytes copied on success, false on failure. + */ + public static function copy (mixed $source, mixed $destination, int $length = -1, int $offset = 0):int|false { + + return stream_copy_to_stream($source, $destination, $length, $offset); + + } + +} \ No newline at end of file diff --git a/src/Stream/Wrapper.php b/src/Stream/Wrapper.php new file mode 100644 index 0000000..3e77b74 --- /dev/null +++ b/src/Stream/Wrapper.php @@ -0,0 +1,117 @@ + + * @copyright 2026-present The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version >=8.2 + * @package Runtime + */ + +namespace FireHub\Runtime\Stream; + +use FireHub\Core\Boundary\Runtime\NativeRuntime; +use FireHub\Runtime\Stream\Enum\WrapperRegistrationFlag; + +use function stream_get_wrappers; +use function stream_wrapper_register; +use function stream_wrapper_unregister; +use function stream_wrapper_restore; + +/** + * ### PHP Runtime Stream Wrapper Utilities + * + * Provides low-level wrappers for retrieving, registering, unregistering, and restoring PHP stream wrappers. + * + * Stream wrappers allow PHP to access resources through custom protocols using standard filesystem and stream + * functions. + * + * This component preserves native PHP stream wrapper behavior. + * @since 1.0.0 + */ +final readonly class Wrapper extends NativeRuntime { + + /** + * ### Gets registered stream wrappers + * + * Returns the names of all stream wrappers registered in the current PHP environment. + * @since 1.0.0 + * + * @return list Registered stream wrapper names. + */ + public static function get ():array { + + return stream_get_wrappers(); + + } + + /** + * ### Registers a stream wrapper + * + * Registers a user-defined stream wrapper for the specified protocol. + * + * The wrapper class must implement the methods required by the stream operations it intends to support. + * @since 1.0.0 + * + * @param string $protocol

+ * Protocol name to register. + *

+ * @param class-string $class

+ * Fully qualified name of the stream wrapper implementation class. + *

+ * @param WrapperRegistrationFlag $flag [optional]

+ * Whether the wrapper represents a URL. + *

+ * + * @return bool True on success, false on failure. + */ + public static function register (string $protocol, string $class, WrapperRegistrationFlag $flag = WrapperRegistrationFlag::NONE):bool { + + return stream_wrapper_register($protocol, $class, $flag->value); + + } + + /** + * ### Unregisters a stream wrapper + * + * Removes the stream wrapper associated with the specified protocol. + * + * The operation affects later stream operations using that protocol. + * @since 1.0.0 + * + * @param string $protocol

+ * Protocol name to unregister. + *

+ * + * @return bool True on success, false on failure. + */ + public static function unregister (string $protocol):bool { + + return stream_wrapper_unregister($protocol); + + } + + /** + * ### Restores a previously unregistered stream wrapper + * + * Restores a built-in stream wrapper that was previously removed using stream_wrapper_unregister(). + * + * This function does not restore user-defined stream wrappers. + * @since 1.0.0 + * + * @param string $protocol

+ * Protocol name to restore. + *

+ * + * @return bool True on success, false on failure. + */ + public static function restore (string $protocol):bool { + + return stream_wrapper_restore($protocol); + + } + +} \ No newline at end of file From 6af1a462b0c6758f0e3980fadf359585a839b9c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= Date: Wed, 4 Nov 2026 12:30:05 +0100 Subject: [PATCH 2/3] Refine `Filter` method defaults and streamline cryptographic enums **Details:** - Updated the `prepend` method in the `Filter` class to set `FilterFlag::READ_WRITE` as the default for the `$flag` parameter, enhancing usability without breaking backward compatibility. - Simplified cryptographic enums in `CryptoServerMethod` and `CryptoClientMethod`: - Removed outdated cryptographic methods (e.g., SSLv2, SSLv3). - Focused on modern TLS methods (TLS 1.2, TLS 1.3, and combinations). - Improved PHPDoc comments for clarity and alignment with updated functionality. - Corrected the `@php-version` annotation in `WrapperOpenFlag` to fix a typo. This update modernizes cryptographic options, fixes documentation, and improves the default behavior of filter utilities. --- CHANGELOG.md | 5 +- README.md | 2 +- src/Stream/Enum/CryptoClientMethod.php | 98 ++------------------------ src/Stream/Enum/CryptoServerMethod.php | 98 ++------------------------ src/Stream/Enum/WrapperOpenFlag.php | 2 +- src/Stream/Filter.php | 2 +- 6 files changed, 17 insertions(+), 190 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2539019..1c83911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +# [[v0.5-0](https://github.com/The-FireHub-Project/Runtime/compare/v0.4.3...v0.5.0)] – 2026-11-04 + +### Added +* Add comprehensive stream utilities in `Runtime` by @dieselxxx ## [[v0.4.3](https://github.com/The-FireHub-Project/Runtime/compare/v0.4.2...v0.4.3)] – 2026-11-02 diff --git a/README.md b/README.md index cf070d6..1e21618 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ /> version diff --git a/src/Stream/Enum/CryptoClientMethod.php b/src/Stream/Enum/CryptoClientMethod.php index c49319e..62f2cdd 100644 --- a/src/Stream/Enum/CryptoClientMethod.php +++ b/src/Stream/Enum/CryptoClientMethod.php @@ -22,111 +22,23 @@ enum CryptoClientMethod:int { /** - * ### Enables the ANY cryptographic method for client streams. - * @since 1.0.0 - */ - case ANY = STREAM_CRYPTO_METHOD_ANY_CLIENT; - - /** - * ### Enables the SSLv2 cryptographic method for client streams. - * @since 1.0.0 - */ - case SSLV2 = STREAM_CRYPTO_METHOD_SSLv2_CLIENT; - - /** - * ### Enables the SSLv3 cryptographic method for client streams. - * @since 1.0.0 - */ - case SSLV3 = STREAM_CRYPTO_METHOD_SSLv3_CLIENT; - - /** - * ### Enables the SSLv23 cryptographic method for client streams. - * @since 1.0.0 - */ - case SSLV23 = STREAM_CRYPTO_METHOD_SSLv23_CLIENT; - - /** - * ### Enables the TLS cryptographic method for client streams. - * @since 1.0.0 - */ - case TLS = STREAM_CRYPTO_METHOD_TLS_CLIENT; - - /** - * ### Enables the TLSv1_0 cryptographic method for client streams. - * @since 1.0.0 - */ - case TLSV1_0 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT; - - /** - * ### Enables the TLSv1_1 cryptographic method for client streams. - * @since 1.0.0 - */ - case TLSV1_1 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; - - /** - * ### Enables the TLSv1_2 cryptographic method for client streams. + * ### Enables TLS 1.2 encryption for client stream connections * @since 1.0.0 */ case TLSV1_2 = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; /** - * ### Enables the TLSv1_3 cryptographic method for client streams. + * ### Enables TLS 1.3 encryption for client stream connections * @since 1.0.0 */ case TLSV1_3 = STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; /** - * ### Allows TLS versions 1.0, 1.1 for client streams. - * @since 1.0.0 - */ - case TLS_10_11 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; - - /** - * ### Allows TLS versions 1.0, 1.2 for client streams. - * @since 1.0.0 - */ - case TLS_10_12 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; - - /** - * ### Allows TLS versions 1.0, 1.3 for client streams. - * @since 1.0.0 - */ - case TLS_10_13 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; - - /** - * ### Allows TLS versions 1.1, 1.2 for client streams. - * @since 1.0.0 - */ - case TLS_11_12 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; - - /** - * ### Allows TLS versions 1.1, 1.3 for client streams. - * @since 1.0.0 - */ - case TLS_11_13 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; - - /** - * ### Allows TLS versions 1.2, 1.3 for client streams. + * ### Allows TLS 1.2 and TLS 1.3 encryption for client stream connections + * + * Negotiates a supported TLS version between the client and server. * @since 1.0.0 */ case TLS_12_13 = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; - /** - * ### Allows TLS versions 1.0, 1.1, 1.3 for client streams. - * @since 1.0.0 - */ - case TLS_10_11_13 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; - - /** - * ### Allows TLS versions 1.0, 1.2, 1.3 for client streams. - * @since 1.0.0 - */ - case TLS_10_12_13 = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; - - /** - * ### Allows TLS versions 1.1, 1.2, 1.3 for client streams. - * @since 1.0.0 - */ - case TLS_11_12_13 = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; - } diff --git a/src/Stream/Enum/CryptoServerMethod.php b/src/Stream/Enum/CryptoServerMethod.php index b69df45..e6d5ec9 100644 --- a/src/Stream/Enum/CryptoServerMethod.php +++ b/src/Stream/Enum/CryptoServerMethod.php @@ -22,111 +22,23 @@ enum CryptoServerMethod:int { /** - * ### Enables the ANY cryptographic method for server streams. - * @since 1.0.0 - */ - case ANY = STREAM_CRYPTO_METHOD_ANY_SERVER; - - /** - * ### Enables the SSLv2 cryptographic method for server streams. - * @since 1.0.0 - */ - case SSLV2 = STREAM_CRYPTO_METHOD_SSLv2_SERVER; - - /** - * ### Enables the SSLv3 cryptographic method for server streams. - * @since 1.0.0 - */ - case SSLV3 = STREAM_CRYPTO_METHOD_SSLv3_SERVER; - - /** - * ### Enables the TLS cryptographic method for server streams. - * @since 1.0.0 - */ - case TLS = STREAM_CRYPTO_METHOD_TLS_SERVER; - - /** - * ### Enables the TLSv1_0 cryptographic method for server streams. - * @since 1.0.0 - */ - case TLSV1_0 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER; - - /** - * ### Enables the TLSv1_1 cryptographic method for server streams. - * @since 1.0.0 - */ - case TLSV1_1 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER; - - /** - * ### Enables the TLSv1_2 cryptographic method for server streams. + * ### Enables TLS 1.2 encryption for server stream connections * @since 1.0.0 */ case TLSV1_2 = STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; /** - * ### Enables the TLSv1_3 cryptographic method for server streams. + * ### Enables TLS 1.3 encryption for server stream connections * @since 1.0.0 */ case TLSV1_3 = STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; /** - * ### Allows TLS versions 1.0, 1.1 for server streams. - * @since 1.0.0 - */ - case TLS_10_11 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_1_SERVER; - - /** - * ### Allows TLS versions 1.0, 1.2 for server streams. - * @since 1.0.0 - */ - case TLS_10_12 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; - - /** - * ### Allows TLS versions 1.0, 1.3 for server streams. - * @since 1.0.0 - */ - case TLS_10_13 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; - - /** - * ### Allows TLS versions 1.1, 1.2 for server streams. - * @since 1.0.0 - */ - case TLS_11_12 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; - - /** - * ### Allows TLS versions 1.1, 1.3 for server streams. - * @since 1.0.0 - */ - case TLS_11_13 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; - - /** - * ### Allows TLS versions 1.2, 1.3 for server streams. + * ### Allows TLS 1.2 and TLS 1.3 encryption for server stream connections + * + * Negotiates a supported TLS version between the client and server. * @since 1.0.0 */ case TLS_12_13 = STREAM_CRYPTO_METHOD_TLSv1_2_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; - /** - * ### Allows TLS versions 1.0, 1.1, 1.2 for server streams. - * @since 1.0.0 - */ - case TLS_10_11_12 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; - - /** - * ### Allows TLS versions 1.0, 1.1, 1.3 for server streams. - * @since 1.0.0 - */ - case TLS_10_11_13 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; - - /** - * ### Allows TLS versions 1.0, 1.2, 1.3 for server streams. - * @since 1.0.0 - */ - case TLS_10_12_13 = STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; - - /** - * ### Allows TLS versions 1.1, 1.2, 1.3 for server streams. - * @since 1.0.0 - */ - case TLS_11_12_13 = STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER | STREAM_CRYPTO_METHOD_TLSv1_3_SERVER; - } diff --git a/src/Stream/Enum/WrapperOpenFlag.php b/src/Stream/Enum/WrapperOpenFlag.php index 66b0adc..c12e7d2 100644 --- a/src/Stream/Enum/WrapperOpenFlag.php +++ b/src/Stream/Enum/WrapperOpenFlag.php @@ -7,7 +7,7 @@ * @copyright 2026-present The FireHub Project - All rights reserved * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * - * @php-version >=8..1 + * @php-version >=8.1 * @package Runtime */ diff --git a/src/Stream/Filter.php b/src/Stream/Filter.php index 90fd3cc..7dd9fb0 100644 --- a/src/Stream/Filter.php +++ b/src/Stream/Filter.php @@ -87,7 +87,7 @@ public static function append (mixed $stream, string $filter_name, FilterFlag $f * * @return resource|false Filter resource on success, false on failure. */ - public static function prepend (mixed $stream, string $filter_name, FilterFlag $flag, mixed $params = null):mixed { + public static function prepend (mixed $stream, string $filter_name, FilterFlag $flag = FilterFlag::READ_WRITE, mixed $params = null):mixed { return stream_filter_prepend($stream, $filter_name, $flag->value, $params); From 60a47d01222a1d0d2007643b6044fdfdb5c2c3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= <56673130+dieselxxx@users.noreply.github.com> Date: Wed, 4 Nov 2026 12:31:07 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 111 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 1e21618..35c92f8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ PHP Runtime Foundation
release @@ -22,25 +22,46 @@ /> -[![PHPStan](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPStan.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPStan.yml) -[![PHPUnit](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPUnit.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Runtime/actions/workflows/PHPUnit.yml) -[![Codecov](https://codecov.io/gh/The-FireHub-Project/Runtime/branch/develop/graph/badge.svg?token=XW2YEONF51)](https://app.codecov.io/gh/The-FireHub-Project/Runtime/tree/develop) -

- + + GitHub created at + GitHub last commit (branch) - + GitHub activity (branch) - + + GitHub contributors + GitHub commit difference between two branches + + GitHub top language + + GitHub repo size + + GitHub code size

@@ -54,47 +75,55 @@ Its role is to provide a consistent execution foundation between native PHP capa --- -## FireHub Icon Development Branch +## FireHub Icon Repository Purpose -⚠️ **This is the `develop` branch** +This repository provides a lightweight PHP runtime abstraction layer that wraps native PHP functionality into clean, consistent, and deterministic APIs. -- Unstable -- APIs may change without notice -- Not intended for production use +Its purpose is to reduce boilerplate and standardize common execution patterns across the FireHub ecosystem by offering ergonomic helper classes for arrays, strings, files, environment access, and other low-level runtime operations. -## FireHub Icon Branch Purpose +It is strictly focused on execution-level concerns and does not contain domain logic, business rules, or framework-level orchestration. It exists to improve developer productivity while preserving native PHP behavior and ensuring zero framework coupling. -The `develop` branch is the **primary integration branch** for all ongoing development. +## FireHub Icon Security -It serves as the staging area where: -- Feature branches are merged -- Bug fixes are integrated -- Experimental work is stabilized -- Code is prepared for upcoming releases +For security reporting and guidelines, please refer to our [SECURITY.md](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file. -All **release branches** are created **from `develop`**. +## FireHub Icon Community -## Stability Guarantee +![GitHub watchers](https://img.shields.io/github/watchers/The-FireHub-Project/Runtime?style=social) +![GitHub Repo stars](https://img.shields.io/github/stars/The-FireHub-Project/Runtime?style=social) +![GitHub forks](https://img.shields.io/github/forks/The-FireHub-Project/Runtime?style=social) -❌ No backward compatibility guarantee -❌ APIs may change without notice -❌ Behavior may be incomplete or inconsistent -❌ Breaking changes are expected +- Be sure to review the [Code of Conduct](https://github.com/The-FireHub-Project/.github/blob/master/.github/CODE_OF_CONDUCT.md). +- Read a [Contributing](https://github.com/The-FireHub-Project/.github/blob/master/.github/CONTRIBUTING.md) file to see how you can contribute to this project. +- Read our [Security policy](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file to see how you can report a vulnerability. +- Review the project [Governance model](https://github.com/The-FireHub-Project/.github/blob/master/.github/GOVERNANCE.md), including roles, decision-making, RFC process, and releases. -This branch is intended **only for contributors and advanced testers**. +## FireHub Icon Support -## FireHub Icon Composer Usage (Not Recommended) +

+ + GitHub in-progress issues + + GitHub total issues + + GitHub opened pull requests +

-For internal testing only: +For help with FireHub products, please refer to the following resources: -```json -{ - "require": { - "the-firehub-project/runtime": "dev-develop" - } -} -``` -⚠️ Never use dev-develop in production. +- **General questions & discussions**: [GitHub Discussions](https://github.com/orgs/The-FireHub-Project/discussions) +- **Bug reports & issues**: [Support](https://github.com/The-FireHub-Project/Runtime/issues) +- **Documentation & guides**: [FireHub Docs](https://the-firehub-project.github.io) +- **Commercial support** (Pro/Enterprise): contact your account manager ## FireHub Icon Authors and Contributors