PHP Classes

How to Use a PHP Package Manager Composer-compatible that is Faster Using the Package pomposer: Install packages shares storage between projects

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2026-06-30 (Yesterday) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
pomposer 1.0MIT/X Consortium ...7Project Management, PHP 7
Description 

Author

This package provides an install package that shares storage between projects.

It provides an installer application that can install PHP packages in a compatible way with PHP Composer and reuse installations in the same package on the same computer.

Currently it can:

- Download the same package only once for all projects that need the package

- It can read the composer.lock or composer.json to determine the packages to be installed.

- Check a cache storage at ~/.pomposer-store to determine if a package was already installed.

- Generates in the vendor directory script to load classes that follow the PSR-4 recommendation, class maps, and files.

- Creates manifest files like installed.json to enable package auto-discovery

- Runs the post-install-cmd and post-autoload-dump scripts.

Picture of Hichem Taboukouyout
Name: Hichem Taboukouyout <contact>
Classes: 2 packages by
Country: Algeria Algeria
Innovation award
Innovation award
Nominee: 2x

Instructions

Please read this document to learn how to install PHP package using pomposer.

Documentation

Pomposer - Shared Package Manager for PHP (pnpm-style for PHP)

A proof-of-concept package manager for PHP that installs dependencies once and shares them globally across projects to save space and boost speed. Inspired by pnpm, Pomposer avoids duplication by linking packages instead of reinstalling them for every project. Pomposer logo

Why Pomposer?

Composer is the backbone of modern PHP development, but it's not optimized for shared storage. Every composer install duplicates packages per project, eating up disk space and time.

Pomposer brings the best of pnpm to PHP:

  • ? Global Package Store: Each package version is downloaded and stored only once.
  • ? Faster Installs: Once a package is in the global store, installs are nearly instant.
  • ?? Advanced Autoloader: Generates a complete, optimized autoloader (PSR-4, classmap, files).
  • ? Framework Compatibility: Creates the necessary manifests (`installed.json`, etc.) for features like Laravel's package auto-discovery.
  • ? Script Execution: Correctly runs `post-install-cmd` and `post-autoload-dump` scripts.

How It Works

  1. Read composer.lock (or falls back to `composer.json` with its own resolver).
  2. Download and cache packages to the global store at `~/.pomposer-store`.
  3. Read the full composer.json from within each package to gather all metadata (autoloading rules, scripts, and framework providers).
  4. Generate a complete vendor directory, including: - An optimized classmap and PSR-4 autoloader pointing to the global store. - The full package manifest (`installed.json`, `installed.php`, etc.) for framework compatibility. - Compatibility stubs for Composer's internal classes.
  5. Execute post-install scripts to finalize the installation (e.g., `php artisan package:discover`).

Installation

You can install Pomposer globally or locally via Composer:

composer global require hichemtab-tech/pomposer

Make sure Composer global bin is in your $PATH. Then run:

pomposer install

Example 1: Build a small Project with Pomposer

Let?s test Pomposer using a simple PHP app that:

  • Uses `monolog/monolog` for logging
  • Uses your custom package `hichemtab-tech/namecrement`
  • Has its own PSR-4 autoloading

1. Create your test project

mkdir test-pomposer && cd test-pomposer

2. Create a composer.json:

{
  "name": "hichemtab-tech/test-pomposer",
  "autoload": {
    "psr-4": {
      "HichemTabTech\\TestPomposer\\": "src/"
    }
  },
  "authors": [
    {
      "name": "HichemTab-tech",
      "email": "konanhichemsinshi@gmail.com"
    }
  ],
  "require": {
    "hichemtab-tech/namecrement": "^1.1",
    "monolog/monolog": "^3.9"
  }
}

3. Create your source and test files

mkdir src
touch src/index.php

Then edit src/index.php:

<?php

require_once __DIR__ . '/../vendor/autoload.php';

use HichemTabTech\Namecrement\Namecrement;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$existing = ['file', 'file (1)', 'file (2)'];
$newName = Namecrement::namecrement('file', $existing);

echo "Next unique file name after the list of existing files:\n";
echo "Existing files: " . implode(', ', $existing) . "\n";
echo "New file name: ";
echo $newName . "\n\n";

$log = new Logger('test');
$log->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG));
$log->info('Pomposer is alive!');

4. Run Pomposer

pomposer install

It will:

  • Resolve dependencies (even if no `composer.lock`)
  • Download and cache each package version in `~/.pomposer-store`
  • Link the necessary packages into your `vendor/` folder
  • Generate a working autoloader

5. Run the test script

php src/index.php

? You should see output like:

Next unique file name after the list of existing files:
Existing files: file, file (1), file (2)
New file name: file (3)

[2025-07-06 20:31:22] test.INFO: Pomposer is alive! []

? You just installed monolog/monolog without Composer touching your vendor/ at all.

Example: Building a Real Laravel App with Pomposer

We have adapted Pomposer to install and run a modern Laravel application. This process served as a practical test of its ability to handle complex dependencies, package auto-discovery, and post-install scripting.

1. Create a Laravel Project

First, create a standard Laravel project with a starter kit like Breeze.

using Laravel Installer

# Example using Laravel Breeze with React & SSR
laravel new pomposer-test-app --breeze --stack react --ssr
cd pomposer-test-app

or using LaravelFS Installer

laravelfs new pomposer-test-app --breeze --stack react --ssr
cd pomposer-test-app

2. Remove Existing Vendor Directory

We want to install from scratch using only Pomposer.

rm -rf vendor composer.lock

3. Run Pomposer

Now, tell Pomposer to handle the installation.

pomposer install

Pomposer will resolve dependencies, use its global cache, generate the autoloader and package manifests, and correctly run php artisan package:discover as part of its script execution.

4. Verify It Works

Once the installation is complete, you can run standard Artisan commands. The application is ready to go.

php artisan about

You will see a complete list of environment details and discovered packages (like Inertia), proving that Laravel has booted successfully using the Pomposer-generated vendor directory.

Global Store Layout

Packages are stored by name + version:

??? ~/.pomposer-store/
    ??? hichemtab-tech
    ?   ??? namecrement
    ?       ??? 1.1.0
    ?           ??? composer.json
    ?           ??? src
    ??? monolog
    ?   ??? monolog
    ?       ??? 3.9.0
    ?           ??? composer.json
    ?           ??? src
    ??? psr
        ??? log
            ??? 3.0.2
                ??? composer.json
                ??? src

?? Limitations (Beta Notice)

> [!WARNING] > Pomposer is still in beta ? built as a proof of concept.

Current limitations :

  • ? ? No Symlinking: Unlike pnpm, Pomposer does not use symlinks. It generates an autoloader that points directly to the global store. This means the `vendor/` directory is mostly empty, which can break tools or build scripts that expect to find physical files there.
  • ?? Basic Dependency Resolver: The dependency resolver is simple and may fail on complex version constraints. It works best when a `composer.lock` file is present.
  • ? No Support for provide/replace/conflict: These advanced dependency management rules are not implemented.
  • ? No Composer Plugin System: Cannot run Composer plugins.
  • ?? Limited Autoloading: Does not support the deprecated `psr-0` standard.

? Want to Contribute?

Got ideas or experience with Composer internals? Want to help evolve Pomposer into something production-ready?

? Join the discussion and contribute on GitHub: https://github.com/HichemTab-tech/pomposer/discussions/4

License

MIT © @HichemTab-tech


  Files folder image Files (31)  
File Role Description
Files folder image.github (3 files, 2 directories)
Files folder imagebin (1 file)
Files folder imagemeta (1 file)
Files folder imagesrc (6 files, 3 directories)
Files folder imagetests (1 file)
Accessible without login Plain text file CODE_OF_CONDUCT.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Read me document
Accessible without login Plain text file SECURITY.md Data Auxiliary data

  Files folder image Files (31)  /  .github  
File Role Description
Files folder imageISSUE_TEMPLATE (4 files)
Files folder imageworkflows (2 files)
  Accessible without login Plain text file dependabot.yml Data Auxiliary data
  Accessible without login Plain text file FUNDING.yml Data Auxiliary data
  Accessible without login Plain text file PULL_REQUEST_TEMPLATE.md Data Auxiliary data

  Files folder image Files (31)  /  .github  /  ISSUE_TEMPLATE  
File Role Description
  Accessible without login Plain text file bug_report.md Data Auxiliary data
  Accessible without login Plain text file documentation.md Data Auxiliary data
  Accessible without login Plain text file feature_request.md Data Auxiliary data
  Accessible without login Plain text file question.md Data Auxiliary data

  Files folder image Files (31)  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file auto-assign.yml Data Auxiliary data
  Accessible without login Plain text file tests.yml Data Auxiliary data

  Files folder image Files (31)  /  bin  
File Role Description
  Accessible without login Plain text file pomposer Example Example script

  Files folder image Files (31)  /  meta  
File Role Description
  Accessible without login Image file pomposer.png Icon Icon image

  Files folder image Files (31)  /  src  
File Role Description
Files folder imageConcerns (2 files)
Files folder imageConsole (1 file)
Files folder imagestubs (2 files)
  Plain text file AutoloadGenerator.php Class Class source
  Plain text file LockParser.php Class Class source
  Plain text file PackageInstaller.php Class Class source
  Plain text file PackageStore.php Class Class source
  Plain text file PackagistGateway.php Class Class source
  Plain text file ScriptRunner.php Class Class source

  Files folder image Files (31)  /  src  /  Concerns  
File Role Description
  Plain text file CommandsUtils.php Class Class source
  Plain text file ConfiguresPrompts.php Class Class source

  Files folder image Files (31)  /  src  /  Console  
File Role Description
  Plain text file InstallCommand.php Class Class source

  Files folder image Files (31)  /  src  /  stubs  
File Role Description
  Plain text file ClassLoader.php.stub Class Class source
  Plain text file InstalledVersions.php.stub Class Class source

  Files folder image Files (31)  /  tests  
File Role Description
  Accessible without login Plain text file Pest.php Example Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0