{"id":20130474,"url":"https://github.com/drmvc/router","last_synced_at":"2026-05-13T03:09:12.037Z","repository":{"id":56972283,"uuid":"127050392","full_name":"drmvc/router","owner":"drmvc","description":"Simple router based on PSR-7 HTTP Message recommendation","archived":false,"fork":false,"pushed_at":"2018-04-18T19:44:11.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T21:42:48.123Z","etag":null,"topics":["psr-7","router"],"latest_commit_sha":null,"homepage":"https://drmvc.com/","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/drmvc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-27T21:57:11.000Z","updated_at":"2018-12-30T18:51:44.000Z","dependencies_parsed_at":"2022-08-21T12:50:16.852Z","dependency_job_id":null,"html_url":"https://github.com/drmvc/router","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/drmvc/router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmvc%2Frouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmvc%2Frouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmvc%2Frouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmvc%2Frouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drmvc","download_url":"https://codeload.github.com/drmvc/router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmvc%2Frouter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32965878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"online","status_checked_at":"2026-05-13T02:00:07.132Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["psr-7","router"],"created_at":"2024-11-13T20:38:48.078Z","updated_at":"2026-05-13T03:09:12.016Z","avatar_url":"https://github.com/drmvc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/drmvc/router/v/stable)](https://packagist.org/packages/drmvc/router)\n[![Build Status](https://travis-ci.org/drmvc/router.svg?branch=master)](https://travis-ci.org/drmvc/router)\n[![Total Downloads](https://poser.pugx.org/drmvc/router/downloads)](https://packagist.org/packages/drmvc/router)\n[![License](https://poser.pugx.org/drmvc/router/license)](https://packagist.org/packages/drmvc/router)\n[![PHP 7 ready](https://php7ready.timesplinter.ch/drmvc/router/master/badge.svg)](https://travis-ci.org/drmvc/router)\n[![Code Climate](https://codeclimate.com/github/drmvc/router/badges/gpa.svg)](https://codeclimate.com/github/drmvc/router)\n[![Scrutinizer CQ](https://scrutinizer-ci.com/g/drmvc/router/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/drmvc/router/)\n\n# DrMVC\\Router\n\nSimple router based on PSR-7 HTTP Message recommendation.\n\n    composer require drmvc/router\n\n## How to use\n\nMore examples you can find [here](extra).\n\n```php\n\u003c?php\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nuse Zend\\Diactoros\\ServerRequestFactory as ServerRequest;\nuse Zend\\Diactoros\\Response as ServerResponse;\nuse DrMVC\\Router;\n\n// PSR Request and Response\n$request = ServerRequest::fromGlobals();\n$response = new ServerResponse();\n\n// Router object\n$router = new Router($request, $response);\n\n// Set routes\n$router\n    -\u003eget('/aaa/\u003caction\u003e/\u003caction2\u003e', DrMVC\\Controllers\\Index::class)\n    -\u003eget('/bbb/zzz/ccc', 'App\\Controllers\\Index:default')\n    -\u003eget(\n        '/action/zzz',\n        function() {\n            echo \"action\\n\";\n        }\n    );\n\n$route = $router-\u003egetRoute();\nprint_r($route);\n```\n\n## About PHP Unit Tests\n\nFirst need to install all dev dependencies via `composer update`, then\nyou can run tests by hands from source directory via `./vendor/bin/phpunit` command.\n\n# Links\n\n* [DrMVC Framework](https://drmvc.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmvc%2Frouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrmvc%2Frouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmvc%2Frouter/lists"}