Skip to content

Update site details to allow user to set PHP version #226

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

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

derekblank
Copy link
Contributor

@derekblank derekblank commented Jun 10, 2024

Related to:

Updates site details to allow user to set PHP version.

phpVersion.mov

Proposed Changes

  • Adds phpVersion to updateSiteDetails
  • Updates useGetPhpVersion to reflect phpVersion changes in the UI

Testing Instructions

  1. Create a new site
  2. Observe the site is using the default PHP version 8.0
  3. Start the site server by clicking Start button
  4. Navigate to Settings and update the PHP version
  5. Observe PHP version is updated in Studio UI
  6. When the site is running, verify the PHP version is updated in the Site Health tab
  7. Repeat steps for site when server is not running

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@wojtekn wojtekn merged commit 9e856ec into improve/php-version-picker Jun 10, 2024
12 checks passed
@wojtekn wojtekn deleted the fix/select-php-version branch June 10, 2024 11:06
wojtekn pushed a commit that referenced this pull request Jun 17, 2024
* Display the PHP version on Site Settings screen

* Add a modal for editing the PHP version

* First pass at saving selected PHP version

* Update site details to allow user to set PHP version (#226)

* Add phpVersion to updateSiteDetails

* Update tests for changing the PHP version

* Abstract available PHP versions to a constant

* Use PHP constants from `wp-now` (#231)

* Use `DEFAULT_PHP_VERSION` constant from `wp-now`

* Use available PHP versions of Playground

* Add `web-streams-polyfill` package for unit tests

* Polyfill `ReadableStream` in unit tests

Web streams are used by `php-wasm`, so we need to polyfull them if we import the library in unit tests.

* Add unit tests to cover changing PHP version functionality (#233)

* Mock `matchMedia`

* Expose label in `SettingsRow` component

* Add test to cover the case of changing PHP version

* Revert "Expose label in `SettingsRow` component"

This reverts commit bc37161.

* Update change PHP version test case

* Remove `getPhpVersion` hook and IPC handler (#239)

* Remove `getPhpVersion` hook and IPC handler

* Use `??` operator instead of `||` when setting the php version

* Add inline comment in Jest setup

The comment clarifies why we need the polyfill.
Related to: #231 (comment)

* Update `ContentTabSettings` unit tests

* Bump default PHP version to `8.1` (#240)

* Bump default PHP version to `8.1`

This change is driven by the fact that version `8.0` already reached its end-of-life by 2024.
https://www.php.net/supported-versions.php

* Address failure in `createSite` unit test

---------

Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Carlos Garcia <[email protected]>
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.

2 participants