Download the PHP package symplely/uv-ffi without Composer

On this page you can find all versions of the php package symplely/uv-ffi. 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 uv-ffi

uv-ffi

Windows Linux macOS codecov

An Foreign function interface (FFI) for PHP of libuv cross-platform event-driven asynchronous I/O library.

This libuv ffi implementation is based on PHP extension ext-uv. All ext-uv 0.3.0 tests and functions been implemented, except uv_queue_work.

The actual threading feature of uv_queue_work in ext-uv 0.3.0 is on pause. Getting native PThreads working with FFI, needs a lot more investigation and more likely C development of PHP source code. Seems someone else has started something similar https://github.com/mrsuh/php-pthreads.

Update: Since progress by maintainers of amphp/ext-uv has stopped. See symplely/ext-uv for updates, a new release version 0.4.2 with true threading feature of uv_queue_work() implemented, other bugs, and build issues fixed. Pre-built binaries available for most platforms at https://github.com/symplely/ext-uv/releases, the whole pecl build system not needed, and PHP versions 7.4 to 8.2 supported.

PR are welcome, see [Documentation] and [Contributing].

Future versions of uv-ffi beyond ext-uv 0.3.0 will include all current libuv features.

Installation

There will be two ways: composer require symplely/uv-ffi and: composer create-project symplely/uv-ffi .cdef/libuv

This package/repo is self-contained for Windows and Apple macOS, meaning it has GitHub Actions building libuv binary .dll & .dylib, and committing back to repo. The other platforms will use the distributions included libuv binary version.

The create-project will setup a different loading/installation area. This feature is still a work in progress.

Minimum php.ini setting:

How to use

The following is a PHP tcp echo server converted from C uv book that's follows also. Most of the required C setup and cleanup code is done automatically.

This will print "Got a connection!" to console if visited.

The C source

Error handling

Initialization functions *_init() or synchronous functions, which may fail will return a negative number on error. Async functions that may fail will pass a status parameter to their callbacks. The error messages are defined as UV::E* constants.

You can use the uv_strerror(int) and uv_err_name(int) functions to get a string describing the error or the error name respectively.

I/O read callbacks (such as for files and sockets) are passed a parameter nread. If nread is less than 0, there was an error (UV::EOF is the end of file error, which you may want to handle differently).

In general, functions and status parameters contain the actual error code, which is 0 for success, or a negative number in case of error.

Documentation

All functions/methods/classes have there original Libuv documentation, signatures embedded in DOC-BLOCKS.

For deeper usage understanding, see An Introduction to libuv.

The following functions are present in Windows, but not in Linux ubuntu 20.04 up, might need rechecking though.

Contributing

Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on Github :) Create Github Issues for bugs and new features and comment on the ones you are interested in.

License

The MIT License (MIT). Please see License File for more information.


All versions of uv-ffi with dependencies

PHP Build Version
Package Version
Requires php Version >7.4
ext-ffi Version *
symplely/zend-ffi Version ~0.12.7
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 symplely/uv-ffi contains the following files

Loading the files please wait ....