Skip to content

Read a project's PHP version from .valetrc and .php-version #188

Description

@riesjart

The problem

Flock only reads a project's PHP version from .flockrc. Projects coming from Valet or Herd have a .valetrc with [email protected] instead (written by valet isolate / herd isolate), and other tools such as the Symfony CLI read .php-version. Those files are often committed and shared with people who don't use Flock, so adding a .flockrc next to them means two files saying the same thing.

For Node, Flock already does this: .nvmrc and .node-version count as pinned, with .flockrc winning over them.

The solution you'd like

Treat .valetrc ([email protected], php=X.Y) and .php-version as pinned PHP versions, looked up upwards like .flockrc, with php= in .flockrc taking precedence. flock isolated and Settings → Sites could show the file a version comes from, as they do for .nvmrc.

Alternatives you've considered

  • Adding a .flockrc to every project, which duplicates the version.
  • Running flock isolate php X.Y per project from a script that parses .valetrc, which only works on one machine and drifts when the project changes its version.

This is narrower than #104 (migrating from other tools): it's about reading these files on an ongoing basis, not a one-time import.

Activity

  1. self-assigned this
    on Nov 18, 2026
  2. added this to the v1.x milestone on Nov 18, 2026
  3. onairmarc commented on Nov 18, 2026

    @onairmarc
    Member

    Agreed, we should be looking for these files. I'll implement this in the following priority:

    1. .flockrc
    2. .valetrc
    3. .php-version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions