Download the PHP package fiber-interop/mysqli without Composer

On this page you can find all versions of the php package fiber-interop/mysqli. 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 mysqli

fiber-interop/mysqli

Cooperative mysqli queries for fiber-interop/api: inside fiber\run() a query suspends only the calling task, on whichever adapter is installed.

API

Adapters register a native driver from their register.php exactly as for fiber-interop/curl: by writing fiber\mysqli\Registry::$candidates[...] behind interface_exists(\fiber\mysqli\Driver::class) and their own runtime check.

One query per connection

The MySQL protocol allows one query in flight per connection. start() on a connection that is still busy does not fail: the query is queued and sent when the previous one completes, so two tasks sharing a connection run their queries one after the other. For parallelism, use one connection per concurrent task.

How it waits: polling, honestly

PollDriver sends with $m->query($sql, MYSQLI_ASYNC) and one poller task calls mysqli_poll(..., 0, 0) over all in-flight connections, then $m->reap_async_query() for the ready ones. Between rounds it sleeps with fiber\sleep(): 1 ms after a round in which something completed, backing off ×1.5 toward 10 ms while nothing does. It stops when no query is in flight.

This is polling. mysqli exposes no file descriptor for a connection (mysqlnd has a PHP stream internally but does not hand it out), so fiber\readable() cannot be used. The php-src fix is small: a mysqli_socket() / stream accessor returning the connection's stream, after which the driver could wait on the fd like pg_socket() allows for PostgreSQL. Native drivers below avoid the polling.

Native drivers

Runtime Driver
phasync with the phasync extension loaded FiberInterop\Phasync\MysqliDriver (go(fn() => $m->query(...)); the extension hooks PHP streams, which mysqlnd uses)
Swoole / OpenSwoole FiberInterop\Swoole\MysqliDriver (same; SWOOLE_HOOK_TCP, part of SWOOLE_HOOK_ALL, makes mysqlnd's socket cooperative)
Revolt, AMPHP, ReactPHP, phasync without the extension PollDriver

Limits

Tests

The suite needs a MySQL or MariaDB server; it never shells out to a client. Environment variables (defaults in parentheses): MYSQLI_HOST (127.0.0.1), MYSQLI_PORT (13307), MYSQLI_USER (root), MYSQLI_PASSWORD (test). For example:

FI_RUNTIME=revolt|amp|react|phasync|swoole picks the adapter, FI_DRIVER=generic|native the driver. CI runs every runtime against a mysql:8.4 service container.


All versions of mysqli with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-mysqli Version *
fiber-interop/api Version ^0.3
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 fiber-interop/mysqli contains the following files

Loading the files please wait ...