{"id":29664318,"url":"https://github.com/hichemtab-tech/pomposer","last_synced_at":"2025-07-22T12:37:06.516Z","repository":{"id":303322119,"uuid":"1014977105","full_name":"HichemTab-tech/pomposer","owner":"HichemTab-tech","description":"A fast, caching-based alternative to Composer — with global storage and shared dependencies across PHP projects.","archived":false,"fork":false,"pushed_at":"2025-07-15T00:50:52.000Z","size":488,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-15T04:48:11.606Z","etag":null,"topics":["composer","package-manager","php","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HichemTab-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"buy_me_a_coffee":"hichemtabtech","github":"hichemtab-tech"}},"created_at":"2025-07-06T19:17:32.000Z","updated_at":"2025-07-15T02:15:50.000Z","dependencies_parsed_at":"2025-07-07T02:48:58.467Z","dependency_job_id":null,"html_url":"https://github.com/HichemTab-tech/pomposer","commit_stats":null,"previous_names":["hichemtab-tech/pomposer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/HichemTab-tech/pomposer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2Fpomposer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2Fpomposer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2Fpomposer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2Fpomposer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HichemTab-tech","download_url":"https://codeload.github.com/HichemTab-tech/pomposer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2Fpomposer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266496702,"owners_count":23938717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","package-manager","php","php-library"],"created_at":"2025-07-22T12:36:42.883Z","updated_at":"2025-07-22T12:37:06.473Z","avatar_url":"https://github.com/HichemTab-tech.png","language":"PHP","funding_links":["https://buymeacoffee.com/hichemtabtech","https://github.com/sponsors/hichemtab-tech"],"categories":[],"sub_categories":[],"readme":"# Pomposer - Shared Package Manager for PHP (pnpm-style for PHP)\n\nA 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.\n![Pomposer logo](meta/pomposer.png \"Pomposer logo\")\n\n## Why Pomposer?\n\nComposer is the backbone of modern PHP development, but it's not optimized for shared storage.\nEvery `composer install` duplicates packages per project, eating up disk space and time.\n\n**Pomposer** brings the best of `pnpm` to PHP:\n\n- 📦 **Global Package Store**: Each package version is downloaded and stored *only once*.\n- ⚡ **Faster Installs**: Once a package is in the global store, installs are nearly instant.\n- ⚙️ **Advanced Autoloader**: Generates a complete, optimized autoloader (PSR-4, classmap, files).\n- 🤝 **Framework Compatibility**: Creates the necessary manifests (`installed.json`, etc.) for features like Laravel's package auto-discovery.\n- 📜 **Script Execution**: Correctly runs `post-install-cmd` and `post-autoload-dump` scripts.\n\n---\n\n## How It Works\n\n1.  **Read `composer.lock`** (or falls back to `composer.json` with its own resolver).\n2.  **Download and cache packages** to the global store at `~/.pomposer-store`.\n3.  **Read the full `composer.json` from within each package** to gather all metadata (autoloading rules, scripts, and framework providers).\n4.  **Generate a complete vendor directory**, including:\n    - An optimized classmap and PSR-4 autoloader pointing to the global store.\n    - The full package manifest (`installed.json`, `installed.php`, etc.) for framework compatibility.\n    - Compatibility stubs for Composer's internal classes.\n5.  **Execute post-install scripts** to finalize the installation (e.g., `php artisan package:discover`).\n\n---\n\n## Installation\n\nYou can install Pomposer globally or locally via Composer:\n\n```bash\ncomposer global require hichemtab-tech/pomposer\n```\n\nMake sure Composer global bin is in your `$PATH`. Then run:\n\n```bash\npomposer install\n```\n\n---\n\n## Example 1: Build a small Project with Pomposer\n\nLet’s test Pomposer using a simple PHP app that:\n\n* Uses `monolog/monolog` for logging\n* Uses your custom package `hichemtab-tech/namecrement`\n* Has its own PSR-4 autoloading\n\n---\n\n### 1. Create your test project\n\n```bash\nmkdir test-pomposer \u0026\u0026 cd test-pomposer\n```\n\n### 2. Create a `composer.json`:\n\n```json\n{\n  \"name\": \"hichemtab-tech/test-pomposer\",\n  \"autoload\": {\n    \"psr-4\": {\n      \"HichemTabTech\\\\TestPomposer\\\\\": \"src/\"\n    }\n  },\n  \"authors\": [\n    {\n      \"name\": \"HichemTab-tech\",\n      \"email\": \"konanhichemsinshi@gmail.com\"\n    }\n  ],\n  \"require\": {\n    \"hichemtab-tech/namecrement\": \"^1.1\",\n    \"monolog/monolog\": \"^3.9\"\n  }\n}\n```\n\n### 3. Create your source and test files\n\n```bash\nmkdir src\ntouch src/index.php\n```\n\nThen edit `src/index.php`:\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nuse HichemTabTech\\Namecrement\\Namecrement;\nuse Monolog\\Logger;\nuse Monolog\\Handler\\StreamHandler;\n\n$existing = ['file', 'file (1)', 'file (2)'];\n$newName = Namecrement::namecrement('file', $existing);\n\necho \"Next unique file name after the list of existing files:\\n\";\necho \"Existing files: \" . implode(', ', $existing) . \"\\n\";\necho \"New file name: \";\necho $newName . \"\\n\\n\";\n\n$log = new Logger('test');\n$log-\u003epushHandler(new StreamHandler('php://stdout', Logger::DEBUG));\n$log-\u003einfo('Pomposer is alive!');\n```\n\n### 4. Run Pomposer\n\n```bash\npomposer install\n```\n\nIt will:\n\n* Resolve dependencies (even if no `composer.lock`)\n* Download and cache each package version in `~/.pomposer-store`\n* Link the necessary packages into your `vendor/` folder\n* Generate a working autoloader\n\n### 5. Run the test script\n\n```bash\nphp src/index.php\n```\n\n✅ You should see output like:\n\n```\nNext unique file name after the list of existing files:\nExisting files: file, file (1), file (2)\nNew file name: file (3)\n\n[2025-07-06 20:31:22] test.INFO: Pomposer is alive! []\n```\n\n✅ You just installed `monolog/monolog` without Composer touching your `vendor/` at all.\n\n## Example: Building a Real Laravel App with Pomposer\n\nWe have adapted Pomposer to install and run a modern Laravel application.\nThis process served as a practical test of its ability to handle complex dependencies, package auto-discovery, and post-install scripting.\n\n### 1. Create a Laravel Project\n\nFirst, create a standard Laravel project with a starter kit like Breeze.\n\n#### using Laravel Installer\n\n```bash\n# Example using Laravel Breeze with React \u0026 SSR\nlaravel new pomposer-test-app --breeze --stack react --ssr\ncd pomposer-test-app\n```\n#### or using [LaravelFS Installer](https://github.com/HichemTab-tech/LaravelFS)\n\n```bash\nlaravelfs new pomposer-test-app --breeze --stack react --ssr\ncd pomposer-test-app\n```\n\n\n### 2. Remove Existing Vendor Directory\n\nWe want to install from scratch using only Pomposer.\n\n```bash\nrm -rf vendor composer.lock\n```\n\n### 3. Run Pomposer\n\nNow, tell Pomposer to handle the installation.\n\n```bash\npomposer install\n```\n\nPomposer 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.\n\n### 4. Verify It Works\n\nOnce the installation is complete, you can run standard Artisan commands. The application is ready to go.\n\n```bash\nphp artisan about\n```\n\nYou 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.\n\n## Global Store Layout\n\nPackages are stored by name + version:\n\n```\n└── ~/.pomposer-store/\n    ├── hichemtab-tech\n    │   └── namecrement\n    │       └── 1.1.0\n    │           ├── composer.json\n    │           └── src\n    ├── monolog\n    │   └── monolog\n    │       └── 3.9.0\n    │           ├── composer.json\n    │           └── src\n    └── psr\n        └── log\n            └── 3.0.2\n                ├── composer.json\n                └── src\n```\n\n---\n\n## ⚠️ Limitations (Beta Notice)\n\n\u003e [!WARNING]  \n\u003e Pomposer is still in **beta** — built as a proof of concept.\n\nCurrent limitations :\n\n* ❌ ️ **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.\n* ⚠️ **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.\n* ❌ **No Support for `provide`/`replace`/`conflict`:** These advanced dependency management rules are not implemented.\n* ❌ **No Composer Plugin System:** Cannot run Composer plugins.\n* ⚠️ **Limited Autoloading:** Does not support the deprecated `psr-0` standard.\n\n---\n\n## 💡 Want to Contribute?\n\nGot ideas or experience with Composer internals? Want to help evolve Pomposer into something production-ready?\n\n👉 **Join the discussion and contribute on GitHub**:\n[https://github.com/HichemTab-tech/pomposer/discussions/4](https://github.com/HichemTab-tech/pomposer/discussions/4)\n\n---\n\n## License\n\nMIT © @HichemTab-tech\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichemtab-tech%2Fpomposer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhichemtab-tech%2Fpomposer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichemtab-tech%2Fpomposer/lists"}