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

Run externals.io on ReactPHP to improve performances #48

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .platform.app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ build:

runtime:
extensions:
# Enable the event PHP extension, which provides a faster core event loop.
- event
- newrelic
-
name: 'blackfire'
Expand Down Expand Up @@ -42,16 +44,14 @@ relationships:
database: "database:mysql"

web:
locations:
'/':
# The public directory of the application relative to its root.
root: 'web'
# The front-controller script which determines where to send
# non-static requests.
passthru: '/index.php'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how we move from a PHP-FPM setup to a ReactPHP setup on Platform.sh (documentation: https://docs.platform.sh/languages/php.html#alternate-start-commands)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably still want the locations block, so that static assets are served as you expect. Just replace passthru: '/index.php' with passthru: true (once your application is talking HTTP directly, it has no concept of script anymore).

commands:
start: ./console serve
upstream:
socket_family: tcp
protocol: http

crons:
# Look for new emails every 5 minutes.
drush-queue:
sync:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply renamed the job for clarity, this should not have been included in this PR, sorry for the noise.

spec: '*/5 * * * *'
cmd: './console sync'
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
preview:
ENV=dev php -S localhost:8000 -t web
ENV=dev ./console serve
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make preview is the command used in development environment to run a small webserver.

We were previously using PHP's built-in webserver, now we simply launch the React application.


install:
set -e
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"rvdv/nntp": "dev-preserve-empty-lines@dev",
"zbateson/mail-mime-parser": "^0.4.3",
"vlucas/phpdotenv": "^2.4",
"sentry/sentry": "^1.7"
"sentry/sentry": "^1.7",
"react/http": "^0.7.2",
"blackfire/php-sdk": "^1.8"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afair you only need this sdk when the extension is not loaded.

You could also do a extension_loaded check before registering the middleware and drop this dependency

},
"require-dev": {
"phpunit/phpunit": "^6.0"
Expand Down
Loading