Skip to content

Conversation

@risu729
Copy link
Contributor

@risu729 risu729 commented Jun 19, 2025

It was unable to install LTS versions of PHP because it was not listed in https://www.php.net/releases/, which only includes "Unsupported Historical Releases".

$ vfox --debug install [email protected]
CallFunction: PreInstall
plugin [PreInstall] method error: /home/risu/.version-fox/plugin/php/hooks/pre_install.lua:31: version not found for provided version 8.4.8
stack traceback:
        [G]: in function 'error'
        /home/risu/.version-fox/plugin/php/hooks/pre_install.lua:31: in main chunk
        [G]: ?
failed to install php

This PR adds https://www.php.net/downloads.php as the source of versions to support LTS versions.

feat: support lts releases in linux
@aooohan aooohan requested a review from Copilot September 29, 2025 12:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for LTS (Long Term Support) PHP releases on Linux by incorporating the downloads page as an additional source for version information. Previously, only versions from the releases page were available, which excluded current LTS versions.

  • Restructured URL constants to support both standard releases and LTS downloads pages
  • Updated Linux version discovery to check both releases and downloads pages
  • Modified Windows release handling to use renamed constants

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lib/constants.lua Restructured URL constants to separate standard and LTS release URLs
hooks/pre_install.lua Updated Windows release URL references to use renamed constants
hooks/available.lua Enhanced Linux version discovery to fetch from both releases and downloads pages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +67 to +68
local versionStr = is_from_lts and selection:attr("id") or selection:text()
versionStr = versionStr:gsub("^v", "")
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

The conditional logic for extracting version strings is unclear. Consider extracting this into separate functions for LTS and standard release parsing to improve readability and maintainability.

Copilot uses AI. Check for mistakes.

if resp then
local doc = html.parse(resp.body)
local query = "#layout-content " .. (is_from_lts and "h3" or "h2")
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

The CSS selector construction using string concatenation with conditional logic makes the code harder to understand. Consider defining separate constants for the selectors or extracting this into a helper function.

Copilot uses AI. Check for mistakes.
@aooohan aooohan merged commit be770f5 into version-fox:main Sep 29, 2025
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.

3 participants