Download the PHP package quioteframework/worker-swoole without Composer

On this page you can find all versions of the php package quioteframework/worker-swoole. 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 worker-swoole

quioteframework/worker-swoole

Serves a Quiote application from an embedded Swoole HTTP server, via the swoole alias of Quiote's worker-runtime seam (Quiote\Runtime\Worker\WorkerRuntimeInterface).

Developed in-tree under quioteframework/quiote's packages/worker-swoole/. PRs go to the monorepo, not here.

Install

ext-swoole is a composer suggest, not a require, so the package installs and type-checks without it. The runtime raises an actionable error if you try to serve without the extension.

Activate the plugin in Config/plugins.xml:

Set up

Swoole's server is started by a PHP script, so the app needs an entrypoint next to (not inside) its document root. quiote new --runtime=swoole generates it; for an existing app, add swoole.php in the application root:

Then either php swoole.php directly, or bin/quiote swoole:serve, which is a thin wrapper around the same script (it sets $QUIOTE_WORKER_RUNTIME=swoole for you). pub/index.php stays as it is, so the same codebase still runs under FrankenPHP or php-fpm unchanged.

Unlike RoadRunner, detection needs an explicit opt-in — either 'worker_runtime' => 'swoole' or $QUIOTE_WORKER_RUNTIME=swoole. That is deliberate: extension_loaded('swoole') is not evidence that you are running under a Swoole server, since the extension is routinely loaded under php-fpm too, and auto-claiming on it would hijack every FPM request on such a box.

Coroutines are off, on purpose

Quiote keeps process-global state — Config, Context, PluginManager, RoutingCallbackPool, LogContext, $_SESSION, and the per-request hydrated superglobals. Under coroutines two requests interleave inside one worker and stomp all of it: log lines attributed to the wrong request, session data leaking between users.

So the server runs in SWOOLE_BASE with enable_coroutine => false, giving exactly the one-request-at-a-time semantics FrankenPHP and RoadRunner have. Scale with worker.swoole.worker_num, not with coroutines. Setting worker.swoole.enable_coroutine raises an error naming the unsafe state; the worker.swoole.allow_coroutine_unsafe override exists but you own the outcome.

What changes when you leave the SAPI

Behaviour
Superglobals Hydrated per request from the PSR-7 request and cleared afterwards, so Routing, ext/session and other legacy readers keep working.
$_FILES Populated but without tmp_name. Use $request->getUploadedFiles().
Uploads Swoole deletes its temp files when the request ends, so moveTo() must happen during the request — an upload cannot be deferred to a queued job.
header() / setcookie() No-ops. Set headers on the PSR-7 response instead.
Native sessions The Set-Cookie PHP would normally emit itself is synthesised onto the response, so the legacy Quiote\Storage session path still establishes sessions.
echo outside a template Captured and appended to the response body. Configurable via core.worker.stray_output.
SSE / streaming Supported, one write() per event. A write() returning false is the client-disconnect signal, so an endless stream stops when the client goes away — connection_aborted() cannot be used off-SAPI, it always reports 0.
SCRIPT_NAME Swoole supplies none, so it is synthesised (worker.swoole.script_name). Routing reads it when generating URLs, so a wrong value produces wrong links rather than an error.

Settings

Setting Default Meaning
worker.swoole.host 0.0.0.0 Bind address.
worker.swoole.port 8080 Bind port.
worker.swoole.worker_num 1 Worker processes. This is the concurrency knob.
worker.swoole.max_request 0 Requests before Swoole recycles a worker. 0 = never. Keep core.worker.max_requests at 0 and use this instead.
worker.swoole.package_max_length 8388608 Max request body. Swoole silently truncates anything larger.
worker.swoole.script_name /index.php Value for $_SERVER['SCRIPT_NAME'].
worker.swoole.ssl false True only when Swoole itself terminates TLS. Behind a TLS-terminating proxy leave it false and let the X-Forwarded-* handling do the work.
worker.swoole.enable_coroutine false See above.
worker.swoole.allow_coroutine_unsafe false Escape valve for the guard above.

Not supported

OpenSwoole. It is an API-divergent fork (OpenSwoole\Http\Server, a separate extension). The extension surface here is deliberately confined to SwooleRequestSnapshotFactory, SwooleResponseWriter and NativeSwooleServerFactory, so adding it later is three small classes — but it is not claimed today.


All versions of worker-swoole with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5.0
nyholm/psr7 Version ^1.8
quioteframework/quiote Version ^4.0
symfony/console Version ^8.0
symfony/process Version ^8.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 quioteframework/worker-swoole contains the following files

Loading the files please wait ...