Skip to content

Offline mode for PHP version resolution with optional interactive fallback #48

@rozsazoltan

Description

@rozsazoltan

Description

Installing a PHP version can be time-consuming, and in many cases it is not necessary to always use the latest available patch version. For example, if PHP 8.4.19 is already installed locally, it may be preferable to use that instead of downloading and building 8.4.20.

An offline mode could allow skipping online version checks entirely and prefer already installed local versions.

Expected Behavior

With an offline flag enabled:

# Uses already installed 8.4.19 instead of fetching 8.4.20
OFFLINE=1 mise use -g php@8.4

# Default behavior (downloads latest available version)
OFFLINE=0 mise use -g php@8.4
  • When OFFLINE=1:

    • Skip online version lookup
    • Resolve to the latest locally installed matching version (e.g. 8.4.19)
    • If no matching local version exists -> fail
  • When OFFLINE=0 (default):

    • Always resolve to the latest available online version (e.g. 8.4.20)
    • Download/build if necessary

Edge Case

If no matching version is available locally in offline mode:

  • The command should fail
  • The user must retry without offline mode to install the version

Optional Improvement

Introduce a global interactive setting:

When a newer version is available online, but a compatible version is already installed locally:

  • Prompt the user:

    New version available: 8.4.20
    Installed version found: 8.4.19
    Which one do you want to use?
    

This would improve UX by avoiding unnecessary rebuilds while still allowing upgrades when desired.

Motivation

  • Avoid unnecessary downloads and compilation
  • Speed up workflows (especially in CI, containers, or limited environments)
  • Improve developer experience when working with already installed versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions