# mohamed25885/pvm architecture

> Architecture diagram of the GitHub repository mohamed25885/pvm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohamed25885/pvm
- Repository: https://github.com/mohamed25885/pvm

## Overview

PVM is a cross-platform PHP version-manager CLI. A user invokes a command to discover or install PHP releases, select a version for a project or globally, and run PHP through the selected installation. The README also documents setup, diagnostics, updates, adopting existing installs, and extensions as distinct capabilities. Groups reflect CLI workflows and the platform/service layers; source excerpts were unavailable, so edges are limited to relationships explicitly described in the README.

Main entry points: [`lib/src/app.dart`](https://github.com/mohamed25885/pvm/blob/main/lib/src/app.dart) (Command entrypoint), [`lib/src/commands/use_command.dart`](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/use_command.dart) (Project selection), [`lib/src/commands/install_command.dart`](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/install_command.dart) (Install command), [`lib/src/commands/update_command.dart`](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/update_command.dart) (Update command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_app["Command entrypoint<br/>[app.dart]"]
  node_use["Project selection<br/>[use_command.dart]"]
  node_global["Global selection"]
  node_installcmd["Install command"]
  node_listcmd["Release listing"]
  node_current["Current version"]
  node_exec["Versioned execution<br/>[exec_command.dart]"]
  node_phpcmd["PHP proxy<br/>[php_command.dart]"]
  node_composer["Composer proxy"]
  node_doctor["Health diagnostics"]
  node_setup["Environment setup<br/>[setup_command.dart]"]
  node_update["Update command"]
  node_linkcmd["Adopt installation<br/>[link_command.dart]"]
  node_extcmd["Extension command<br/>[ext_command.dart]"]
end

subgraph group_versions["Version management"]
  node_versionsroot[("Installed version slots")]
  node_projectconfig["Project version config<br/>[project.dart]"]
  node_activator["Version activation"]
  node_gitignore["Git ignore service"]
end

subgraph group_install["Installation and releases"]
  node_releasefetch["Release retrieval"]
  node_release_sources["Release sources"]
  node_installers["Platform installers"]
  node_updater["Slot migration"]
end

subgraph group_platform["Platform operations"]
  node_osmanager["OS operations<br/>[io_os_manager.dart]"]
  node_setupservice["Setup service"]
  node_php_runtime["PHP runtime"]
end

subgraph group_extensions["Extensions and diagnostics"]
  node_extension_install["Extension installation"]
  node_diagnostics["Diagnostic checks<br/>[doctor_checks.dart]"]
end

node_user(("CLI user"))

node_user -->|"invokes"| node_app
node_app -.->|"routes to"| node_use
node_app -.->|"routes to"| node_global
node_app -.->|"routes to"| node_installcmd
node_app -.->|"routes to"| node_listcmd
node_app -.->|"routes to"| node_current
node_app -.->|"routes to"| node_exec
node_app -.->|"routes to"| node_phpcmd
node_app -.->|"routes to"| node_composer
node_app -.->|"routes to"| node_doctor
node_app -.->|"routes to"| node_setup
node_app -.->|"routes to"| node_update
node_app -.->|"routes to"| node_linkcmd
node_app -.->|"routes to"| node_extcmd
node_user -->|"selects project"| node_use
node_use -->|"writes version"| node_projectconfig
node_use -->|"activates version"| node_activator
node_use -->|"ensures ignore"| node_gitignore
node_user -->|"sets global"| node_global
node_global -->|"creates global link"| node_activator
node_user -->|"requests install"| node_installcmd
node_installcmd -.->|"fetches releases"| node_releasefetch
node_installcmd -.->|"installs PHP"| node_installers
node_releasefetch -.->|"retrieves from"| node_release_sources
node_installers -.->|"installs into"| node_versionsroot
node_user -->|"lists releases"| node_listcmd
node_user -->|"updates slot"| node_update
node_update -.->|"fetches newer release"| node_releasefetch
node_update -.->|"updates slot"| node_updater
node_user -->|"adopts PHP"| node_linkcmd
node_linkcmd -.->|"records slot"| node_versionsroot
node_user -->|"installs extension"| node_extcmd
node_extcmd -.->|"installs extension"| node_extension_install
node_user -->|"checks setup"| node_doctor
node_doctor -.->|"runs checks"| node_diagnostics
node_user -->|"configures PVM"| node_setup
node_setup -.->|"configures environment"| node_setupservice
node_setupservice -.->|"changes environment"| node_osmanager
node_user -->|"runs command"| node_exec
node_exec -.->|"executes with version"| node_php_runtime
node_user -->|"runs PHP"| node_phpcmd
node_phpcmd -.->|"proxies to"| node_php_runtime
node_user -->|"runs Composer"| node_composer
node_composer -.->|"uses selected PHP"| node_php_runtime
node_user -->|"checks selection"| node_current
node_current -.->|"resolves version"| node_versionsroot

click node_app "https://github.com/mohamed25885/pvm/blob/main/lib/src/app.dart"
click node_use "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/use_command.dart"
click node_global "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/global_command.dart"
click node_installcmd "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/install_command.dart"
click node_listcmd "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/list_remote_command.dart"
click node_current "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/current_command.dart"
click node_exec "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/exec_command.dart"
click node_phpcmd "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/php_command.dart"
click node_composer "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/composer_command.dart"
click node_doctor "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/doctor_command.dart"
click node_setup "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/setup_command.dart"
click node_update "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/update_command.dart"
click node_linkcmd "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/link_command.dart"
click node_extcmd "https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/ext_command.dart"
click node_versionsroot "https://github.com/mohamed25885/pvm/blob/main/lib/src/domain/version_registry.dart"
click node_projectconfig "https://github.com/mohamed25885/pvm/blob/main/lib/src/domain/project.dart"
click node_activator "https://github.com/mohamed25885/pvm/blob/main/lib/src/managers/link_version_activator.dart"
click node_releasefetch "https://github.com/mohamed25885/pvm/blob/main/lib/src/services/release_fetcher.dart"
click node_release_sources "https://github.com/mohamed25885/pvm/tree/main/lib/src/services"
click node_installers "https://github.com/mohamed25885/pvm/tree/main/lib/src/managers"
click node_updater "https://github.com/mohamed25885/pvm/blob/main/lib/src/services/slot_migration.dart"
click node_osmanager "https://github.com/mohamed25885/pvm/blob/main/lib/src/managers/io_os_manager.dart"
click node_setupservice "https://github.com/mohamed25885/pvm/blob/main/lib/src/services/installation/pvm_setup_service.dart"
click node_extension_install "https://github.com/mohamed25885/pvm/tree/main/lib/src/services/extensions"
click node_diagnostics "https://github.com/mohamed25885/pvm/blob/main/lib/src/services/diagnostics/doctor_checks.dart"
click node_gitignore "https://github.com/mohamed25885/pvm/blob/main/lib/src/core/gitignore_service.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_use,node_global,node_installcmd,node_listcmd,node_current,node_exec,node_phpcmd,node_composer,node_doctor,node_setup,node_update,node_linkcmd,node_extcmd,node_user toneBlue
class node_versionsroot,node_projectconfig,node_activator,node_gitignore toneAmber
class node_releasefetch,node_release_sources,node_installers,node_updater toneMint
class node_osmanager,node_setupservice,node_php_runtime toneRose
class node_extension_install,node_diagnostics toneIndigo
```

## Components

### CLI commands

- [Command entrypoint](https://github.com/mohamed25885/pvm/blob/main/lib/src/app.dart): `lib/src/app.dart`
- [Project selection](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/use_command.dart): `lib/src/commands/use_command.dart`
- [Global selection](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/global_command.dart): `lib/src/commands/global_command.dart`
- [Install command](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/install_command.dart): `lib/src/commands/install_command.dart`
- [Release listing](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/list_remote_command.dart): `lib/src/commands/list_remote_command.dart`
- [Current version](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/current_command.dart): `lib/src/commands/current_command.dart`
- [Versioned execution](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/exec_command.dart): `lib/src/commands/exec_command.dart`
- [PHP proxy](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/php_command.dart): `lib/src/commands/php_command.dart`
- [Composer proxy](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/composer_command.dart): `lib/src/commands/composer_command.dart`
- [Health diagnostics](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/doctor_command.dart): `lib/src/commands/doctor_command.dart`
- [Environment setup](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/setup_command.dart): `lib/src/commands/setup_command.dart`
- [Update command](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/update_command.dart): `lib/src/commands/update_command.dart`
- [Adopt installation](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/link_command.dart): `lib/src/commands/link_command.dart`
- [Extension command](https://github.com/mohamed25885/pvm/blob/main/lib/src/commands/ext_command.dart): `lib/src/commands/ext_command.dart`

### Version management

- [Installed version slots](https://github.com/mohamed25885/pvm/blob/main/lib/src/domain/version_registry.dart): `lib/src/domain/version_registry.dart`
- [Project version config](https://github.com/mohamed25885/pvm/blob/main/lib/src/domain/project.dart): `lib/src/domain/project.dart`
- [Version activation](https://github.com/mohamed25885/pvm/blob/main/lib/src/managers/link_version_activator.dart): `lib/src/managers/link_version_activator.dart`
- [Git ignore service](https://github.com/mohamed25885/pvm/blob/main/lib/src/core/gitignore_service.dart): `lib/src/core/gitignore_service.dart`

### Installation and releases

- [Release retrieval](https://github.com/mohamed25885/pvm/blob/main/lib/src/services/release_fetcher.dart): `lib/src/services/release_fetcher.dart`
- [Release sources](https://github.com/mohamed25885/pvm/tree/main/lib/src/services): `lib/src/services`
- [Platform installers](https://github.com/mohamed25885/pvm/tree/main/lib/src/managers): `lib/src/managers`
- [Slot migration](https://github.com/mohamed25885/pvm/blob/main/lib/src/services/slot_migration.dart): `lib/src/services/slot_migration.dart`

### Platform operations

- [OS operations](https://github.com/mohamed25885/pvm/blob/main/lib/src/managers/io_os_manager.dart): `lib/src/managers/io_os_manager.dart`
- [Setup service](https://github.com/mohamed25885/pvm/blob/main/lib/src/services/installation/pvm_setup_service.dart): `lib/src/services/installation/pvm_setup_service.dart`
- **PHP runtime**

### Extensions and diagnostics

- [Extension installation](https://github.com/mohamed25885/pvm/tree/main/lib/src/services/extensions): `lib/src/services/extensions`
- [Diagnostic checks](https://github.com/mohamed25885/pvm/blob/main/lib/src/services/diagnostics/doctor_checks.dart): `lib/src/services/diagnostics/doctor_checks.dart`

### Other components

- **CLI user**

## Connections

- CLI user → Command entrypoint: invokes (evidence: `readme.md`)
- Command entrypoint → Project selection: routes to
- Command entrypoint → Global selection: routes to
- Command entrypoint → Install command: routes to
- Command entrypoint → Release listing: routes to
- Command entrypoint → Current version: routes to
- Command entrypoint → Versioned execution: routes to
- Command entrypoint → PHP proxy: routes to
- Command entrypoint → Composer proxy: routes to
- Command entrypoint → Health diagnostics: routes to
- Command entrypoint → Environment setup: routes to
- Command entrypoint → Update command: routes to
- Command entrypoint → Adopt installation: routes to
- Command entrypoint → Extension command: routes to
- CLI user → Project selection: selects project (evidence: `readme.md`)
- Project selection → Project version config: writes version (evidence: `readme.md`)
- Project selection → Version activation: activates version (evidence: `readme.md`)
- Project selection → Git ignore service: ensures ignore (evidence: `readme.md`)
- CLI user → Global selection: sets global (evidence: `readme.md`)
- Global selection → Version activation: creates global link (evidence: `readme.md`)
- CLI user → Install command: requests install (evidence: `readme.md`)
- Install command → Release retrieval: fetches releases
- Install command → Platform installers: installs PHP
- Release retrieval → Release sources: retrieves from
- Platform installers → Installed version slots: installs into
- CLI user → Release listing: lists releases (evidence: `readme.md`)
- CLI user → Update command: updates slot (evidence: `readme.md`)
- Update command → Release retrieval: fetches newer release
- Update command → Slot migration: updates slot
- CLI user → Adopt installation: adopts PHP (evidence: `readme.md`)
- Adopt installation → Installed version slots: records slot
- CLI user → Extension command: installs extension (evidence: `readme.md`)
- Extension command → Extension installation: installs extension
- CLI user → Health diagnostics: checks setup (evidence: `readme.md`)
- Health diagnostics → Diagnostic checks: runs checks
- CLI user → Environment setup: configures PVM (evidence: `readme.md`)
- Environment setup → Setup service: configures environment
- Setup service → OS operations: changes environment
- CLI user → Versioned execution: runs command (evidence: `readme.md`)
- Versioned execution → PHP runtime: executes with version
- CLI user → PHP proxy: runs PHP (evidence: `readme.md`)
- PHP proxy → PHP runtime: proxies to
- CLI user → Composer proxy: runs Composer (evidence: `readme.md`)
- Composer proxy → PHP runtime: uses selected PHP
- CLI user → Current version: checks selection (evidence: `readme.md`)
- Current version → Installed version slots: resolves version
