Search by

adachsoft / project-workspace

Arkadiusz Adach

Project workspace path mapping and repository adapter

Package info

gitlab.com/a.adach/project-workspace

Issues

pkg:composer/adachsoft/project-workspace

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-11-30 01:51 UTC

This package is auto-updated.

Last update: 2026-11-30 00:52:00 UTC


README

A PHP library for translating project paths between canonical and local workspace locations and for preparing project workspaces from Git repositories.

Features

  • Parse ordered, semicolon-separated absolute path mappings and convert paths in either direction.
  • Decorate a project configuration repository to transparently map project paths when reading and writing definitions.
  • Read Git origin URLs, normalize supported GitLab URLs, and synchronize URLs with project configuration.
  • Clone configured repositories into workspaces and optionally install detected Composer and npm dependencies.

Installation

Install the library with Composer:

composer require adachsoft/project-workspace

Composer installs the required AdachSoft command-execution and project-configuration libraries as dependencies.

Requirements

  • PHP 8.3 or later.
  • Composer.

Usage

Use PathMappingParser to parse configured path mappings and PathMappingProjectConfigRepository to apply them to project configuration access.

Integration

Parse a mapping value supplied by your application's configuration, then translate a canonical project path to its local workspace path:

use AdachSoft\ProjectWorkspace\PathMappingParser;

$mappingValue = '/srv/projects/=/workspace/projects/';
$pathMapping = (new PathMappingParser())->parse($mappingValue);
$localPath = $pathMapping->toLocal('/srv/projects/example');

// $localPath is '/workspace/projects/example'

To apply path translation throughout project configuration access, wrap an existing ProjectConfigRepositoryInterface implementation with PathMappingProjectConfigRepository and provide the parsed PathMapping. The decorator maps base_path values on reads and writes while preserving the rest of each project definition.

See the usage examples for additional integration details.