Updating The Framework

Rhapsody includes a powerful set of console commands to make updating your application simple, safe, and automatic.


Automated Update Command

The recommended way to update your application is by using the app:update command. It orchestrates the entire update workflow to ensure a smooth deployment.

php rhapsody app:update

Update Workflow

The command performs the following steps in sequence:

  1. Enters Maintenance Mode: Puts the site into maintenance mode to prevent access during the update.
  2. Fetches Latest Code: Forcefully resets your local branch to match the remote repository, ensuring all new files (like .env.example) are downloaded.
  3. Updates Dependencies: Runs composer install.
  4. Syncs Environment File: Safely appends any new variables from .env.example to your .env file without overwriting your settings.
  5. Runs Database Migrations: Applies any pending schema changes.
  6. Clears Caches: Flushes all route and application caches.
  7. Updates Version: Updates the app_version in your config.php file.
  8. Exits Maintenance Mode: Brings your application back online.

After Updating

After pulling the latest framework version, always run php rhapsody env:sync to add any new environment variables required by the new version.


Upgrade Notes

Custom cache drivers

If you wrote your own driver implementing CacheInterface, update its method signatures to match the interface: get(string $key, mixed $default = null): mixed and put(string $key, mixed $value, int $minutes): void. A driver that omits the mixed return type on get() will fail to load. See Caching for the full interface.