-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Changes from all commits
c341a0c
54ee17c
bc0100f
c2915e8
e12ab04
b67cb6e
de8bc40
92bf137
aeab177
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ build: | |
|
||
runtime: | ||
extensions: | ||
# Enable the event PHP extension, which provides a faster core event loop. | ||
- event | ||
- newrelic | ||
- | ||
name: 'blackfire' | ||
|
@@ -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' | ||
commands: | ||
start: ./console serve | ||
upstream: | ||
socket_family: tcp | ||
protocol: http | ||
|
||
crons: | ||
# Look for new emails every 5 minutes. | ||
drush-queue: | ||
sync: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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' |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We were previously using PHP's built-in webserver, now we simply launch the React application. |
||
|
||
install: | ||
set -e | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 replacepassthru: '/index.php'
withpassthru: true
(once your application is talking HTTP directly, it has no concept of script anymore).