Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robsantossilva/config-swoole-in-laravel
Configurando Swoole no Laravel
https://github.com/robsantossilva/config-swoole-in-laravel
laravel laravel7 swoole swooletw
Last synced: about 2 months ago
JSON representation
Configurando Swoole no Laravel
- Host: GitHub
- URL: https://github.com/robsantossilva/config-swoole-in-laravel
- Owner: robsantossilva
- Created: 2020-04-29T21:49:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T19:44:42.000Z (almost 2 years ago)
- Last Synced: 2023-03-04T10:19:06.734Z (almost 2 years ago)
- Topics: laravel, laravel7, swoole, swooletw
- Language: PHP
- Size: 378 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Configurando Swoole no Laravel
#### Prérequisitos
Laravel >= 5.6#### Instalando a extensão
``` bash
$ pecl install swoole$ touch /usr/local/etc/php/conf.d/swoole.ini && \
echo 'extension=swoole.so' > /usr/local/etc/php/conf.d/swoole.ini
```#### Instale o pacote
``` bash
composer require swooletw/laravel-swoole
```#### Gerando arquivos de configuração
``` bash
$ php artisan vendor:publish --tag=laravel-swoole
```/config/swoole_http.php
/config/swoole_websocket.php
/routes/websocket.php#### Comandos
> O swoole_http_server pode ser executado apenas no ambiente cli, e este pacote fornece comandos artesanais convenientes para gerenciá-lo.
> Por padrão, você pode visitar seu site em http://127.0.0.1:1215> `php artisan swoole:http {start|stop|restart|reload|infos}`
| Command | Description |
| --------- | --------- |
| `start` | Start Laravel Swoole, list the processes by *ps aux|grep swoole* |
| `stop` | Stop Laravel Swoole |
| `restart` | Restart Laravel Swoole |
| `reload` | Reload all worker process(Contain your business & Laravel/Lumen codes), excluding master/manger process |
| `infos` | Show PHP and Swoole basic miscs infos(including PHP version, Swoole version, Laravel version, server status and PID) |Agora, você pode executar o seguinte comando para iniciar o servidor HTTP Swoole.
```
$ php artisan swoole:http start
```Você pode mostrar suas informações básicas executando
```
$ php artisan swoole:http infos
``````
+-----------------+-------------------------------------------------------------+
| Name | Value |
+-----------------+-------------------------------------------------------------+
| PHP Version | 7.1.14 |
| Swoole Version | 2.1.1-alpha |
| Laravel Version | 5.6.17 |
| Server Status | Online |
| Listen IP | 127.0.0.1 |
| Listen Port | 1215 |
| Websocket Mode | On |
| PID | 3956 |
| Log Path | /Users/Albert/Projects/laravel/storage/logs/swoole_http.log |
+-----------------+-------------------------------------------------------------+
```