Download the PHP package webpatser/fledge-fiber without Composer

On this page you can find all versions of the php package webpatser/fledge-fiber. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fledge-fiber

Fledge Fiber

Non-blocking async drivers for the Fledge framework. PHP 8.5 only.

Provides fiber-based database (MySQL, MariaDB, PostgreSQL), Redis, HTTP, WebSocket, filesystem, and parallel processing drivers that integrate seamlessly with Laravel's service container.

Requirements

Installation

The FiberServiceProvider is auto-discovered. No manual registration needed.

Configuration

Set drivers in your .env:

Available database drivers:

Driver Database Implementation
fledge-mysql, fledge-mariadb MySQL, MariaDB MySQL wire protocol in PHP
fledge-pgsql PostgreSQL PostgreSQL driver in PHP
fledge-mysql-native, fledge-mariadb-native MySQL, MariaDB pdo_mysql made fiber-aware by php-fiberio (see below)

Driver option support

The drivers aim for config parity with Laravel's stock drivers. Everything below reflects what actually reaches the wire; options that cannot be supported fail loudly or are documented here rather than silently ignored.

Database

Honored beyond the basics: Postgres sslcert/sslkey/sslrootcert and keepalives* (libpq connection string), Postgres session settings (isolation_level, timezone, search_path/schema, synchronous_commit, charset) via libpq startup -c options so DISCARD ALL on pool checkout restores instead of wipes them, MySQL/MariaDB TLS via Pdo\Mysql::ATTR_SSL_CA/ATTR_SSL_CAPATH/ATTR_SSL_CERT/ATTR_SSL_KEY/ATTR_SSL_CIPHER/ATTR_SSL_VERIFY_SERVER_CERT in options (TLS is skipped for unix sockets), ATTR_INIT_COMMAND (runs on every new pooled connection), and per-connection isolation_level/timezone on MySQL through SessionInitializingConnector.

Explicitly unsupported PDO attributes: ATTR_CASE (server column names always), ATTR_ERRMODE (the shim always throws, Laravel's default), ATTR_ORACLE_NULLS, ATTR_STRINGIFY_FETCHES (native types from the wire), ATTR_EMULATE_PREPARES (statements are always server-prepared), ATTR_PERSISTENT (pooling replaces it).

MySQL 5.7: there is no live server-version probe, so set 'version' => '5.7' in the connection config to get the NO_AUTO_CREATE_USER strict mode string.

Transactions on fledge-mysql, fledge-mariadb and fledge-pgsql are pinned per Laravel connection, not per fiber. While one fiber (or the main context) has a transaction open, a query, prepared-statement execute, begin, commit or rollback from any other fiber on that connection throws a LogicException instead of silently running inside it. Give concurrent fibers separate connections, or use the native drivers below, which keep transactions per fiber.

Native MySQL/MariaDB drivers (fledge-mysql-native, fledge-mariadb-native)

A pool of real pdo_mysql connections running on php-fiberio, one lease per fiber. Fiberio makes the stock PDO socket I/O yield to the Revolt event loop, so you get Laravel's own connectors, TLS, session settings and error shapes without the userland wire protocol. A fiber takes a connection for the duration of a query (or a whole transaction, or a cursor() until its generator ends) and gives it back afterwards. A fiber that finds the pool empty waits for a free lease, and fails with a RuntimeException after pool_wait_timeout.

When to use which driver

fledge-mariadb / fledge-mysql fledge-mariadb-native / fledge-mysql-native
Wire protocol Implemented in PHP Stock pdo_mysql (C)
Extra requirements None php-fiberio 0.3.0+, NTS PHP only
Transactions Pinned per connection; other fibers get a LogicException Per fiber, each on its own lease
CPU per row, bulk read (10,000 rows) 11.11 us 0.63 us
CPU per row, bulk read (20,000 rows) 6.55 us 0.19 us
Wall time, 32 fibers x SELECT SLEEP(0.05) 0.057 s 0.058 s

Both overlap concurrent I/O equally well; the native drivers cost far less CPU per row on large reads. Numbers are from bench/database/results/local-mariadb11-2026-10-08.md (MariaDB 11.8, PHP 8.5.11, local TCP, scale 0.2, 5 runs). On single-row point lookups the native driver spent 60.76 us of CPU per row against 161.26 us for fledge-mariadb, but more than blocking stock pdo_mysql through Laravel (25.60 us), as it adds pool and lease handling.

Install fiberio

Configuration

PDO::ATTR_PERSISTENT is rejected with an InvalidArgumentException: fiberio routes persistent streams to the blocking transport, and the pool replaces them.

Switching an existing app

  1. Install fiberio on every worker host (see above).
  2. Change driver from fledge-mariadb to fledge-mariadb-native (or fledge-mysql to fledge-mysql-native). Host, credentials and charset stay as they are.
  3. Review the caveats below, especially TLS and test setup.

To roll back, change driver back. fledge-mysql and fledge-mariadb keep their wire-protocol implementation and stay available.

fiberio hooks (FLEDGE_FIBERIO_HOOKS)

With php-fiberio 0.3.0 or later the extension can also make sleep() and friends, DNS lookups and ssl:///tls:// client streams fiber-aware. The native connector enables them for the whole process through config fledge-http.fiberio_hooks, fed by the env var FLEDGE_FIBERIO_HOOKS:

Caveats and migration notes

Requirements

Behaviour

Testing

Operations

Redis

Supported: scheme (tcp/tls/rediss/unix), host, port, path (unix socket, predis and phpredis styles), username/password (two-arg AUTH), database, timeout, read_timeout (values at or below 0 wait forever), context ssl options (peer_name, verify_peer, verify_peer_name, cafile, capath, verify_depth, ciphers, local_cert/local_pk/passphrase, security_level, peer_fingerprint), prefix (phpredis OPT_PREFIX semantics, including pub/sub channels), name (CLIENT SETNAME), tcp_keepalive (best effort, needs ext-sockets), command_retries, max_retries, retry_interval, backoff_algorithm/backoff_base/backoff_cap. Cluster seeds inherit TLS, auth, timeouts, and retry policy.

Tolerated without effect: scan (SCAN MATCH patterns are not auto-prefixed, matching phpredis defaults), persistent/persistent_id (connections are long-lived per worker), compression_level without compression.

Rejected loudly with UnsupportedRedisOptionException: serializer and compression (data would be unreadable across clients), pack_ignore_numbers, replication => sentinel (use a direct connection or predis), cluster failover => distribute/distribute_slaves (reads always go to a master), options.cluster other than redis.

HTTP client handler

FledgeHandler is a Guzzle handler backed by the async HTTP client, registered globally by FiberHttpServiceProvider (disabled under PHPUnit); opt out at runtime with Factory::globalHandler(null).

Supported request options: timeout, connect_timeout, version (1.0/1.1/2 with ALPN and 1.1 fallback), verify (true/false/CA file or dir), cert, ssl_key, crypto_method, proxy (string or array form including no; http:// via CONNECT and socks5://), decode_content, sink (path, resource, PSR-7 stream), stream, on_headers, on_stats (curl-shaped handler stats), delay, allow_redirects (all Guzzle sub-options, handled by RedirectMiddleware), plus everything Guzzle middleware implements above the handler. Transport failures reject as Guzzle exception types, so Illuminate\Http\Client\ConnectionException and the ConnectionFailed event work.

Known limitations: no ntlm auth, progress, debug, force_ip_resolve, Expect 100-continue handling, or raw curl options; no https://-scheme proxies; plain-HTTP proxying always tunnels via CONNECT; namelookup_time is always 0 in handler stats.

FledgeGuzzle: one stack for every Guzzle consumer

Fledge\Fiber\Http\FledgeGuzzle hands out Guzzle pieces that run on the Fledge handler instead of curl:

Third-party integrations (on by default)

FiberHttpServiceProvider also puts the HTTP clients of these integrations on the Fledge handler, so their requests suspend only the calling fiber:

Integration What changes Env flag
Mail The mail manager is replaced by FiberMailManager. HTTP transports (Postmark, Mailgun, Resend, ...) use a Symfony HttpClientInterface on the Fledge client. SES and SES v2 get an AWS SDK http_handler on the Fledge stack. FLEDGE_HTTP_MAIL
Broadcasting The pusher and reverb drivers get client_options.handler on the Fledge stack. FLEDGE_HTTP_BROADCASTING
S3 The s3 filesystem driver gets an http_handler through the AWS SDK's Guzzle bridge. No-op without aws/aws-sdk-php. FLEDGE_HTTP_S3
Elasticsearch PDPhilip's elasticsearch database driver is replaced by FledgeElasticConnection, built by ElasticClientFactory. No-op without pdphilip/elasticsearch. FLEDGE_HTTP_ELASTICSEARCH

Behaviour change: all four are ON by default after upgrading. Mail, Pusher/Reverb, S3 and Elasticsearch traffic that used to go through curl, Symfony's client or the AWS default handler now goes through Fledge. Set the flag to false to return one integration to its previous client:

Symfony HttpClient adapter

Fledge\Fiber\Http\Symfony\FledgeSymfonyHttpClient implements Symfony's HttpClientInterface on the async client (requires symfony/http-client). Requests start when request() returns and responses created back to back overlap on the wire. Supported options: timeout, max_duration, max_connect_duration, verify_peer, verify_host, cafile, capath, local_cert, local_pk, passphrase, crypto_method, proxy, no_proxy, max_redirects, http_version (1.0, 1.1, 2), plus the body and header options Symfony normalizes itself.

Cross-origin Referer

With allow_redirects.referer enabled, Guzzle 7 sends the full previous URL (path and query) to the new origin; only Guzzle 8 trims it. FledgeHandler now reduces the Referer on every redirect hop itself: origin only across origins, no userinfo or fragment. A Referer you set on the first request is left alone.

Rolling back the integrations

  1. Set the FLEDGE_HTTP_* flag of the affected integration to false (or 'client' => ['fledge' => false] for one mailer), run php artisan config:cache, and restart workers (Octane, queue, Torque) so long-lived processes pick it up.
  2. To drop the global Guzzle handler as well, call Factory::globalHandler(null).
  3. Native database driver: change driver back to fledge-mariadb/fledge-mysql, or switch single fiberio hooks off with FLEDGE_FIBERIO_HOOKS (for example FLEDGE_FIBERIO_HOOKS=none), then config:cache and restart workers.

What's included

Module Namespace Description
Core Fledge\Async Future, async/await, cancellation, pipelines
Stream Fledge\Async\Stream Non-blocking byte streams, sockets, TLS
Database Fledge\Async\Database MySQL, MariaDB, PostgreSQL wire protocols
Redis Fledge\Async\Redis RESP protocol, pub/sub, TLS
HTTP Fledge\Async\Http HTTP/1.1 + HTTP/2 client and server
WebSocket Fledge\Async\WebSocket WebSocket client and server
File Fledge\Async\File Non-blocking filesystem I/O
Parallel Fledge\Async\Parallel Multi-process worker pools
DNS Fledge\Async\Dns Async DNS resolution
Cache Fledge\Async\Cache Cache interfaces + local implementations
Sync Fledge\Async\Sync Mutexes, semaphores, barriers
Process Fledge\Async\Process OS process management

The Laravel integration layer lives under Fledge\Fiber\ and bridges async drivers to Laravel's database, Redis, HTTP, and Livewire systems.

PHP 8.5 Features

This library requires PHP 8.5 and uses:

Versioning

Follows Fledge versioning: v13.x.y.z where the first three digits match the Laravel version and the fourth is the fledge-fiber patch level.

License

Apache-2.0. Portions are derived from amphp (MIT); see LICENSE for the original notice.


All versions of fledge-fiber with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
revolt/event-loop Version ^1.0
daverandom/libdns Version ^2.1
guzzlehttp/guzzle Version ^7.8 || ^8.0
guzzlehttp/promises Version ^2.5 || ^3.0
guzzlehttp/psr7 Version ^2.4 || ^3.0
league/uri Version ^7.0
league/uri-interfaces Version ^7.0
kelunik/certificate Version ^1.1
illuminate/database Version ^13.0
illuminate/http Version ^13.0
illuminate/redis Version ^13.0
illuminate/support Version ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webpatser/fledge-fiber contains the following files

Loading the files please wait ...