{"id":23505340,"url":"https://github.com/nabeghe/headers-reader-php","last_synced_at":"2025-09-14T20:03:40.725Z","repository":{"id":268920542,"uuid":"876886027","full_name":"nabeghe/headers-reader-php","owner":"nabeghe","description":"A simple way to read headers from the `getallheaders` function in PHP.","archived":false,"fork":false,"pushed_at":"2025-07-03T12:21:42.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-04T12:51:49.358Z","etag":null,"topics":["header","headers","php","php-headers","php-helper","php-helpers","php-libraries","php-library"],"latest_commit_sha":null,"homepage":"","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/nabeghe.png","metadata":{"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,"zenodo":null}},"created_at":"2024-10-22T18:02:38.000Z","updated_at":"2025-07-03T12:21:45.000Z","dependencies_parsed_at":"2025-07-26T13:39:38.014Z","dependency_job_id":"aab7e304-a524-45a5-bca5-ee946618ca6c","html_url":"https://github.com/nabeghe/headers-reader-php","commit_stats":null,"previous_names":["nabeghe/headers-reader-php"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nabeghe/headers-reader-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fheaders-reader-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fheaders-reader-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fheaders-reader-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fheaders-reader-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabeghe","download_url":"https://codeload.github.com/nabeghe/headers-reader-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fheaders-reader-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275160353,"owners_count":25415765,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"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":["header","headers","php","php-headers","php-helper","php-helpers","php-libraries","php-library"],"created_at":"2024-12-25T09:32:23.632Z","updated_at":"2025-09-14T20:03:40.682Z","avatar_url":"https://github.com/nabeghe.png","language":"PHP","readme":"# Headers Reader for PHP\n\n\u003e A simple way to read headers from the `getallheaders` function in PHP.\n\n## 🫡 Usage\n\n### 🚀 Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require nabeghe/headers-reader\n```\n\n### Example 1 - Main Class\n\n```php\nuse Nabeghe\\HeadersReader\\Headers;\n\necho 'X-Custom-1: '.Headers::get('X-Custom-1', 'The default value for X-Custom-1').\"\\n\u003cbr\u003e\";\necho 'X-Custom-2: '.Headers::get('X-Custom-2', 'The default value for X-Custom-2').\"\\n\u003cbr\u003e\";\necho 'X-Custom-3: '.Headers::get('X-Custom-3', 'The default value for X-Custom-3').\"\\n\u003cbr\u003e\";\necho 'X-Custom-4: '.Headers::get('X-Custom-4', 'The default value for X-Custom-4').\"\\n\u003cbr\u003e\";\necho 'X-Custom-5: '.Headers::get('X-Custom-4').\"\\n\u003cbr\u003e\u003cbr\u003e\"; // Default value is blank.\n\nprint_r(Headers::all()); // Returns all headers.\n\nHeaders::flush(); // Clears the cache.\n```\n\n### Example 1 - Custom Class\n\n```php\nuse Nabeghe\\HeadersReader\\Headers;\n\nclass MyHeaders extends Headers\n{\n    public const DEFAULT = 'The general default value';\n\n    public const DEFAULTS = [\n        'X-Custom-1' =\u003e 'The default value for X-Custom-1',\n        'X-Custom-2' =\u003e 'The default value for X-Custom-2',\n        'X-Custom-3' =\u003e 'The default value for X-Custom-3',\n        'X-Custom-4' =\u003e 'The default value for X-Custom-4',\n    ];\n}\n\necho 'X-Custom-1: '.MyHeaders::get('X-Custom-1').\"\\n\u003cbr\u003e\";\necho 'X-Custom-2: '.MyHeaders::get('X-Custom-2').\"\\n\u003cbr\u003e\";\necho 'X-Custom-3: '.MyHeaders::get('X-Custom-3').\"\\n\u003cbr\u003e\";\necho 'X-Custom-4: '.MyHeaders::get('X-Custom-4').\"\\n\u003cbr\u003e\";\necho 'X-Custom-5: '.MyHeaders::get('X-Custom-5').\"\\n\u003cbr\u003e\";\n```\n\n## 📖 License\n\nLicensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabeghe%2Fheaders-reader-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabeghe%2Fheaders-reader-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabeghe%2Fheaders-reader-php/lists"}