Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Path Composer Plugin Lib

Path Composer Plugin Lib Laravel Package

hostnet/path-composer-plugin-lib

A small library for building Composer plugins around path-based package repositories, helping PHP projects resolve and install dependencies from local directories with less custom Composer integration code.

View on GitHub
Deep Wiki
Context7

A lightweight PHP library for building Composer plugins that work with path repositories. It provides reusable helpers for resolving and normalizing package paths, supporting path-based package workflows, and keeping custom plugin logic focused on behavior instead of boilerplate.

  • Reusable path resolution and normalization utilities
  • Helpers for integrating path packages with Composer plugins
  • Small, focused API for custom plugin behavior
  • Composer-friendly structure for use as a library dependency
Frequently asked questions about Path Composer Plugin Lib
What is hostnet/path-composer-plugin-lib?
It is a small Hostnet library for building Composer path plugins that customize where packages are installed. It provides reusable plugin infrastructure and publishes Composer's vendor_dir and base_dir values as constants. It is aimed at PHP projects, including Laravel applications, that need project-specific package routing.
How do I install hostnet/path-composer-plugin-lib?
Install it with Composer using composer require hostnet/path-composer-plugin-lib. If you only need it while developing your own Composer path plugin, consider installing it as a dev dependency. Check the package's composer.json for the PHP and Composer version constraints before adding it.
Does hostnet/path-composer-plugin-lib work with Laravel?
Yes, it can be used in Laravel projects because it operates at the Composer level rather than depending on Laravel framework APIs. It is not a typical Laravel package with service providers or config files. Laravel version compatibility depends on your project's PHP and Composer constraints.
How does this library help customize where Composer packages are installed?
It gives you reusable infrastructure for writing a Composer path plugin, so your plugin can decide which package types should be installed into which project directories. This helps keep vendor code and custom code organized. Your plugin still defines the actual package-type mappings.
What are the vendor_dir and base_dir constants used for?
The library publishes Composer's vendor_dir and base_dir values as constants so plugin code can reference those paths without recalculating them. This is useful when install paths need to be resolved relative to the project root or vendor directory. Check the README or source for the exact constant names exposed by the package.
Do I need to configure anything in composer.json to use it?
You need Composer to load the plugin that you build with this library, so your plugin package must be required and allowed where applicable. On Composer 2.2 and later, custom plugins may require an allow-plugins entry in composer.json. The library itself is primarily infrastructure for your plugin rather than a standalone installer.
Can I use it to route specific Composer package types to custom directories?
Yes, that is the intended use case for building a Composer path plugin. You implement the logic that maps package types to directories, while this library supplies reusable plugin and path-constant infrastructure. It does not ship a ready-made directory mapping for every package type.
Is hostnet/path-composer-plugin-lib safe to use in production?
Composer plugins run during dependency installation, so treat them like build tooling and review the plugin code you build or install. Pin versions, test in CI, and use Composer's allow-plugins configuration to control which plugins may run. The library is small infrastructure, so production safety depends heavily on the path plugin that uses it.
How do I test a Composer path plugin built with this library?
Create a throwaway Composer project with a path repository or fixture package, then run composer install or composer update to verify the install locations. Assert that the published vendor_dir and base_dir constants resolve correctly in your plugin code. Add these checks to CI so path-routing changes are caught before release.
What are alternatives to hostnet/path-composer-plugin-lib?
Common alternatives include composer/installers, oomphinc/composer-installers-extender, or writing a custom Composer plugin directly. This library is most useful when you want reusable path-plugin infrastructure and vendor_dir/base_dir constants. Review its GitHub repository and tagged releases before adopting it for long-term maintenance.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource