```
_ _ _____
| | | |/ ____|
| | __ _ _ __ __ ___ _____| | (___
| | / _` | '__/ _` \ \ / / _ \ |\___ \
| |___| (_| | | | (_| |\ V / __/ |____) |
|______\__,_|_| \__,_| \_/ \___|_|_____/
```
> ð LaravelS is `an out-of-the-box adapter` between Swoole and Laravel/Lumen.
*Please `Watch` this repository to get the latest updates.*
[![Latest Stable Version](https://poser.pugx.org/hhxsv5/laravel-s/v/stable.svg)](https://packagist.org/packages/hhxsv5/laravel-s)
[![Latest Unstable Version](https://poser.pugx.org/hhxsv5/laravel-s/v/unstable.svg)](https://packagist.org/packages/hhxsv5/laravel-s)
[![Total Downloads](https://poser.pugx.org/hhxsv5/laravel-s/downloads.svg)](https://packagist.org/packages/hhxsv5/laravel-s)
[![License](https://poser.pugx.org/hhxsv5/laravel-s/license.svg)](https://github.com/hhxsv5/laravel-s/blob/master/LICENSE)
[![Build Status](https://travis-ci.com/hhxsv5/laravel-s.svg?branch=master)](https://travis-ci.com/hhxsv5/laravel-s)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/hhxsv5/laravel-s/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)
<!-- [![Total Lines](https://tokei.rs/b1/github/hhxsv5/laravel-s)](https://github.com/hhxsv5/laravel-s) -->
<!-- [![Code Coverage](https://scrutinizer-ci.com/g/hhxsv5/laravel-s/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/hhxsv5/laravel-s/?branch=master) -->
**[ä¸æææ¡£](https://github.com/hhxsv5/laravel-s/blob/master/README-CN.md)**
Table of Contents
=================
* [Features](#features)
* [Benchmark](#benchmark)
* [Requirements](#requirements)
* [Install](#install)
* [Run](#run)
* [Deploy](#deploy)
* [Cooperate with Nginx (Recommended)](#cooperate-with-nginx-recommended)
* [Cooperate with Apache](#cooperate-with-apache)
* [Enable WebSocket server](#enable-websocket-server)
* [Listen events](#listen-events)
* [System events](#system-events)
* [Customized asynchronous events](#customized-asynchronous-events)
* [Asynchronous task queue](#asynchronous-task-queue)
* [Millisecond cron job](#millisecond-cron-job)
* [Automatically reload after modifying code](#automatically-reload-after-modifying-code)
* [Get the instance of SwooleServer in your project](#get-the-instance-of-swooleserver-in-your-project)
* [Use SwooleTable](#use-swooletable)
* [Multi-port mixed protocol](#multi-port-mixed-protocol)
* [Coroutine](#coroutine)
* [Custom process](#custom-process)
* [Common components](#common-components)
* [Apollo](#apollo)
* [Other features](#other-features)
* [Configure Swoole events](#configure-swoole-events)
* [Serverless](#serverless)
* [Important notices](#important-notices)
* [Users and cases](https://github.com/hhxsv5/laravel-s/blob/master/README-CN.md#%E7%94%A8%E6%88%B7%E4%B8%8E%E6%A1%88%E4%BE%8B)
* [Alternatives](#alternatives)
* [Sponsor](#sponsor)
* [License](#license)
## Features
- Built-in Http/[WebSocket](https://github.com/hhxsv5/laravel-s/blob/master/README.md#enable-websocket-server) server
- [Multi-port mixed protocol](https://github.com/hhxsv5/laravel-s/blob/master/README.md#multi-port-mixed-protocol)
- [Custom process](https://github.com/hhxsv5/laravel-s/blob/master/README.md#custom-process)
- Memory resident
- [Asynchronous event listening](https://github.com/hhxsv5/laravel-s/blob/master/README.md#customized-asynchronous-events)
- [Asynchronous task queue](https://github.com/hhxsv5/laravel-s/blob/master/README.md#asynchronous-task-queue)
- [Millisecond cron job](https://github.com/hhxsv5/laravel-s/blob/master/README.md#millisecond-cron-job)
- [Common Components](https://github.com/hhxsv5/laravel-s/blob/master/README.md#common-components)
- Gracefully reload
- [Automatically reload after modifying code](https://github.com/hhxsv5/laravel-s/blob/master/README.md#automatically-reload-after-modifying-code)
- Support Laravel/Lumen both, good compatibility
- Simple & Out of the box
## Benchmark
- [Which is the fastest web framework?](https://github.com/the-benchmarker/web-frameworks)
- [TechEmpower Framework Benchmarks](https://www.techempower.com/benchmarks/)
## Requirements
| Dependency | Requirement |
| -------- | -------- |
| [PHP](https://secure.php.net/manual/en/install.php) | `>= 5.5.9` `Recommend PHP7+` |
| [Swoole](https://www.swoole.co.uk/) | `>= 1.7.19` `No longer support PHP5 since 2.0.12` `Recommend 4.2.3+` |
| [Laravel](https://laravel.com/)/[Lumen](https://lumen.laravel.com/) | `>= 5.1` `Recommend 5.6+` |
## Install
1.Require package via [Composer](https://getcomposer.org/)([packagist](https://packagist.org/packages/hhxsv5/laravel-s)).
```bash
composer require "hhxsv5/laravel-s:~3.7.0" -vvv
# Make sure that your composer.lock file is under the VCS
```
2.Register service provider(pick one of two).
- `Laravel`: in `config/app.php` file, `Laravel 5.5+ supports package discovery automatically, you should skip this step`
```php
'providers' => [
//...
Hhxsv5\LaravelS\Illuminate\LaravelSServiceProvider::class,
],
```
- `Lumen`: in `bootstrap/app.php` file
```php
$app->register(Hhxsv5\LaravelS\Illuminate\LaravelSServiceProvider::class);
```
3.Publish configuration and binaries.
> *After upgrading LaravelS, you need to republish; click [here](https://github.com/hhxsv5/laravel-s/releases) to see the change notes of each version.*
```bash
php artisan laravels publish
# Configuration: config/laravels.php
# Binary: bin/laravels bin/fswatch bin/inotify
```
4.Change `config/laravels.php`: listen_ip, listen_port, refer [Settings](https://github.com/hhxsv5/laravel-s/blob/master/Settings.md).
5.Performance tuning
- [Adjust kernel parameters](https://wiki.swoole.com/#/other/sysctl?id=%e5%86%85%e6%a0%b8%e5%8f%82%e6%95%b0%e8%b0%83%e6%95%b4)
- [Number of Workers](https://www.swoole.co.uk/docs/modules/swoole-server/configuration#worker_num): LaravelS uses Swoole's `Synchronous IO` mode, so the larger the `worker_num` setting, the better the concurrency performance, but it will also cause more memory usage and process switching overhead, so incremental pressure testing is needed to get the best` worker_num`.
- [Number of Task Workers](https://www.swoole.co.uk/docs/modules/swoole-server/configuration#task_worker_num)
## Run
> `Please read the notices carefully before running`, [Important notices](https://github.com/hhxsv5/laravel-s#important-notices)(IMPORTANT).
- Commands: `php bin/laravels {start|stop|restart|reload|info|help}`.
| Command | Description |
| --------- | --------- |
| start | Start LaravelS, list the processes by "*ps -ef|grep laravels*" |
| stop | Stop LaravelS, and trigger the method `onStop` of Custom process |
| restart | Restart LaravelS: Stop gracefully before starting; The service is `unavailable` until startup is complete |
| reload | Reload all Task/Worker/Timer processes which contain your business codes, and trigger the method `onReload` of Custom process, CANNOT reload Master/Manger processes. After modifying `config/laravels.php`, you `only` have to call `restart` to restart |
| info | Display component version information |
| help | Display help information |
- Boot options for the commands `start` and `restart`.
| Option | Description |
| --------- | --------- |
| -d|--daemonize | Run as a daemon, this option will override the `swoole.daemonize` setting in `laravels.php` |
| -e|--env | The environment the command should run under, such as `--env=testing` will use the configuration file `.env.testing` firstly, this feature requires Laravel 5.2+ |
| -i|--ignore | Ignore checking PID file of Master process |
| -x|--x-version | The version(branch) of the current project, stored in $_ENV/$_SERVER, access via `$_ENV['X_VERSION']` `$_SERVER['X_VERSION']` `$request->server->get('X_VERSION')` |
- `Runtime` files: `start` will automatically execute `php artisan larave
没有合适的资源?快使用搜索试试~ 我知道了~
基于PHP的Chemexl开源资产管理运维平台.zip
共2000个文件
php:9157个
js:1372个
css:339个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 27 浏览量
2023-07-18
00:17:06
上传
评论
收藏 80.57MB ZIP 举报
温馨提示
基于PHP的Chemexl开源资产管理运维平台.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP的Chemexl开源资产管理运维平台.zip (2000个子文件)
adminlte-blue.css 656KB
adminlte-blue.css 656KB
adminlte-green.css 656KB
adminlte.css 656KB
adminlte.css 656KB
adminlte-green.css 656KB
adminlte-blue-light.css 656KB
adminlte-blue-light.css 656KB
vendors-rtl.min.css 219KB
vendors-rtl.min.css 219KB
vendors.min.css 170KB
vendors.min.css 170KB
vendors.min.css 170KB
font-awesome.min.css 158KB
font-awesome.min.css 158KB
font-awesome.min.css 158KB
bootstrap.min.css 157KB
bootstrap.css 123KB
bootstrap.min.css 100KB
editormd.css 76KB
editormd.css 76KB
editormd.css 76KB
dcat-app.css 68KB
dcat-app-green.css 68KB
dcat-app-blue.css 68KB
dcat-app-green.css 68KB
dcat-app-blue.css 68KB
dcat-app.css 68KB
dcat-app-blue-light.css 68KB
dcat-app-blue-light.css 68KB
editormd.min.css 60KB
editormd.min.css 60KB
editormd.min.css 60KB
editormd.preview.css 55KB
editormd.preview.css 55KB
editormd.preview.css 55KB
skin.min.css 55KB
skin.min.css 55KB
skin.min.css 55KB
skin.min.css 55KB
skin.min.css 55KB
skin.min.css 55KB
editormd.preview.min.css 44KB
editormd.preview.min.css 44KB
editormd.preview.min.css 44KB
font-awesome.css 37KB
font-awesome.css 37KB
font-awesome.css 37KB
style.css 32KB
style.css 32KB
style.css 32KB
style.css 29KB
style.css 29KB
style.css 29KB
style.min.css 27KB
style.min.css 27KB
style.min.css 27KB
sweetalert2.min.css 26KB
sweetalert2.min.css 26KB
sweetalert2.min.css 26KB
ambiance.css 26KB
ambiance.css 26KB
ambiance.css 26KB
style.min.css 25KB
style.min.css 25KB
style.min.css 25KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
bootstrap-theme.css 19KB
select2.css 18KB
select2.css 18KB
select2.css 18KB
content.min.css 18KB
content.min.css 18KB
content.min.css 18KB
content.inline.min.css 18KB
content.inline.min.css 18KB
content.inline.min.css 18KB
content.inline.min.css 18KB
content.inline.min.css 18KB
content.inline.min.css 18KB
content.min.css 17KB
content.min.css 17KB
content.min.css 17KB
bootstrap-theme.min.css 17KB
select2.min.css 15KB
select2.min.css 15KB
select2.min.css 15KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
datatables.min.css 14KB
datatables.min.css 14KB
datatables.min.css 14KB
exception.css 14KB
iconfont.css 13KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
助力毕业
- 粉丝: 2177
- 资源: 5134
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功