Download the PHP package eril/uri-mapper without Composer

On this page you can find all versions of the php package eril/uri-mapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package uri-mapper

PHP - URI Mapper

URI Mapper is a lightweight CLI tool that generates a named URI catalog from a filesystem structure.

It is designed to help developers reference important entry-point URIs in a stable, explicit, and refactor-friendly way — without acting as a router or imposing architectural decisions.

This tool does not handle HTTP dispatching, request matching, or middleware.
It only maps filesystem paths to named URIs and generates a small helper class for convenience.


Why URI Mapper?

In many projects, URIs are managed manually — and that is often the right choice.

However, some URIs are:

URI Mapper helps in these cases by providing:

It is opt-in by design:
you decide how much or how little you want it to map.


Features


Installation


Basic Usage

Run the mapper against a directory containing your route files:

This will generate a Uri.php helper class containing named URI constants.


Filesystem Mapping

Given the following structure:

The generated class will expose named URIs such as:


Named Routes (@route)

You can define a stable URI identifier using an annotation at the top of a PHP file:

ou

This decouples the URI name from the filesystem path.

If the path changes later, the identifier remains valid.


Aliases and Backward Compatibility

When a @route annotation is present, the automatically generated name becomes an alias.

Example:

Allows:

This makes refactoring safe and explicit.


Index-Only Mode (--index)

By default, all PHP files are considered.

To generate only folder-level URIs, use:

This produces a cleaner API focused on entry points:

Without generating leaf routes like Uri::adminUsers().


Preserving .php in URIs (--php)

By default, generated URIs do not include .php.

To preserve it:


Explicit URI Composition (Relative Paths)

The generated Uri helper allows composing URIs explicitly using relative paths.

This is especially useful when using --index and building links in templates.

Rule

If the first argument starts with /, it is treated as a path relative to the base URI.

Examples

With parameters:

Query string:

This mechanism performs simple string substitution only. It does not define routes, validate parameters, or perform dispatching.


Output Modes

Dry Run

Generates the catalog without writing files.

JSON Export

Outputs the URI map as JSON instead of generating a class.


Generated Helper Class

The generated Uri class provides:

As well as request helpers:


Design Philosophy

URI Mapper is intentionally minimal.

It exists solely to make important URIs explicit, stable, and easy to reference.

Use it where it helps — ignore it where it doesn’t.


License

MIT © Eril TS Carvalho


All versions of uri-mapper with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eril/uri-mapper contains the following files

Loading the files please wait ...