Skip to content

feat(php): add Symfony framework support - #626

Open
iloveitaly wants to merge 9 commits into
railwayapp:mainfrom
iloveitaly:php-workspace
Open

feat(php): add Symfony framework support#626
iloveitaly wants to merge 9 commits into
railwayapp:mainfrom
iloveitaly:php-workspace

Conversation

@iloveitaly

Copy link
Copy Markdown
Collaborator

Motivation

Railpack could build PHP apps but only treated Laravel specially (public/ root, start-time setup). Symfony apps needed the same zero-config path (#89).

Description

Detect Symfony via symfony/framework-bundle (or Flex bin/console + symfony.lock), set document root to /app/public, use prod env defaults, and install framework-specific start scripts (vanilla / Laravel / Symfony) as /start-container.sh. Symfony startup runs Doctrine migrations when available (honoring RAILPACK_SKIP_MIGRATIONS) and cache:warmup; framework choice is recorded as phpFramework metadata with a regenerable examples/php-symfony integration example.

Test

  • mise run check
  • mise run test (includes PHP plan snapshots)
  • cd examples/php-symfony && mise run test-integration-cwd

Links

- initialize standard directory structure and configuration files for a new Symfony application
- include essential asset management, routing, security, and environment configurations
- provide boilerplate files for controllers, entities, and repositories

Generated-by: aiautocommit
…ript

- Inject standard environment variables directly into the build plan instead of relying on implicit defaults.
- Clean up the `start-container.sh` template by removing conditional Laravel-specific logic that was running on non-Laravel projects.
- Update test snapshots to reflect the standardized runtime configuration and simplified entrypoint script.

Generated-by: aiautocommit
- Move framework-specific initialization logic into dedicated scripts for Laravel and Symfony.
- Simplify the main startup script by removing conditional branching for framework detection.

Generated-by: aiautocommit
- Add a home controller to provide a valid response for root route requests.
- Update test configuration to include mandatory environment variables and verify the successful response.

Generated-by: aiautocommit
- refactor framework detection to support symfony in addition to laravel
- automate symfony-specific setup including directory permissions and necessary php extensions
- update build commands and env variables to align with symfony production best practices
- centralize framework detection and configuration logic to improve extensibility

Generated-by: aiautocommit
Local vendor trees were matched by **/composer.json and bloated the
Symfony plan snapshot, causing CI snapshot mismatches when vendor is absent.
Snapshot pollution was from a local vendor/ tree; keep discovery simple
and regenerate plans without install artifacts present.

@welcoMattic welcoMattic left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, but I'm not a Go expert.

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.

Symfony support

2 participants