Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resync #2

Merged
merged 227 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
69282bd
improve isWebsocketPushPacket function
albertcht Sep 7, 2018
1b420e2
improve isSwooleQueuePacket function
albertcht Sep 7, 2018
16f8328
Add chunk to response content. Idea form https://blog.csdn.net/weixin…
Sep 21, 2018
f3cb2f9
transform throwable to fatal exception
albertcht Oct 28, 2018
e7a1193
support co::mysql
Nov 20, 2018
24d1a31
update :
Nov 21, 2018
cc436f1
rm configureTimezone
Nov 21, 2018
20b622a
add co::mysql test
Nov 21, 2018
973a0f3
up
Nov 21, 2018
767f606
Merge pull request #165 from Leon-zzk/master
albertcht Dec 13, 2018
6a1fae7
confirm PR 165: fix mysql transaction and task default param
albertcht Dec 13, 2018
b8cea62
fix some wording
albertcht Dec 13, 2018
b996e36
fix exception handler binding for manager test
albertcht Dec 13, 2018
781773d
add some tests for sandbox
albertcht Dec 13, 2018
5d8ee95
Refactoring.
fractalzombie Dec 19, 2018
2fecb4e
Merge branch 'master' into develop
fractalzombie Dec 19, 2018
0e160f2
Refactoring.
fractalzombie Dec 19, 2018
71282d0
Merge pull request #1 from swooletw/develop
hezachary Dec 20, 2018
9f017a0
Fix test cases, fix [Declaration of SwooleTW\Http\Task\SwooleTaskQueu…
Dec 20, 2018
fad180a
quick fix
Dec 20, 2018
4346606
Fix code style for PR.
Dec 20, 2018
4a94b39
Merge pull request #146 from hezachary/develop
albertcht Dec 21, 2018
d6bd635
Merge branch 'develop' into develop
albertcht Dec 21, 2018
b48e2b5
Merge pull request #178 from fractalzombie/develop
albertcht Dec 21, 2018
31034c3
Merge pull request #1 from swooletw/develop
fractalzombie Dec 22, 2018
0b89e1d
More code refactoring.
fractalzombie Dec 22, 2018
74cb96d
Fix Swoole's default srcWorkerId should be -1
Dec 25, 2018
4387383
Fix remove backslash
Dec 25, 2018
6af7b17
Merge pull request #181 from damonto/develop
albertcht Dec 25, 2018
aed922f
More code refactoring.
fractalzombie Dec 31, 2018
ac0c514
Added access log to console.
fractalzombie Dec 31, 2018
a15cf16
Added some tests.
fractalzombie Dec 31, 2018
83635cb
Fix for Carbon.
fractalzombie Dec 31, 2018
01aa16c
Fix for array_sort.
fractalzombie Dec 31, 2018
731fe95
Fix for array_sort.
fractalzombie Dec 31, 2018
a03b0ad
Fix for array_sort.
fractalzombie Dec 31, 2018
d803864
Added test for FSProcess
fractalzombie Dec 31, 2018
7633221
Added test for FSProcess
fractalzombie Dec 31, 2018
940f8dc
Added test for FSProcess
fractalzombie Dec 31, 2018
a0c1f86
Added locked check
fractalzombie Dec 31, 2018
e57125d
Fixed FSEventParser REGEX. I don't know why, but fswatch has two spaces
fractalzombie Jan 7, 2019
c50a714
Fixed FSEventParser REGEX. I don't know why, but fswatch has two spaces
fractalzombie Jan 7, 2019
d28ff60
Merge pull request #183 from fractalzombie/develop
albertcht Jan 8, 2019
f5e3651
fix params for websocket's onOpen function
albertcht Jan 9, 2019
04a32c8
adjust stub files
albertcht Jan 9, 2019
47f9643
fix return type for make function of QueueFactory
albertcht Jan 9, 2019
fc9ec99
remove alias helper for the consistency with Laravel's convention
albertcht Jan 13, 2019
29014dc
fix type hinting for QueueManage
albertcht Jan 13, 2019
62cb989
remove type hinting for queue manager
albertcht Jan 13, 2019
675785d
add type hinting of QueueManager back
albertcht Jan 13, 2019
d225cef
fix type hint for access log in case of JsonResponse
albertcht Jan 13, 2019
5deb0e8
fix ExceptionHandler for rendering throwable exception
albertcht Jan 13, 2019
5477c9a
refactor code in onTask
albertcht Jan 13, 2019
d036c18
set default of access_log to false
albertcht Jan 13, 2019
62e47c9
Merge pull request #188 from swooletw/develop
albertcht Jan 13, 2019
b40fbb8
Update README.md
albertcht Jan 13, 2019
391e168
Update README.md
albertcht Jan 13, 2019
b65df70
add support for Lumen 5.7
albertcht Jan 13, 2019
92d93f9
Merge pull request #189 from swooletw/develop
albertcht Jan 13, 2019
0921a11
Merge branch 'feature/coroutine_feature' into develop
albertcht Jan 13, 2019
7832737
hot fix for laravel's bootstrap in v2.6.0
albertcht Jan 14, 2019
210d9a2
Merge branch 'develop' of https://github.com/swooletw/laravel-swoole …
albertcht Jan 14, 2019
feff91b
Merge pull request #193 from swooletw/develop
albertcht Jan 14, 2019
090e8d7
using MimeType to detect mimetype of file
killtw Jan 18, 2019
1616490
update request test
killtw Jan 18, 2019
b0a42a2
using MimeType if laravel/lumen version great then 5.3
killtw Jan 18, 2019
273f54f
update test
killtw Jan 18, 2019
433474b
get extionsion without query parameters
killtw Jan 24, 2019
6e93bee
using MimeType if laravel version is greater than 5.4
killtw Jan 24, 2019
6e93c57
copy MimeType from Illuminate
killtw Jan 28, 2019
74f2673
Merge pull request #195 from killtw/feature/fix_static_file_mimetype
albertcht Jan 28, 2019
1033684
fix table prepare for websocket room
albertcht Feb 1, 2019
761870e
Merge pull request #204 from swooletw/develop
albertcht Feb 1, 2019
e6bd12d
Remove some unnecessary dependencies
albertcht Feb 2, 2019
f367b73
Merge pull request #206 from swooletw/develop
albertcht Feb 2, 2019
d9237e6
Update Response.php
ashleigh-hopkins Feb 7, 2019
22c775e
Merge pull request #209 from ashleigh-hopkins/master
albertcht Feb 7, 2019
2922c4a
Update Manager.php
marscoo Feb 17, 2019
b6f5b73
refactor websocket pusher
albertcht Mar 2, 2019
d42f22d
Merge pull request #228 from swooletw/master
albertcht Mar 3, 2019
6f2d741
enhance registerDatabaseDriver
albertcht Mar 3, 2019
1952a9a
output error message to console when server error occurred
albertcht Mar 3, 2019
44cb138
comment testGetIlluminateResponse temprarily
albertcht Mar 3, 2019
f0d53cf
exclude testing mode for logServerError
albertcht Mar 3, 2019
dd50b42
test response for debug
albertcht Mar 3, 2019
8fa56e6
test response again
albertcht Mar 3, 2019
e0b9167
Merge pull request #215 from marscoo/support-task_enable_coroutine-op…
albertcht Mar 3, 2019
9a06fd2
Merge pull request #229 from swooletw/master
albertcht Mar 3, 2019
4c8a062
pass full args to task event
albertcht Mar 3, 2019
59828bf
test getIlluminateResponse again
albertcht Mar 3, 2019
9e77280
fix stupid syntax error
albertcht Mar 3, 2019
2a5568a
require minimal laravel version to 5.4 and support 5.8
albertcht Mar 3, 2019
11fe8f0
fix managerTest for mocking event
albertcht Mar 3, 2019
4b1d510
update required dependency version for laravel
albertcht Mar 3, 2019
9184fea
Merge pull request #230 from swooletw/develop
albertcht Mar 3, 2019
705a980
add raw cookie support back to response
albertcht Mar 3, 2019
b341335
check strlen for response content
albertcht Mar 3, 2019
5d1a7d0
revert task_enable_coroutine support
albertcht Mar 5, 2019
0a39cad
adjust chunk size for response to 8k
albertcht Mar 5, 2019
c266951
Merge pull request #233 from swooletw/develop
albertcht Mar 5, 2019
2e64094
fix accessLog middleware in lumen
albertcht Mar 6, 2019
c23a573
fix syntax error
albertcht Mar 6, 2019
ecbb01c
Merge pull request #236 from swooletw/develop
albertcht Mar 6, 2019
ad537b5
require vlucas/phpdotenv
albertcht Mar 6, 2019
bd64155
Merge pull request #237 from swooletw/develop
albertcht Mar 6, 2019
4549f59
Revert "require vlucas/phpdotenv"
albertcht Mar 6, 2019
abd9c7a
Merge pull request #238 from swooletw/develop
albertcht Mar 6, 2019
9783f93
fix HttpServiceProvider for bootWebsocketRoutes
albertcht Mar 7, 2019
fa965b7
make compatible for dotenv 3
albertcht Mar 7, 2019
43c9266
Merge pull request #239 from swooletw/develop
albertcht Mar 7, 2019
06ad668
fix namespace for analyzing if an fd is a websocket payload in onClos…
albertcht Mar 9, 2019
4d28803
fix shouldPushToDescriptor in pusher
albertcht Mar 9, 2019
0f716e2
Merge pull request #243 from swooletw/develop
albertcht Mar 9, 2019
66d64db
fix HttpServiceProvider::configureSwooleServer
kwdwkiss Mar 22, 2019
f3a50c7
Merge pull request #245 from kwdwkiss/clyfix
albertcht Mar 23, 2019
fb6c738
Merge pull request #247 from swooletw/master
albertcht Mar 25, 2019
cd4ddce
drop support for Laravel 5.4 and require swoole 4.3.1
albertcht Mar 25, 2019
b1a3f33
make pusher support swoole 4.3
albertcht Mar 25, 2019
76b1ade
fix withApplication in lumen
albertcht Mar 25, 2019
59db453
change minimal version php and laravel
vodnicearv Mar 30, 2019
04ffc05
Update message attribute datatype in Pusher.php
mabdulazim Mar 31, 2019
cbf0f6e
add dump Helpers
pingcheng Apr 6, 2019
0bcc42c
Fix Server Manager
prolic Apr 9, 2019
44cf3b7
Merge pull request #251 from mabdulazim/patch-1
albertcht Apr 10, 2019
9c09d16
Merge pull request #255 from pingcheng/dev-dump
albertcht Apr 20, 2019
8b74ab9
enhance dumper
albertcht Apr 20, 2019
761715d
Merge pull request #256 from prolic/patch-1
albertcht Apr 20, 2019
5ba982e
Merge pull request #250 from vodniciarv/patch-1
albertcht Apr 20, 2019
768465b
Merge pull request #261 from swooletw/develop
albertcht Apr 20, 2019
acb7f6c
Merge pull request #262 from swooletw/master
albertcht Apr 20, 2019
8b97ba8
Update README.md
albertcht Apr 20, 2019
acc3b7e
Update README.md
albertcht Apr 20, 2019
5b2b08a
Update README.md
albertcht Apr 20, 2019
9abe23f
Fix default options empty mysql user,password
lilianjin May 8, 2019
d7249f9
Merge pull request #268 from lilianjin/patch-1
albertcht May 12, 2019
0cb518c
pid manager.
lilianjin May 13, 2019
74e0e6b
Update PidManagerFactory.php
lilianjin May 13, 2019
62262ca
Update PidManager.php
lilianjin May 13, 2019
e66900d
fix initialization for websocket room
albertcht May 25, 2019
59ded92
fix typo in configuring server process type
albertcht May 25, 2019
04aa0ed
Add PidManagerFactoryTest test instance.
lilianjin May 26, 2019
0667437
Fix bugs.
lilianjin May 27, 2019
f44764a
fix SwooleTW\Http\Server\PidManagerFactory not found.
lilianjin May 27, 2019
f1adf65
remove Psr\Container\ContainerInterface
lilianjin May 27, 2019
499e488
meh
lilianjin May 27, 2019
0c80925
fix.
lilianjin May 27, 2019
1bc5f1c
k
lilianjin May 27, 2019
460c0a5
fix
lilianjin May 27, 2019
85a5a4f
k
lilianjin May 27, 2019
149ea79
add getConfig.
lilianjin May 27, 2019
21a3a07
fix task worker num for showing info
albertcht Jun 2, 2019
277d4a4
Merge pull request #271 from lilianjin/master
albertcht Jun 2, 2019
19e79ac
Merge pull request #282 from swooletw/master
albertcht Jun 2, 2019
3b0d51d
Merge branch 'develop' of https://github.com/swooletw/laravel-swoole …
albertcht Jun 2, 2019
5f1939a
refactor pid manager and add missing tests
albertcht Jun 2, 2019
119726a
fix syntax
albertcht Jun 2, 2019
7368e9d
improve pid info
albertcht Jun 2, 2019
4e9b376
Merge pull request #283 from swooletw/develop
albertcht Jun 2, 2019
d27e2c4
fix style
albertcht Jun 2, 2019
0730611
fix return value
killtw Jun 11, 2019
3447ac6
add swoole/ide-helper package for dev
killtw Jun 11, 2019
02c9f10
add HandShakeHandler
killtw Jun 11, 2019
2bb5297
add test for HandShakeHandler
killtw Jun 11, 2019
7f5fb9e
fix some warnings
killtw Jun 11, 2019
cfd9f90
add config for handshake
killtw Jun 11, 2019
8b71ff0
add onHandShake to InteractsWithWebsocket
killtw Jun 11, 2019
7b0ca35
add onHandShake test
killtw Jun 11, 2019
b7f4d36
fix potential package configuration mismatched in lumen
albertcht Jun 16, 2019
f83b952
fix isServerWebsocket function in InteractsWithWebsocket
albertcht Jun 16, 2019
0f36ee3
Merge pull request #286 from killtw/handshake
albertcht Jun 16, 2019
b3b9d5e
Merge pull request #290 from swooletw/develop
albertcht Jun 16, 2019
7967033
Merge pull request #291 from swooletw/master
albertcht Jun 16, 2019
924363b
improve onHandShake callback
albertcht Jun 16, 2019
5e27069
make pid file compatible with older versions
albertcht Jul 4, 2019
eafc1cf
Merge pull request #302 from swooletw/develop
albertcht Jul 4, 2019
277399f
fix pids in isRunning
albertcht Jul 5, 2019
a787442
Merge pull request #304 from swooletw/develop
albertcht Jul 5, 2019
6c73326
Update Websocket.php
tiamo Jul 26, 2019
719053d
Update Room.php
tiamo Jul 26, 2019
d529bb3
Merge pull request #314 from tiamo/master
albertcht Aug 5, 2019
0351741
fixes for working with websocket in jobs
mxp100 Aug 10, 2019
18b2023
test fixes
mxp100 Aug 11, 2019
61cb4d1
Set request for auth handler
netdown Aug 13, 2019
5e9e768
Merge pull request #319 from mxp100/bugfix/websocket-in-tasks
albertcht Aug 25, 2019
d7e47aa
add missing test for emitInTaskWorker
albertcht Aug 25, 2019
8e27944
Try to fix occasional non-array returned result in RedisRoom.
albertcht Aug 25, 2019
9b2d2c1
Merge pull request #322 from netdown/master
albertcht Aug 25, 2019
8b6ffc0
fix AuthenticateTest
albertcht Aug 25, 2019
dd568be
make date format compatible for hot relooad in different operating sy…
albertcht Sep 15, 2019
9caffc7
add laravel 6.0 to composer.json and travis.yml
albertcht Sep 29, 2019
6f43269
Merge pull request #338 from swooletw/master
albertcht Sep 29, 2019
eaa325e
fix composer.json for laravel 6
albertcht Sep 29, 2019
c79eb3f
Merge pull request #339 from swooletw/develop
albertcht Oct 3, 2019
dfbc1f8
Fix unqueueing cookies
geneccx Nov 6, 2019
e2e6ea6
Merge pull request #352 from geneccx/patch-1
albertcht Dec 1, 2019
947a21b
extract resetters tests and fix cookie resetter test
albertcht Dec 1, 2019
e0e4c38
mock env helper function in tests
albertcht Dec 1, 2019
74f0d2f
There is no session option on 5.8, so fix it
lilianjin Jan 27, 2020
3cf0cd9
Clear context after disabling sandbox
geneccx Mar 3, 2020
6b3732d
Merge pull request #368 from lilianjin/patch-3
albertcht Mar 8, 2020
5a5c359
change status() to getStatusCode()
roboticsexpert Mar 10, 2020
7e815ae
Update composer.json
codercms Mar 10, 2020
13ae63f
Merge pull request #386 from codercms/patch-1
albertcht Mar 29, 2020
db810ce
Merge pull request #381 from geneccx/fix-app-leak
albertcht Mar 29, 2020
2271aa7
Merge pull request #388 from swooletw/develop
albertcht Mar 29, 2020
7db04ae
fix 'swoole_set_process_name' not found error on cygwin platform
May 7, 2020
1d5aef7
fix: change MimeType::get condition
happiness9721 May 11, 2020
42af646
feat: Add test for empty string to MimeType::get
happiness9721 May 11, 2020
9bce1c2
fix handle_static_files config path
Linc70J May 13, 2020
e9de2aa
Replace FatalThrowableError
netdown May 28, 2020
c61511d
Update Websocket.php
netdown Jun 8, 2020
d80e47f
Restore other changes
netdown Jun 8, 2020
fda0a04
fix a spelling error
ramzeng Jun 16, 2020
bb7b890
modify Dumper.php file class name.
HavenShen Jul 23, 2020
7dc0963
Add Laravel 8 support.
TheDoctor0 Sep 8, 2020
b9e6056
Merge pull request #433 from TheDoctor0/master
albertcht Sep 21, 2020
f428360
Merge pull request #424 from icecho/patch-1
albertcht Sep 21, 2020
c033cf9
Merge pull request #427 from HavenShen/fix-dumper
albertcht Sep 21, 2020
2f8bebb
Merge pull request #421 from netdown/netdown-patch-emit-to-non-existi…
albertcht Sep 21, 2020
27a3fed
Merge pull request #411 from Linc70J/patch-1
albertcht Sep 21, 2020
61aa077
Merge pull request #409 from happiness9721/master
albertcht Sep 21, 2020
3ba23e6
Merge pull request #407 from wenstionly/master
albertcht Sep 21, 2020
4167206
Merge pull request #385 from sibche/master
albertcht Sep 21, 2020
3a93e92
Add auth to the pre_resolved as default
Arkanius Oct 1, 2020
254d08a
Merge pull request #437 from Arkanius/patch-1
albertcht Oct 4, 2020
b3e824a
Fix invalid SWOOLE_PROCESS value
m3m0r7 Nov 24, 2020
714cb6d
Merge pull request #451 from memfork/fix-invalid-swoole-process-number
albertcht Nov 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.DS_Store
phpunit.xml
composer.lock
.scannerwork

# Folders
vendor
Expand Down
12 changes: 12 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
build:
environment:
php: 7.2

filter:
excluded_paths:
- "tests/*"
- "routes/*"
- "config/*"
- "stubs/*"
dependency_paths:
- "vendor/*"
24 changes: 11 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@ sudo: false

matrix:
include:
- php: 7.2
env: FRAMEWORK_VERSION=laravel/framework:5.1.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/framework:5.2.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/framework:5.3.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/framework:5.4.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/framework:5.5.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/lumen-framework:5.1.*
env: FRAMEWORK_VERSION=laravel/framework:5.6.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/lumen-framework:5.2.*
env: FRAMEWORK_VERSION=laravel/framework:5.7.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/lumen-framework:5.3.*
env: FRAMEWORK_VERSION=laravel/framework:5.8.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/lumen-framework:5.4.*
env: FRAMEWORK_VERSION=laravel/framework:6.0.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/lumen-framework:5.5.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/lumen-framework:5.6.*
- php: 7.2
env: FRAMEWORK_VERSION=laravel/lumen-framework:5.7.*
# - php: 7.2
# env: FRAMEWORK_VERSION=laravel/lumen-framework:5.8.*

before_install:
- printf "\n" | pecl install swoole
Expand All @@ -37,4 +35,4 @@ script:
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_success:
- vendor/bin/coveralls -v
- vendor/bin/php-coveralls -v
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Laravel-Swoole

![php-badge](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg)
![php-badge](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)
[![packagist-badge](https://img.shields.io/packagist/v/swooletw/laravel-swoole.svg)](https://packagist.org/packages/swooletw/laravel-swoole)
[![Total Downloads](https://poser.pugx.org/swooletw/laravel-swoole/downloads)](https://packagist.org/packages/swooletw/laravel-swoole)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/swooletw/laravel-swoole/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/swooletw/laravel-swoole/?branch=master)
Expand All @@ -12,7 +12,7 @@ This package provides a high performance HTTP server to speed up your Laravel/Lu

| PHP | Laravel | Lumen | Swoole |
|:-------:|:-------:|:-----:|:-------:|
| >=7.1 | ~5.1 | ~5.1 | >=4.0.0 |
| >=7.2 | >=5.5 | >=5.5 | >=4.3.1 |

## Features

Expand Down
125 changes: 69 additions & 56 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,73 @@
{
"name": "swooletw/laravel-swoole",
"description": "High performance HTTP server based on Swoole. Speed up your Laravel and Lumen applications.",
"keywords": ["swoole", "laravel", "lumen", "performance", "http", "server"],
"license": "MIT",
"authors": [
{
"name": "Albert Chen",
"email": "albert@unisharp.com"
},
{
"name": "Huang Yi",
"email": "coodeer@163.com"
}
],
"require": {
"php": "^7.1",
"illuminate/console": "~5.1",
"illuminate/contracts": "~5.1",
"illuminate/http": "~5.1",
"illuminate/support": "~5.1",
"predis/predis": "^1.1"
},
"require-dev": {
"laravel/lumen-framework": "~5.1",
"phpunit/phpunit": "^6.1",
"phpunit/php-code-coverage": "^5.2",
"satooshi/php-coveralls": "^1.0",
"mockery/mockery": "~1.0",
"codedungeon/phpunit-result-printer": "^0.14.0",
"php-mock/php-mock": "^2.0"
},
"autoload": {
"files": [
"src/Server/helpers.php"
],
"psr-4": {
"SwooleTW\\Http\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"SwooleTW\\Http\\Tests\\": "tests",
"SwooleTW\\Http\\Tests\\Fixtures\\Laravel\\App\\": "tests/fixtures/laravel/app"
}
"name": "swooletw/laravel-swoole",
"description": "High performance HTTP server based on Swoole. Speed up your Laravel and Lumen applications.",
"keywords": [
"swoole",
"laravel",
"lumen",
"performance",
"http",
"server"
],
"license": "MIT",
"authors": [
{
"name": "Albert Chen",
"email": "albert@unisharp.com"
},
"extra": {
"laravel": {
"providers": [
"SwooleTW\\Http\\LaravelServiceProvider"
],
"aliases": {
"Server": "SwooleTW\\Http\\Server\\Facades\\Server",
"Table": "SwooleTW\\Http\\Server\\Facades\\Table",
"Room": "SwooleTW\\Http\\Websocket\\Facades\\Room",
"Websocket": "SwooleTW\\Http\\Websocket\\Facades\\Websocket"
}
}
{
"name": "Huang Yi",
"email": "coodeer@163.com"
}
],
"require": {
"php": "^7.2",
"illuminate/console": "~5.4|~6.0|~7.0|~8.0",
"illuminate/contracts": "~5.4|~6.0|~7.0|~8.0",
"illuminate/http": "~5.4|~6.0|~7.0|~8.0",
"illuminate/support": "~5.4|~6.0|~7.0|~8.0",
"predis/predis": "^1.1"
},
"require-dev": {
"laravel/lumen-framework": "~5.4|~6.0|~7.0|~8.0",
"phpunit/phpunit": "^7.5",
"phpunit/php-code-coverage": "^6.1",
"php-coveralls/php-coveralls": "^2.1",
"mockery/mockery": "~1.0",
"codedungeon/phpunit-result-printer": "^0.14.0",
"php-mock/php-mock": "^2.0",
"swoole/ide-helper": "@dev"
},
"autoload": {
"files": [
"src/Server/helpers.php"
],
"psr-4": {
"SwooleTW\\Http\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"SwooleTW\\Http\\Tests\\": "tests",
"SwooleTW\\Http\\Tests\\Fixtures\\Laravel\\App\\": "tests/fixtures/laravel/app"
}
},
"extra": {
"laravel": {
"providers": [
"SwooleTW\\Http\\LaravelServiceProvider"
],
"aliases": {
"Server": "SwooleTW\\Http\\Server\\Facades\\Server",
"Table": "SwooleTW\\Http\\Server\\Facades\\Table",
"Room": "SwooleTW\\Http\\Websocket\\Facades\\Room",
"Websocket": "SwooleTW\\Http\\Websocket\\Facades\\Websocket"
}
}
},
"scripts": {
"post-autoload-dump": [
"@php copy_versioned_files.php"
]
}
}
21 changes: 17 additions & 4 deletions config/swoole_http.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

use Swoole\Table;

return [
/*
|--------------------------------------------------------------------------
Expand All @@ -17,9 +15,11 @@
'public_path' => base_path('public'),
// Determine if to use swoole to respond request for static files
'handle_static_files' => env('SWOOLE_HANDLE_STATIC', true),
'access_log' => env('SWOOLE_HTTP_ACCESS_LOG', false),
// You must add --enable-openssl while compiling Swoole
// Put `SWOOLE_SOCK_TCP | SWOOLE_SSL` if you want to enable SSL
'socket_type' => SWOOLE_SOCK_TCP,
'process_type' => SWOOLE_PROCESS,
'options' => [
'pid_file' => env('SWOOLE_HTTP_PID_FILE', base_path('storage/logs/swoole_http.pid')),
'log_file' => env('SWOOLE_HTTP_LOG_FILE', base_path('storage/logs/swoole_http.log')),
Expand Down Expand Up @@ -53,6 +53,19 @@
'enabled' => env('SWOOLE_HTTP_WEBSOCKET', false),
],

/*
|--------------------------------------------------------------------------
| Hot reload configuration
|--------------------------------------------------------------------------
*/
'hot_reload' => [
'enabled' => env('SWOOLE_HOT_RELOAD_ENABLE', false),
'recursively' => env('SWOOLE_HOT_RELOAD_RECURSIVELY', true),
'directory' => env('SWOOLE_HOT_RELOAD_DIRECTORY', base_path()),
'log' => env('SWOOLE_HOT_RELOAD_LOG', true),
'filter' => env('SWOOLE_HOT_RELOAD_FILTER', '.php'),
],

/*
|--------------------------------------------------------------------------
| Console output will be transferred to response content if enabled.
Expand All @@ -68,7 +81,7 @@
'pre_resolved' => [
'view', 'files', 'session', 'session.store', 'routes',
'db', 'db.factory', 'cache', 'cache.store', 'config', 'cookie',
'encrypter', 'hash', 'router', 'translator', 'url', 'log',
'encrypter', 'hash', 'router', 'translator', 'url', 'log', 'auth',
],

/*
Expand Down Expand Up @@ -120,5 +133,5 @@
// ['name' => 'column_name', 'type' => Table::TYPE_STRING, 'size' => 1024],
// ]
// ],
]
],
];
14 changes: 12 additions & 2 deletions config/swoole_websocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
// SwooleTW\Http\Websocket\Middleware\Authenticate::class,
],

/*
|--------------------------------------------------------------------------
| Websocket handler for customized onHandShake callback
|--------------------------------------------------------------------------
*/
'handshake' => [
'enabled' => false,
'handler' => SwooleTW\Http\Websocket\HandShakeHandler::class,
],

/*
|--------------------------------------------------------------------------
| Default websocket driver
Expand Down Expand Up @@ -77,7 +87,7 @@
'room_rows' => 4096,
'room_size' => 2048,
'client_rows' => 8192,
'client_size' => 2048
'client_size' => 2048,
],

'redis' => [
Expand All @@ -92,6 +102,6 @@
//
],
'prefix' => 'swoole:',
]
],
],
];
33 changes: 33 additions & 0 deletions copy_versioned_files.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

require __DIR__.'/vendor/autoload.php';

use SwooleTW\Http\Helpers\FW;
use SwooleTW\Http\Task\QueueFactory;
use SwooleTW\Http\Coroutine\Connectors\ConnectorFactory;

try {
$framework = ucfirst(FW::current());
$version = FW::version();
} catch (Throwable $e) {
echo "No files were generated.\n";
die;
}

$color = "\033[0;32m";
$noColor = "\033[0m";
$stubs = [];

/* Copy queue class */
$stub = QueueFactory::stub($version);
QueueFactory::copy($stub, true);
$stubs[] = $stub;

/* Copy connector class */
$stub = ConnectorFactory::stub($version);
ConnectorFactory::copy($stub, true);
$stubs[] = $stub;

foreach ($stubs as $stub) {
echo "{$color}{$framework}{$noColor}: {$color}{$version}{$noColor}. Successfully copied stub: {$color}{$stub}{$noColor}\n";
}
10 changes: 5 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
stopOnFailure="false"
verbose="true"
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer">
<testsuites>
<testsuite name="Laravel Swoole Http Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<testsuites>
<testsuite name="Laravel Swoole Http Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<const name="IN_PHPUNIT" value="true"/>
</php>
Expand Down
1 change: 1 addition & 0 deletions routes/laravel_routes.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php


use Illuminate\Support\Facades\Route;

/*
Expand Down
9 changes: 2 additions & 7 deletions routes/lumen_routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,5 @@
|
*/

$app->get('socket.io', [
'as' => 'io.get', 'uses' => 'SocketIOController@upgrade'
]);

$app->post('socket.io', [
'as' => 'io.post', 'uses' => 'SocketIOController@reject'
]);
$router->get('socket.io', ['uses' => 'SocketIOController@upgrade']);
$router->post('socket.io', ['uses' => 'SocketIOController@reject']);
3 changes: 1 addition & 2 deletions routes/websocket.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php


use Illuminate\Http\Request;
use SwooleTW\Http\Websocket\Facades\Websocket;

Expand All @@ -23,5 +24,3 @@
Websocket::on('example', function ($websocket, $data) {
$websocket->emit('message', $data);
});

// Websocket::on('test', 'ExampleController@method');
Loading