{"id":22862196,"url":"https://github.com/webforge-labs/webforge-configuration-tester","last_synced_at":"2025-09-08T05:34:53.257Z","repository":{"id":20804971,"uuid":"24090390","full_name":"webforge-labs/webforge-configuration-tester","owner":"webforge-labs","description":"test your php configuration from cli or unit tests","archived":false,"fork":false,"pushed_at":"2014-09-16T08:26:28.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T13:19:29.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/webforge-labs.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":"2014-09-16T07:49:54.000Z","updated_at":"2014-09-16T08:04:52.000Z","dependencies_parsed_at":"2022-08-19T04:21:29.165Z","dependency_job_id":null,"html_url":"https://github.com/webforge-labs/webforge-configuration-tester","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webforge-labs%2Fwebforge-configuration-tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webforge-labs%2Fwebforge-configuration-tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webforge-labs%2Fwebforge-configuration-tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webforge-labs%2Fwebforge-configuration-tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webforge-labs","download_url":"https://codeload.github.com/webforge-labs/webforge-configuration-tester/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443524,"owners_count":20778247,"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-13T10:12:38.435Z","updated_at":"2025-03-31T08:45:28.014Z","avatar_url":"https://github.com/webforge-labs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webforge-configuration-tester [![Build Status](https://travis-ci.org/webforge-labs/webforge-configuration-tester.svg)](https://travis-ci.org/webforge-labs/webforge-configuration-tester) [![Latest Stable Version](https://poser.pugx.org/webforge/configuration-tester/v/stable.svg)](https://packagist.org/packages/webforge/configuration-tester)\n\ntest your php configuration from cli or unit tests\nThe ConfigurationTester is able to check configuration of the environment (currently PHP-ini values) to a set of fixed values. The php.ini settings can be received through the ConfigurationRetriever (for example from a apache dump-script).\n\n```php\nuse Webforge\\Setup\\ConfigurationTester;\n\n$t = new ConfigurationTester();\n$t-\u003eINI('mbstring.internal_encoding', 'utf-8');\n```\n\nYou can use several operators to compare values\n```php\n$t-\u003eINI('post_max_size','2M', '\u003e=');\n$t-\u003eINI('post_max_size',1024, '\u003c');\n```\n\nvalues like \"2M\" (filesizes) will get normalized, so that it is natural to compare them.\n```php\n// if ini_get('post_max_size') is \"2M\" or 2097152 doesn't matter\n$t-\u003eINI('post_max_size',2*1024*1024);\n$t-\u003eINI('post_max_size','2M');\n```\n\nYou can use the ConfigurationTester to test your webserver (or other remotes) PHP-ini values:\n```php\nuse Webforge\\Setup\\ConfigurationTester;\nuse Webforge\\Setup\\RemoteConfigurationRetriever;\n\n$t = new ConfigurationTester(new RemoteConfigurationRetriever('http://localhost:80/dump-inis.php'));\n```\n\nput dump-inis.php into webroot with this contents:\n```php\n\u003c?php\nprint json_encode(ini_get_all());\n?\u003e\n```\n\nYou can get the results of the checks, with retrieving the defects. They are instances from ConfigurationDefect Class and can be converted to String to verbose their failure:\n```php\nif (count($t-\u003egetDefects()) \u003e 0) {\n  throw new \\RuntimeException('Please check your Config: '.implode(\"\\n\", $t-\u003egetDefects()));\n}\n```\nYou could get nicer formatted output with the ConfigurationTester::__toString(). This may change in the future for a ConfigurationTesterPrinter or something..\n```php\nprint $t;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebforge-labs%2Fwebforge-configuration-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebforge-labs%2Fwebforge-configuration-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebforge-labs%2Fwebforge-configuration-tester/lists"}