{"id":15525357,"url":"https://github.com/ghostwriter/http","last_synced_at":"2025-04-23T08:48:14.373Z","repository":{"id":37071724,"uuid":"498079377","full_name":"ghostwriter/http","owner":"ghostwriter","description":"[wip]HTTP Client and Server abstraction for PHP","archived":false,"fork":false,"pushed_at":"2024-07-17T19:51:55.000Z","size":367,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-03T10:57:04.123Z","etag":null,"topics":["ghostwriter","http","php"],"latest_commit_sha":null,"homepage":"https://github.com/ghostwriter/http","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/ghostwriter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ghostwriter"]}},"created_at":"2022-05-30T19:53:52.000Z","updated_at":"2024-07-17T19:49:06.000Z","dependencies_parsed_at":"2024-04-07T12:31:18.604Z","dependency_job_id":"5e44ad9a-f39d-43ad-97d2-1eadce28170b","html_url":"https://github.com/ghostwriter/http","commit_stats":{"total_commits":103,"total_committers":1,"mean_commits":103.0,"dds":0.0,"last_synced_commit":"bed5fd18d013532817b8a35712b60cee0769303c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"ghostwriter/wip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostwriter%2Fhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostwriter","download_url":"https://codeload.github.com/ghostwriter/http/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":220665362,"owners_count":16684960,"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":["ghostwriter","http","php"],"created_at":"2024-10-02T10:57:03.161Z","updated_at":"2024-10-20T02:43:54.189Z","avatar_url":"https://github.com/ghostwriter.png","language":"PHP","funding_links":["https://github.com/sponsors/ghostwriter"],"categories":[],"sub_categories":[],"readme":"# HTTP\n\n[![Compliance](https://github.com/ghostwriter/http/actions/workflows/compliance.yml/badge.svg)](https://github.com/ghostwriter/http/actions/workflows/compliance.yml)\n[![Supported PHP Version](https://badgen.net/packagist/php/ghostwriter/http?color=8892bf)](https://www.php.net/supported-versions)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/ghostwriter?label=Sponsor+@ghostwriter/http\u0026logo=GitHub+Sponsors)](https://github.com/sponsors/ghostwriter)\n[![Code Coverage](https://codecov.io/gh/ghostwriter/http/branch/main/graph/badge.svg)](https://codecov.io/gh/ghostwriter/http)\n[![Type Coverage](https://shepherd.dev/github/ghostwriter/http/coverage.svg)](https://shepherd.dev/github/ghostwriter/http)\n[![Latest Version on Packagist](https://badgen.net/packagist/v/ghostwriter/http)](https://packagist.org/packages/ghostwriter/http)\n[![Downloads](https://badgen.net/packagist/dt/ghostwriter/http?color=blue)](https://packagist.org/packages/ghostwriter/http)\n\nHTTP Client and Server abstraction for PHP.\n\n\u003e **Warning**\n\u003e\n\u003e This project is not finished yet, work in progress.\n\n## Installation\n\nYou can install the package via composer:\n\n``` bash\ncomposer require ghostwriter/http\n```\n\n## Usage\n\n```php\n\n$router = new Router();\n\n$router-\u003eaddRoute('GET', '/', HomeHandler::class, [GuestMiddleware::class]);\n\n$router-\u003eget('/about', AboutHandler::class, [GuestMiddleware::class]);\n\n$router-\u003eget('/auth/github', GitHubLoginHandler::class, [GuestMiddleware::class], 'auth.login.github');\n\n    // create, read, edit, update, store, delete, view, show \n$router-\u003emiddleware([GuestMiddleware::class], function($router){\n    $router-\u003eget('/auth/login', LoginCreateHandler::class, 'auth.login.create');\n    $router-\u003epost('/auth/login', LoginStoreHandler::class, 'auth.login.store');\n\n    $router-\u003eget('/auth/register', RegisterCreateHandler::class, 'auth.register.create');\n    $router-\u003epost('/auth/register', RegisterStoreHandler::class, 'auth.register.store');\n\n    $router-\u003eget('/posts', PostIndexHandler::class, 'members.index');\n    $router-\u003eget('/posts/{post:id}', PostShowHandler::class, 'members.show');\n});\n\n$router-\u003emiddleware([AuthMiddleware::class], function($router){\n    $router-\u003eget('/users', MembersIndexHandler::class, 'members.index');\n    $router-\u003eget('/users/{member:id}', MemberShowHandler::class, 'members.show');\n\n    $router-\u003eget('/posts/create', PostCreateHandler::class, 'members.create');\n    $router-\u003epost('/posts', PostStoreHandler::class, 'members.store');\n    $router-\u003eget('/posts/{post:id}/edit', PostEditHandler::class, 'members.edit');\n    $router-\u003eput('/posts/{post:id}', PostUpdateHandler::class, 'members.update');\n    $router-\u003edelete('/posts/{post:id}', PostDeleteHandler::class, 'members.delete');\n});\n\n$request = new ServerRequest();\n\n$server = new Server($router); // RequestHandler\n\n$server-\u003ehandle($request); // Response\n\n```\n\n### Changelog\n\nPlease see [CHANGELOG.md](./CHANGELOG.md) for more information what has changed recently.\n\n### Security\n\nIf you discover any security related issues, please email `nathanael.esayeas@protonmail.com` or create a [Security Advisory](https://github.com/ghostwriter/clock/security/advisories/new) instead of using the issue tracker.\n\n## License\n\nThe BSD-3-Clause. Please see [License File](./LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostwriter%2Fhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostwriter%2Fhttp/lists"}