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

Feat di upgrade #139

Merged
merged 77 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e2e7498
Add req&res classes
Meldiron Mar 8, 2024
662f7f9
Fixed status code 451
eldadfux Apr 1, 2024
111da1c
Merge remote-tracking branch 'origin/master' into feat-framework-v2
eldadfux Apr 3, 2024
5db6b13
Work in progress
eldadfux Apr 4, 2024
90cd4e6
Fixed method mixup
eldadfux Apr 4, 2024
b263f10
Tests...
eldadfux Apr 4, 2024
654a917
Fixed test
eldadfux Apr 4, 2024
241aebf
Fixed a few more tests
eldadfux Apr 5, 2024
4351e83
Update benchmark
eldadfux Apr 5, 2024
f5abb5f
Updated benchmark
eldadfux Apr 7, 2024
590eb6f
Deprecated swoole request and response getters
eldadfux Apr 8, 2024
6359661
Improved tests
eldadfux Apr 8, 2024
93b8568
Fixed tests
eldadfux Apr 8, 2024
dc646e2
tests
eldadfux Apr 8, 2024
e268ec3
Fixed format
eldadfux Apr 8, 2024
1daba1c
Fixed tests
eldadfux Apr 8, 2024
afc610e
Fixed code analysis
eldadfux Apr 8, 2024
05bec61
Changed dependency method to inject
eldadfux Apr 8, 2024
bf05cca
Updated composer.lock
eldadfux Apr 8, 2024
23829ef
Fixed test
eldadfux Apr 9, 2024
ea0cfc3
Cleanups
eldadfux Apr 9, 2024
5a5fd25
Updated composer
eldadfux Apr 9, 2024
b76d415
Added more tests
eldadfux Apr 9, 2024
0bfe44c
Deprecated request hooks
eldadfux Apr 9, 2024
cde62b8
Test public swoole
eldadfux Apr 9, 2024
524f5d4
Updated lock file
eldadfux Apr 10, 2024
5434c04
Updated tests
eldadfux Apr 10, 2024
1221d45
Updated tests
eldadfux Apr 10, 2024
995dacb
Added test logs
eldadfux Apr 11, 2024
bb1421a
Removed logs
eldadfux Apr 11, 2024
ac7940b
Added DBPool test
eldadfux Apr 12, 2024
08e70ee
Test
eldadfux Apr 13, 2024
efb7331
Isolated server start context
eldadfux Apr 13, 2024
22e634e
Run event in coroutine
eldadfux Apr 13, 2024
b303e29
Fixed typo
eldadfux Apr 13, 2024
1d8ced9
Fixed callback
eldadfux Apr 13, 2024
aef4e9a
Fixed arg count
eldadfux Apr 13, 2024
d600ae2
Fixed bug with params
eldadfux Apr 14, 2024
5905398
Always return Route, added not found test
eldadfux Apr 14, 2024
9b0916f
Test base server
eldadfux Apr 18, 2024
488706f
Update TESTING argument in Dockerfile.swoole
eldadfux Apr 18, 2024
06a134c
Updated deps
eldadfux Apr 18, 2024
1c1b5a3
Fixed format
eldadfux Apr 18, 2024
6e9715f
Fixed format tests
eldadfux Apr 18, 2024
62c2b5b
Fixed autolaoding
eldadfux Apr 18, 2024
e84ceae
Fixed inheritance
eldadfux Apr 18, 2024
4c4e85e
Added methods for get and set query strings
eldadfux Apr 22, 2024
395f876
Updated composer
eldadfux Apr 22, 2024
d4718c2
Merge branch 'feat-di-upgrade' into feat-base-servers
eldadfux Apr 22, 2024
b451694
Fixed format
eldadfux Apr 22, 2024
848b2f5
Merge remote-tracking branch 'refs/remotes/origin/feat-base-servers' …
eldadfux Apr 22, 2024
b7494aa
Fixed codeQL
eldadfux Apr 22, 2024
f16451f
Fixed response type
eldadfux Apr 22, 2024
787b884
Merge pull request #133 from utopia-php/feat-base-servers
eldadfux Apr 22, 2024
7147637
Fixed error injection
eldadfux Apr 22, 2024
afed267
Merge pull request #134 from utopia-php/feat-base-servers
eldadfux Apr 22, 2024
aa9bec5
Fixed typo
eldadfux Apr 22, 2024
db782ce
Updated server header logic
eldadfux Apr 22, 2024
cc3341f
Updated composer
eldadfux Apr 22, 2024
d64cfc3
feat: adding `getRoutes` function
byawitz Jun 10, 2024
f54000a
feat: adding context and http
byawitz Jun 11, 2024
8eda2d0
feat: adding list of routes
byawitz Jun 11, 2024
bf24745
feat: adding external execute for GraphQL
byawitz Jun 11, 2024
6d5c75a
feat: adding Coroutine server
byawitz Jul 3, 2024
1397674
feat: adding Coroutine server
byawitz Jul 3, 2024
f4ce8a4
feat: adding Coroutine server
byawitz Jul 3, 2024
d72069f
feat: GraphQL injections and tests
byawitz Jul 4, 2024
0688440
Merge branch 'refs/heads/master' into feat-di-upgrade
byawitz Jul 19, 2024
c27a91d
chore: merge and composer
byawitz Jul 19, 2024
f355e93
Feat: Adding multiple from version 0.33
byawitz Jul 19, 2024
530334e
chore: updating packages
byawitz Aug 8, 2024
2e14c32
fix: fixing test
byawitz Aug 8, 2024
ee50ec9
chore: cleanup
byawitz Aug 8, 2024
009c3f4
Add getValidator to AnyOf
Meldiron Aug 15, 2024
a39565c
chore: formatting
Meldiron Aug 15, 2024
3130662
fix: package name
byawitz Sep 5, 2024
c132449
fix: packages typo
byawitz Sep 5, 2024
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
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: composer validate --strict

- name: Setup Docker
run: docker-compose up -d --build
run: docker compose up -d --build

- name: Wait for Server to be ready
run: sleep 10
Expand All @@ -28,4 +28,7 @@ jobs:
run: docker compose exec fpm vendor/bin/phpunit --configuration phpunit.xml

- name: Run Swoole Tests
run: docker compose exec swoole vendor/bin/phpunit --configuration phpunit.xml
run: docker compose exec swoole vendor/bin/phpunit --configuration phpunit.xml

- name: Run Swoole Corotuine Tests
run: docker compose exec swoole-coroutine vendor/bin/phpunit --configuration phpunit.xml
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/usr/src/code": "${workspaceRoot}"
}
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ $ git push origin [name_of_your_new_branch]

### Testing

- `docker-compose up -d`
- `docker-compose exec web vendor/bin/phpunit --configuration phpunit.xml`
- `docker-compose exec web vendor/bin/psalm --show-info=true`
- `docker compose up -d`
- `docker compose exec web vendor/bin/phpunit --configuration phpunit.xml`
- `docker compose exec web vendor/bin/psalm --show-info=true`

## Introducing New Features

Expand Down
23 changes: 21 additions & 2 deletions Dockerfile.swoole
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM composer:2.0 AS step0


ARG TESTING=true
ARG DEBUG=false

ENV TESTING=$TESTING
ENV DEBUG=$DEBUG

WORKDIR /usr/local/src/

Expand All @@ -13,17 +14,35 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`

FROM appwrite/base:0.4.3 as final
FROM appwrite/base:0.9.0 as final

ARG TESTING=true
ARG DEBUG=false

ENV TESTING=$TESTING
ENV DEBUG=$DEBUG

LABEL maintainer="[email protected]"

RUN \
if [ "$DEBUG" == "true" ]; then \
apk add boost boost-dev; \
fi

WORKDIR /usr/src/code

COPY ./dev /usr/src/code/dev
COPY ./src /usr/src/code/src
COPY ./tests /usr/src/code/tests
COPY ./phpunit.xml /usr/src/code/phpunit.xml
COPY ./phpbench.json /usr/src/code/phpbench.json
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor

# Enable Extensions
RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi

EXPOSE 80

CMD ["php", "tests/e2e/server-swoole.php"]
48 changes: 48 additions & 0 deletions Dockerfile.swoole_coroutines
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM composer:2.0 AS step0

ARG TESTING=true
ARG DEBUG=false

ENV TESTING=$TESTING
ENV DEBUG=$DEBUG

WORKDIR /usr/local/src/

COPY composer.* /usr/local/src/

RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`

FROM appwrite/base:0.9.0 as final

ARG TESTING=true
ARG DEBUG=false

ENV TESTING=$TESTING
ENV DEBUG=$DEBUG

LABEL maintainer="[email protected]"

RUN \
if [ "$DEBUG" == "true" ]; then \
apk add boost boost-dev; \
fi

WORKDIR /usr/src/code

COPY ./dev /usr/src/code/dev
COPY ./src /usr/src/code/src
COPY ./tests /usr/src/code/tests
COPY ./phpunit.xml /usr/src/code/phpunit.xml
COPY ./phpbench.json /usr/src/code/phpbench.json
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor

# Enable Extensions
RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi

EXPOSE 80

CMD ["php", "tests/e2e/server-swoole-coroutine.php"]
12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,28 @@
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"Utopia\\": "src/",
"Utopia\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\E2E\\": "tests/e2e"
}
},
"scripts": {
"lint": "vendor/bin/pint --test",
"format": "vendor/bin/pint",
"check": "vendor/bin/phpstan analyse -c phpstan.neon",
"check": "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=256M",
"test": "vendor/bin/phpunit --configuration phpunit.xml",
"bench": "vendor/bin/phpbench run --report=benchmark"
},
"require": {
"php": ">=8.0",
"ext-swoole": "*"
"ext-swoole": "*",
"utopia-php/servers": "0.1.*"
},
"require-dev": {
"ext-xdebug": "*",
"phpunit/phpunit": "^9.5.25",
"laravel/pint": "^1.2",
"swoole/ide-helper": "4.8.3",
Expand Down
Loading
Loading