{"id":24519427,"url":"https://github.com/mezzio/mezzio-tooling","last_synced_at":"2025-04-05T16:08:29.815Z","repository":{"id":36930977,"uuid":"231146278","full_name":"mezzio/mezzio-tooling","owner":"mezzio","description":"Migration and development tooling for Mezzio","archived":false,"fork":false,"pushed_at":"2024-10-21T11:16:17.000Z","size":1315,"stargazers_count":16,"open_issues_count":10,"forks_count":11,"subscribers_count":12,"default_branch":"2.10.x","last_synced_at":"2024-10-21T16:22:07.962Z","etag":null,"topics":["cli","mezzio","tooling"],"latest_commit_sha":null,"homepage":"https://docs.mezzio.dev/mezzio/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mezzio.png","metadata":{"funding":{"community_bridge":"laminas-project"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-31T21:03:25.000Z","updated_at":"2024-10-21T11:15:37.000Z","dependencies_parsed_at":"2024-06-18T14:05:33.674Z","dependency_job_id":"ec995da9-93ab-4faf-b769-4f5ce0304e38","html_url":"https://github.com/mezzio/mezzio-tooling","commit_stats":{"total_commits":504,"total_committers":27,"mean_commits":"18.666666666666668","dds":0.6309523809523809,"last_synced_commit":"0a6270f8db69e72f2ca9e017db75737a50f34456"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezzio%2Fmezzio-tooling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezzio%2Fmezzio-tooling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezzio%2Fmezzio-tooling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezzio%2Fmezzio-tooling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mezzio","download_url":"https://codeload.github.com/mezzio/mezzio-tooling/tar.gz/refs/heads/2.10.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361691,"owners_count":20926643,"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","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":["cli","mezzio","tooling"],"created_at":"2025-01-22T01:51:05.233Z","updated_at":"2025-04-05T16:08:29.798Z","avatar_url":"https://github.com/mezzio.png","language":"PHP","funding_links":["https://funding.communitybridge.org/projects/laminas-project"],"categories":[],"sub_categories":[],"readme":"# mezzio-tooling\n\n[![Build Status](https://github.com/mezzio/mezzio-tooling/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/mezzio/mezzio-tooling/actions/workflows/continuous-integration.yml)\n\n\u003e ## 🇷🇺 Русским гражданам\n\u003e\n\u003e Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.\n\u003e\n\u003e У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.\n\u003e\n\u003e Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите \"Нет войне!\"\n\u003e\n\u003e ## 🇺🇸 To Citizens of Russia\n\u003e\n\u003e We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.\n\u003e\n\u003e One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.\n\u003e\n\u003e You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say \"stop the war!\"\n\n*Migration and development tools for Mezzio.*\n\n## Installation\n\nInstall via composer:\n\n```bash\n$ composer require --dev mezzio/mezzio-tooling\n```\n\n## Command line tooling\n\nThis package exposes commands for [laminas-cli](https://docs.laminas.dev/laminas-cli), and may be invoked via `vendor/bin/laminas`.\n\n- `mezzio:action:create`: Create an action class file; this is an alias for the `mezzio:handler:create` command, listed below.\n- `mezzio:factory:create`: Create a factory class file for the named class.\n  The class file is created in the same directory as the class specified.\n- `mezzio:handler:create`: Create a PSR-15 request handler class file.\n  Also generates a factory for the generated class, and, if a template renderer is registered with the application container, generates a template and modifies the class to render it into a laminas-diactoros `HtmlResponse`.\n- `mezzio:middleware:create`: Create a PSR-15 middleware class file.\n- `mezzio:middleware:migrate-from-interop`: Migrate interop middlewares and delegators to PSR-15 middlewares and request handlers.\n- `mezzio:middleware:to-request-handler`: Migrate PSR-15 middleware to request handlers.\n- `mezzio:module:create`: Create and register a middleware module with the application.\n- `mezzio:module:deregister`: Deregister a middleware module from the application.\n- `mezzio:module:register`: Register a middleware module with the application.\n- `mezzio:routes:list`: List the application's routing table.\n\n### Routes\n\n#### mezzio:routes:list\n\nThis command lists the application's routing table.\nFor each route, it prints its name, path, middleware, and any additional options, in a tabular format to the terminal.\nThe routes are listed in no particular order, by default.\n\nThe command supports several options, listed in the table below.\n\n\u003c!-- markdownlint-disable MD037 --\u003e\n| Command Long        | Command Short | Description                                                                                                                                                                                                                                                                                                                      |\n|---------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `--format`          | `-f`          | Set the format of the command's output. The supported values are `table`, which is the default, and `json`. If you set the format to json, then we recommend using [jq](https://stedolan.github.io/jq/manual/) to query/filter the command's output.                                                                             |\n| `--sort`            | `-s`          | Sort the command's output. The supported values are `name` and `path`.                                                                                                                                                                                                                                                           |\n| `--supports-method` | `-m`          | Accepts a comma-separated list of one or more HTTP methods, and filters out routes which don't support those methods.                                                                                                                                                                                                            |\n| `--has-path`        | `-p`          | Accepts a comma-separated list of one or more paths, and filters out routes with paths that don't match. The paths can be a regular expression, supported by the `preg_*` functions. For example, \"/,/api/ping,*/ping\".                                                                                                          |\n| `--has-name`        | `-n`          | Accepts a comma-separated list of one or more names, and filters out routes with names that don't match. The names can be fixed strings, or regular expressions supported by the `preg_*` functions. For example, \"user,user.register,*.register,user*\".                                                                         |\n| `--has-middleware`  | `-w`          | Accepts a comma-separated list of one or more middleware classes, and filters out routes that do not require those classes. The classes can be fully-qualified, unqualified, or a regular expression, supported by the preg_* functions. For example, \"\\Mezzio\\Middleware\\LazyLoadingMiddleware,LazyLoadingMiddleware,\\Mezzio*\". |\n\u003c!-- markdownlint-enable MD037 --\u003e\n\n##### Configuration\n\nBy default, `Mezzio\\Tooling\\Routes\\DefaultRoutesConfigLoaderFactory` registers a `ConfigLoaderInterface` service with the application's DI container, which retrieves the application's routes from two sources:\n\n- `config/routes.php`\n- Routes registered by any loaded `ConfigProvider` class\n\nHowever, this is a default/fallback implementation.\nIf you don't store any routes in `config/routes.php` or need a custom implementation, then you need to do two things:\n\n1. Write a custom loader implementation that implements `Mezzio\\Tooling\\Routes\\ConfigLoaderInterface`\n2. Register it with the application's DI container as an alias for `Mezzio\\Tooling\\Routes\\ConfigLoaderInterface`\n\n##### Usage Example\n\nHere is an example of what you can expect from running the command.\n\n```bash\n$ mezzio:routes:list\n\n+----------+-----------+---------+ Routes ---------------------------------+\n| Name     | Path      | Methods | Middleware                              |\n+----------+-----------+---------+-----------------------------------------+\n| api.ping | /api/ping | GET     | Mezzio\\Middleware\\LazyLoadingMiddleware |\n| home     | /         | GET     | Mezzio\\Middleware\\LazyLoadingMiddleware |\n+----------+-----------+---------+-----------------------------------------+\n```\n\nHere is an example of what you can expect from running the command and setting the format to `json` (formatted with [jq][jq_url]).\n\n```bash\n$ mezzio:routes:list --format=json | jq\n\n[\n  {\n    \"name\": \"api.ping\",\n    \"path\": \"/api/ping\",\n    \"methods\": \"GET\",\n    \"middleware\": \"Mezzio\\\\Middleware\\\\LazyLoadingMiddleware\"\n  },\n  {\n    \"name\": \"home\",\n    \"path\": \"/\",\n    \"methods\": \"GET\",\n    \"middleware\": \"Mezzio\\\\Middleware\\\\LazyLoadingMiddleware\"\n  }\n]\n```\n\n\u003e [!NOTE]\n\u003e Versions of mezzio/mezzio-tooling prior to v2.0 exposed a `vendor/bin/mezzio` binary, and the various commands exposed all lacked the `mezzio:` prefix, with the following more specific changes:\n\u003e\n\u003e - `mezzio:middleware:migrate-from-interop` was previously `migrate:interop-middleware`\n\u003e - `mezzio:middleware:to-request-handler` was previously `migrate:middleware-to-request-handler`\n\n## Configurable command option values\n\nIf the `--modules-path` of your project is not under `src`, you can either provide the path via the `--modules-path` command-line option, or configure it within your application configuration.\nBy adding the changed path to your application configuration, you can omit the need to use the `--modules-path` option during cli execution for the various `mezzio:module:*` commands.\n\n```php\n// In config/autoload/application.global.php:\n\n\u003c?php\n\ndeclare(strict_types = 1);\n\nuse Mezzio\\Tooling\\Module\\CommandCommonOptions;\n\nreturn [\n    /* ... */\n    CommandCommonOptions::class =\u003e [\n        '--modules-path' =\u003e 'custom-directory',\n    ],\n];\n```\n\n[jq_url]: https://jqlang.github.io/jq/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmezzio%2Fmezzio-tooling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmezzio%2Fmezzio-tooling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmezzio%2Fmezzio-tooling/lists"}