{"id":22508433,"url":"https://github.com/jamesrezo/webhelper-parser","last_synced_at":"2025-07-20T09:41:46.262Z","repository":{"id":62547725,"uuid":"67290969","full_name":"JamesRezo/webhelper-parser","owner":"JamesRezo","description":"Web Server Configuration File Generic Parser","archived":false,"fork":false,"pushed_at":"2019-12-17T21:35:22.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T02:12:39.714Z","etag":null,"topics":[],"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/JamesRezo.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":"2016-09-03T13:16:18.000Z","updated_at":"2019-12-17T21:35:24.000Z","dependencies_parsed_at":"2022-11-02T22:30:29.846Z","dependency_job_id":null,"html_url":"https://github.com/JamesRezo/webhelper-parser","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesRezo%2Fwebhelper-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesRezo%2Fwebhelper-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesRezo%2Fwebhelper-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesRezo%2Fwebhelper-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesRezo","download_url":"https://codeload.github.com/JamesRezo/webhelper-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944106,"owners_count":20697960,"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":[],"created_at":"2024-12-07T01:20:26.391Z","updated_at":"2025-03-28T00:14:54.305Z","avatar_url":"https://github.com/JamesRezo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Server Configuration File Generic Parser\nPart of [WebHelper](http://github.com/JamesRezo/WebHelper), a Generic Httpd Configuration Helper.\n\n[![Build Status](https://travis-ci.org/JamesRezo/webhelper-parser.svg?branch=master)](https://travis-ci.org/JamesRezo/webhelper-parser)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/JamesRezo/webhelper-parser/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/JamesRezo/webhelper-parser/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/JamesRezo/webhelper-parser/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/JamesRezo/webhelper-parser/?branch=master)\n[![Code Climate](https://codeclimate.com/github/JamesRezo/webhelper-parser/badges/gpa.svg)](https://codeclimate.com/github/JamesRezo/webhelper-parser)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/2ef11e52-9098-4c72-a0c2-c83996e9bf62/mini.png)](https://insight.sensiolabs.com/projects/2ef11e52-9098-4c72-a0c2-c83996e9bf62)\n[![Dependency Status](https://www.versioneye.com/user/projects/57e64724bd6fa6004e1204da/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/57e64724bd6fa6004e1204da)\n[![Latest Stable Version](https://poser.pugx.org/webhelper/parser/v/stable)](https://packagist.org/packages/webhelper/parser)\n[![License](https://poser.pugx.org/webhelper/parser/license)](https://packagist.org/packages/webhelper/parser)\n[![StyleCI](https://styleci.io/repos/67290969/shield?branch=master)](https://styleci.io/repos/67290969)\n\n## Installation\n\n```composer require webhelper/parser```\n\n## Basic Usage\n\nParse an Apache configuration file:\n```php\nuse WebHelper\\Parser\\Factory;\nuse WebHelper\\Parser\\ParserException;\nuse WebHelper\\Parser\\InvalidConfigException;\n\n$factory = new Factory()\n$parser = $factory-\u003ecreateParser('apache');\n$parser-\u003egetServer()-\u003esetPrefix('/usr');\n\ntry {\n    $activeConfig = $parser\n        -\u003esetConfigFile('/private/etc/apache2/httpd.conf')\n        -\u003egetActiveConfig();\n\n    echo $parser-\u003egetOriginalConfig();\n\n    echo var_export($activeConfig, true).PHP_EOL;\n} catch (ParserException $e) {\n    //file not found\n    var_dump($e-\u003egetMessage());\n} catch (InvalidConfigException $e) {\n    //empty config or syntax error\n    var_dump($e-\u003egetMessage());\n}\n```\n\nOr the same with Nginx\n```php\nuse WebHelper\\Parser\\Factory;\n\n$factory = new Factory()\n$parser = $factory-\u003ecreateParser('nginx');\n$parser-\u003egetServer()-\u003esetPrefix('/usr/sbin/');\n\n$activeConfig = $parser\n        -\u003esetConfigFile('/etc/nginx/nginx.conf')\n        -\u003egetActiveConfig();\n\n// etc...\n```\n\n## Known issues\n\n- Does not support old macos9 file format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesrezo%2Fwebhelper-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesrezo%2Fwebhelper-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesrezo%2Fwebhelper-parser/lists"}