Search by

adachsoft / project-config-lib

Arkadiusz Adach

A project configuration repository library with a JSON file backend.

Package info

gitlab.com/a.adach/project-config-lib

Issues

pkg:composer/adachsoft/project-config-lib

Statistics

Installs: 12

Dependents: 1

Suggesters: 0

Stars: 0

v0.1.0 2026-11-29 23:37 UTC

This package is auto-updated.

Last update: 2026-11-29 22:37:42 UTC


README

A PHP library for storing and managing project definitions in a JSON file. It provides a repository contract, a JSON file-backed implementation, immutable data objects, validated project identifiers and keywords, and paginated project listing.

Main capabilities

  • Create, retrieve, update, and delete project definitions.
  • Store project titles, descriptions, keywords, and extensible parameters.
  • List all projects or retrieve a page of results.
  • Persist configuration in a human-readable JSON file.

Installation

Install the library with Composer:

composer require adachsoft/project-config-lib

Integration

Create a JSON-backed repository by providing the path to its data file:

use AdachSoft\ProjectConfigLib\ProjectConfigRepositoryFactory;
use AdachSoft\ProjectConfigLib\Vo\ProjectIdVo;

$repository = (new ProjectConfigRepositoryFactory())
    ->createJsonFileRepository(__DIR__ . '/var/projects.json');

$projects = $repository->listAll();
$project = $repository->getById(new ProjectIdVo('my-project'));

The repository creates the containing directory when saving data if it does not already exist. See the usage example for creating and managing project definitions.

Usage

Create a project definition and persist it through the repository. Use the repository methods to retrieve, update, list, or delete definitions; see the linked example for a complete workflow.

Requirements

  • PHP 8.3 or later.
  • Composer for dependency installation and autoloading.