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

Swoole: Follow symlinks to enable zero-downtime deployment #1009

Open
wants to merge 6 commits into
base: 2.x
Choose a base branch
from

Conversation

mikkpokk
Copy link

@mikkpokk mikkpokk commented Mar 12, 2025

Issue is addressed in #1004. This PR fixes the addressed issue.

What does this PR do?

  • If PHP SCRIPT_NAME contains the base directory and it differs from basePath, it replaces realpath paths with symlinked paths.
  • Detects if the server is inside a symlinked directory and replaces realpaths with symlinked paths.
  • Forwards the correct directory path to swoole-server using the environment parameter APP_RELEASE_BIN_DIR.
  • swoole-server uses APP_RELEASE_BIN_DIR instead of the PHP realpath __DIR__.
  • swoole-server listens to the Swoole event beforereload. Whenever the app is reloaded, it clears the PHP directory caches using clearstatcache(true).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant