ecamp3 icon indicating copy to clipboard operation
ecamp3 copied to clipboard

chore: change from php-fpm to frankenphp

Open usu opened this issue 1 year ago • 1 comments

Fixes https://github.com/ecamp/ecamp3/issues/4453 Changes from php-fpm to frankenphp + take over any other useful change from official api-platform template.

For a diff of all upstream changes since our last sync see https://github.com/api-platform/api-platform/compare/7642f8639ff1d95cfa48832db0221973559f8d29...v3.3.2

Open To Dos:

  • [x] Fix xdebug
  • [ ] Test on different local machines
  • [x] Test deployment (manually deployed unter https://pr5123-manual-1.ecamp3.ch/)

Excluded from this PR:

  • Worker mode (runtime mode)
  • Upgrade to postgres 16
  • api platform config rfc_7807_compliant_errors (upstream is true; kept at false)
  • doctrine config validate_xml_mapping (upstream is true; kept at false)
  • upstream switched from phpdocumentor/reflection-docblock to phpstan/phpdoc-parser (this generated wrong API responses; didn't debug further)
  • Some renaming of files to keep review of the changes a bit simpler. We could still do these renamings afterwards in a separate PR (docker-compose.yml is now compose.yml; api-platform.ini is now app.ini; etc.)

xdebug

In upstream, the default working folder has changed from /srv/api to /app. In order for debugging to work again, I had to change the pathMappings in my debug config in VScode. In other IDEs, something similar might be needed in order to find the correct sources. Alterative would be that we stick to /srv/api instead of /app.

Old .vscode/launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "XDebug: eCamp API",
            "type": "php",
            "request": "launch",
            "hostname": "localhost",
            "port": 9003,
            "log": true,
            "pathMappings": {
                "/srv/api": "${workspaceRoot}/api"
            }
        }
    ]
}

New .vscode/launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "XDebug: eCamp API",
            "type": "php",
            "request": "launch",
            "hostname": "localhost",
            "port": 9003,
            "log": true,
            "pathMappings": {
                "/app": "${workspaceRoot}/api"
            }
        }
    ]
}

usu avatar May 04 '24 15:05 usu

Very cool. I will look at it as soon as the caching PR is through.

BacLuc avatar May 12 '24 09:05 BacLuc

Just tested on macOS. To quote a famous coder above:

works on my machine :)

, too!

usu avatar Jun 01 '24 09:06 usu