mezzio / mezzio-swoole
Swoole support for Mezzio
Fund package maintenance!
Community Bridge
Installs: 199 823
Dependents: 6
Suggesters: 0
Security: 1
Stars: 89
Watchers: 16
Forks: 28
Open Issues: 15
Requires
- php: ~8.2.0 || ~8.3.0
- dflydev/fig-cookies: ^2.0.1 || ^3.0
- laminas/laminas-cli: ^1.8
- laminas/laminas-diactoros: ^2.25.2 || ^3.0
- laminas/laminas-httphandlerrunner: ^2.5
- mezzio/mezzio: ^3.15
- psr/container: ^1.1.2 || ^2.0.2
- psr/event-dispatcher: ^1.0
- psr/http-message: ^1.1 || ^2.0
- psr/http-message-implementation: ^1.0 || ^2.0
- psr/http-server-handler: ^1.0.2
- psr/log: ^1.0 || ^2.0 || ^3.0
- symfony/console: ^5.3 || ^6.0.19 || ^7.0
- webmozart/assert: ^1.11
Requires (Dev)
- filp/whoops: ^2.15.2
- laminas/laminas-coding-standard: ~2.5.0
- laminas/laminas-servicemanager: ^3.20
- phpunit/phpunit: ^10.5
- psalm/plugin-phpunit: ^0.18.4
- swoole/ide-helper: ^5.0.3
- vimeo/psalm: ^5.19
Suggests
- ext-inotify: To use inotify based file watcher. Required for hot code reloading.
- ext-openswoole: The package requires at least one of Open Swoole or Swoole
- ext-swoole: The package requires at least one of Open Swoole or Swoole
Conflicts
- 4.11.x-dev
- 4.10.x-dev
- 4.10.0
- 4.9.x-dev
- 4.9.0
- 4.8.x-dev
- 4.8.0
- 4.7.x-dev
- 4.7.0
- 4.6.x-dev
- 4.6.0
- 4.5.x-dev
- 4.5.0
- 4.4.x-dev
- 4.4.0
- 4.3.x-dev
- 4.3.0
- 4.2.x-dev
- 4.2.0
- 4.1.x-dev
- 4.1.1
- 4.1.0
- 4.0.x-dev
- 4.0.0
- 3.7.x-dev
- 3.7.0
- 3.6.x-dev
- 3.6.0
- 3.5.x-dev
- 3.5.1
- 3.5.0
- 3.4.x-dev
- 3.4.0
- 3.3.x-dev
- 3.3.1
- 3.3.0
- 3.2.x-dev
- 3.2.1
- 3.2.0
- 3.1.x-dev
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.x-dev
- 3.0.1
- 3.0.0
- 2.8.x-dev
- 2.8.1
- 2.8.0
- 2.7.x-dev
- 2.7.0
- 2.6.x-dev
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
- dev-renovate/all-minor-patch
- dev-renovate/lock-file-maintenance
- dev-renovate/major-laminas
- dev-renovate/phpunit-phpunit-11.x
This package is auto-updated.
Last update: 2024-11-21 23:21:04 UTC
README
π·πΊ Π ΡΡΡΠΊΠΈΠΌ Π³ΡΠ°ΠΆΠ΄Π°Π½Π°ΠΌ
ΠΡ, ΡΡΠ°ΡΡΠ½ΠΈΠΊΠΈ Laminas, ΡΠΎΠ΄ΠΈΠ»ΠΈΡΡ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² ΡΠ°Π·Π½ΡΡ ΡΡΡΠ°Π½Π°Ρ . Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ ΠΈΠ· Π½Π°Ρ Π΅ΡΡΡ Π΄ΡΡΠ·ΡΡ, ΡΠΎΠ΄ΡΡΠ²Π΅Π½Π½ΠΈΠΊΠΈ ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² Π ΠΎΡΡΠΈΠΈ, ΡΠ°ΠΊ ΠΈ Π² Π£ΠΊΡΠ°ΠΈΠ½Π΅. ΠΠ΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΠ· Π½Π°Ρ ΡΠΎΠ΄ΠΈΠ»ΠΈΡΡ Π² Π ΠΎΡΡΠΈΠΈ. ΠΠ΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΠ· Π½Π°Ρ ΠΆΠΈΠ²ΡΡ Π² Π ΠΎΡΡΠΈΠΈ. Π£ Π½Π΅ΠΊΠΎΡΠΎΡΡΡ Π±Π°Π±ΡΡΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡΡΠΊΠΈ ΡΡΠ°ΠΆΠ°Π»ΠΈΡΡ Ρ ΡΠ°ΡΠΈΡΡΠ°ΠΌΠΈ Π²ΠΎ ΠΡΠΎΡΠΎΠΉ ΠΌΠΈΡΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. ΠΠ΄Π΅ΡΡ Π½ΠΈΠΊΡΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅Ρ ΡΠ°ΡΠΈΠ·ΠΌ.
Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· Π½Π°Ρ Π΅ΡΡΡ ΡΠΊΡΠ°ΠΈΠ½ΡΠΊΠ°Ρ ΡΠΎΠ΄ΡΡΠ²Π΅Π½Π½ΠΈΡΠ°, ΠΊΠΎΡΠΎΡΠ°Ρ ΡΠΏΠ°ΡΠ»Π°ΡΡ ΠΈΠ· Π΄ΠΎΠΌΠ° Π²ΠΌΠ΅ΡΡΠ΅ Ρ ΡΡΠ½ΠΎΠΌ. ΠΠΎΠ΅Π·Π΄ Π·Π°Π΄Π΅ΡΠΆΠ°Π»ΡΡ ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡΠΎΠ³Π΅ Π²ΠΏΠ΅ΡΠ΅Π΄ΠΈ. Π£ Π½Π°Ρ Π΅ΡΡΡ Π΄ΡΡΠ·ΡΡ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΡΡΡΡΡΡΡ Π² Π±ΠΎΠΌΠ±ΠΎΡΠ±Π΅ΠΆΠΈΡΠ°Ρ . ΠΡ Ρ ΡΡΠ΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ Π²Π΅ΡΡΠΎΡΠΊΠΈ ΠΎΡ Π½ΠΈΡ ΠΏΠΎΡΠ»Π΅ Π²ΠΎΠ·Π΄ΡΡΠ½ΡΡ Π½Π°Π»Π΅ΡΠΎΠ², ΠΊΠΎΡΠΎΡΡΠ΅ Π±Π΅ΡΠΏΠΎΡΡΠ΄ΠΎΡΠ½ΠΎ Π½Π°Π½ΠΎΡΡΡ ΡΠ΄Π°ΡΡ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡΡ ΠΏΠΎ Π±ΠΎΠ»ΡΠ½ΠΈΡΠ°ΠΌ, ΡΠΊΠΎΠ»Π°ΠΌ, Π΄Π΅ΡΡΠΊΠΈΠΌ ΡΠ°Π΄Π°ΠΌ ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠΡ Π½Π΅ Π±Π΅ΡΠ΅ΠΌ ΡΡΠΎ ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ -Π»ΠΈΠ±ΠΎ Π‘ΠΠ. ΠΡ Π½Π°Π±Π»ΡΠ΄Π°Π΅ΠΌ ΡΡΠΎ Π½Π°ΠΏΡΡΠΌΡΡ.
ΠΡ Π΄ΠΎΠ²Π΅ΡΡΠ΅ΡΠ΅ Π½Π°ΠΌ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ, ΡΡΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Π½Π°ΡΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, ΠΈ ΠΌΡ ΠΏΡΠΎΡΠΈΠΌ Π²Π°Ρ Π΄ΠΎΠ²Π΅ΡΠΈΡΡΡΡ Π½Π°ΠΌ Π²Π½ΠΎΠ²Ρ. ΠΡ Π½ΡΠΆΠ΄Π°Π΅ΠΌΡΡ Π² ΠΏΠΎΠΌΠΎΡΠΈ. ΠΡΡ ΠΎΠ΄ΠΈΡΠ΅ ΠΈ ΠΏΡΠΎΡΠ΅ΡΡΡΠΉΡΠ΅ ΠΏΡΠΎΡΠΈΠ² ΡΡΠΎΠΉ Π±Π΅ΡΠΏΠΎΠ»Π΅Π·Π½ΠΎΠΉ Π²ΠΎΠΉΠ½Ρ. ΠΡΡΠ°Π½ΠΎΠ²ΠΈΡΠ΅ ΠΊΡΠΎΠ²ΠΎΠΏΡΠΎΠ»ΠΈΡΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡΠ΅ "ΠΠ΅Ρ Π²ΠΎΠΉΠ½Π΅!"
πΊπΈ To Citizens of Russia
We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"
This library provides support for Swoole or Open Swoole for Mezzio applications. This means you can execute your Mezzio application using Swoole directly from the command line.
Installation
Run the following to install this library:
$ composer require mezzio/mezzio-swoole
Configuration
After installing mezzio-swoole, you will need to first enable the component, and then optionally configure it.
We recommend adding a new configuration file to your autoload directory, config/autoload/swoole.local.php
.
To begin with, use the following contents:
<?php use Mezzio\Swoole\ConfigProvider; return array_merge((new ConfigProvider())(), []);
The above will setup Swoole integration for your application.
By default, Swoole executes the HTTP server with host 127.0.0.1
on port 8080
.
You can change these values via configuration.
Assuming you have the above, modify it to read as follows:
<?php use Mezzio\Swoole\ConfigProvider; return array_merge((new ConfigProvider())(), [ 'mezzio-swoole' => [ 'swoole-http-server' => [ 'host' => 'insert hostname to use here', 'port' => 80, // use an integer value here ], ], ]);
Mezzio skeleton 3.1.0 and later
If you have built your application on the 3.1.0 or later version of the Mezzio skeleton, you do not need to instantiate and invoke the package's
ConfigProvider
, as the skeleton supports it out of the box.You will only need to provide any additional configuration of the HTTP server.
Execute
Once you have performed the configuration steps as outlined above, you can run an Mezzio application with Swoole via the laminas-cli integration:
$ ./vendor/bin/laminas mezzio:swoole:start
Call the laminas
command without arguments to get a list of available commands, looking for those that begin with mezzio:swoole:
, and use the help
meta-argument to get help on individual commands:
$ ./vendor/bin/laminas help mezzio:swoole:start
Documentation
Browse the documentation online at https://docs.mezzio.dev/mezzio-swoole/