-
Notifications
You must be signed in to change notification settings - Fork 86
Allow PHP version to be changed from Site Settings #225
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
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7e4bcdb
Display the PHP version on Site Settings screen
danielbachhuber f81552f
Add a modal for editing the PHP version
danielbachhuber 7d93cb5
First pass at saving selected PHP version
danielbachhuber 9e856ec
Update site details to allow user to set PHP version (#226)
derekblank 5006fce
Abstract available PHP versions to a constant
danielbachhuber 673606a
Use PHP constants from `wp-now` (#231)
fluiddot 64d1bf7
Add unit tests to cover changing PHP version functionality (#233)
fluiddot de6ed02
Remove `getPhpVersion` hook and IPC handler (#239)
fluiddot f47f515
Bump default PHP version to `8.1` (#240)
fluiddot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Display the PHP version on Site Settings screen
- Loading branch information
commit 7e4bcdbe2bf8c986ca2e4c256aabb8ff824688d5
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { useEffect, useState } from 'react'; | ||
| import { getIpcApi } from '../lib/get-ipc-api'; | ||
|
|
||
| export function useGetPhpVersion( site: SiteDetails ) { | ||
| const [ phpVersion, setPhpVersion ] = useState( '-' ); | ||
| useEffect( () => { | ||
| getIpcApi().getPhpVersion( site.id ).then( setPhpVersion ); | ||
| }, [ site.id, site.running ] ); | ||
| return phpVersion; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the hook
useGetPhpVersionis not necessary because the PHP version is already coming from the site details inselectedSite.Not sure if this approach has been followed based on the other hook
useGetWpVersion. If so, the WordPress version needs to be retrieved from the WordPress files as it's not referenced in the site details. That's the main reason for needing that hook.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add these changes in a separate PR to avoid blocking this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#239