{"id":24694465,"url":"https://github.com/roadrunner-php/version-checker","last_synced_at":"2025-10-09T01:31:05.605Z","repository":{"id":152595808,"uuid":"626370723","full_name":"roadrunner-php/version-checker","owner":"roadrunner-php","description":"Version checker for RoadRunner binary","archived":false,"fork":false,"pushed_at":"2025-08-11T23:57:00.000Z","size":41,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"1.x","last_synced_at":"2025-09-29T23:53:03.544Z","etag":null,"topics":["php","roadrunner"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"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/roadrunner-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"roadrunner-server"}},"created_at":"2023-04-11T10:34:42.000Z","updated_at":"2025-09-08T15:15:01.000Z","dependencies_parsed_at":"2025-05-20T09:39:21.310Z","dependency_job_id":"8f08afac-f93d-4a24-a151-ccc3ced73232","html_url":"https://github.com/roadrunner-php/version-checker","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/roadrunner-php/version-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roadrunner-php%2Fversion-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roadrunner-php%2Fversion-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roadrunner-php%2Fversion-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roadrunner-php%2Fversion-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roadrunner-php","download_url":"https://codeload.github.com/roadrunner-php/version-checker/tar.gz/refs/heads/1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roadrunner-php%2Fversion-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000725,"owners_count":26082895,"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-10-08T02:00:06.501Z","response_time":56,"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":["php","roadrunner"],"created_at":"2025-01-26T23:59:48.767Z","updated_at":"2025-10-09T01:31:05.273Z","avatar_url":"https://github.com/roadrunner-php.png","language":"PHP","funding_links":["https://github.com/sponsors/roadrunner-server"],"categories":[],"sub_categories":[],"readme":"# RoadRunner VersionChecker\n\n[![PHP Version Require](https://poser.pugx.org/roadrunner-php/version-checker/require/php)](https://packagist.org/packages/roadrunner-php/version-checker)\n[![Latest Stable Version](https://poser.pugx.org/roadrunner-php/version-checker/v/stable)](https://packagist.org/packages/roadrunner-php/version-checker)\n[![phpunit](https://github.com/roadrunner-php/version-checker/actions/workflows/phpunit.yml/badge.svg)](https://github.com/roadrunner-php/version-checker/actions)\n[![psalm](https://github.com/roadrunner-php/version-checker/actions/workflows/psalm.yml/badge.svg)](https://github.com/roadrunner-php/version-checker/actions)\n[![Codecov](https://codecov.io/gh/roadrunner-php/version-checker/branch/master/graph/badge.svg)](https://codecov.io/gh/roadrunner-php/version-checker)\n[![Total Downloads](https://poser.pugx.org/roadrunner-php/version-checker/downloads)](https://packagist.org/roadrunner-php/version-checker/phpunit)\n\u003ca href=\"https://discord.gg/8bZsjYhVVk\"\u003e\u003cimg src=\"https://img.shields.io/badge/discord-chat-magenta.svg\"\u003e\u003c/a\u003e\n\n## Requirements\n\nMake sure that your server is configured with following PHP version and extensions:\n\n- PHP 8.0+\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require roadrunner-php/version-checker\n```\n\n## Usage\n\nUse the `RoadRunner\\VersionChecker\\VersionChecker` methods to check the compatibility of the installed RoadRunner\nversion. The VersionChecker class has three public methods:\n\n- **greaterThan** - Checks if the installed version of RoadRunner is **greater than or equal** to the specified version.\n  If no version is specified, the minimum required version will be determined based on the minimum required version of\n  the `spiral/roadrunner` package.\n- **lessThan** - Checks if the installed version of RoadRunner is **less than or equal** to the specified version.\n- **equal** - Checks if the installed version of RoadRunner is **equal** to the specified version.\n\nAll three methods throw an `RoadRunner\\VersionChecker\\Exception\\UnsupportedVersionException` if the installed version\nof RoadRunner does not meet the specified requirements. If RoadRunner is not installed, a\n`RoadRunner\\VersionChecker\\Exception\\RoadrunnerNotInstalledException` is thrown.\n\n```php\nuse RoadRunner\\VersionChecker\\VersionChecker;\nuse RoadRunner\\VersionChecker\\Exception\\UnsupportedVersionException;\n\n$checker = new VersionChecker();\n\ntry {\n    $checker-\u003egreaterThan('2023.1');\n} catch (UnsupportedVersionException $exception) {\n    var_dump($exception-\u003egetMessage()); // Installed RoadRunner version `2.12.3` not supported. Requires version `2023.1` or higher.\n    var_dump($exception-\u003egetInstalledVersion()); // 2.12.3\n    var_dump($exception-\u003egetRequestedVersion()); // 2023.1\n}\n\ntry {\n    $checker-\u003elessThan('2.11');\n} catch (UnsupportedVersionException $exception) {\n    var_dump($exception-\u003egetMessage()); // Installed RoadRunner version `2.12.3` not supported. Requires version `2.11` or lower.\n    var_dump($exception-\u003egetInstalledVersion()); // 2.12.3\n    var_dump($exception-\u003egetRequestedVersion()); // 2.11\n}\n\ntry {\n    $checker-\u003eequal('2.11');\n} catch (UnsupportedVersionException $exception) {\n    var_dump($exception-\u003egetMessage()); // Installed RoadRunner version `2.12.3` not supported. Requires version `2.11`.\n    var_dump($exception-\u003egetInstalledVersion()); // 2.12.3\n    var_dump($exception-\u003egetRequestedVersion()); // 2.11\n}\n```\n\n### Path to the RoadRunner binary\n\nTo configure the `VersionChecker` to search for the RoadRunner binary in a location other than the default\n(application root with a rr filename), you can bind the `RoadRunner\\VersionChecker\\Version\\InstalledInterface`\nwithin application container using the `RoadRunner\\VersionChecker\\Version\\Installed` class and passing the desired\nfile path as the **$executablePath** parameter. After that, you can retrieve the VersionChecker class from\napplication container.\n\nExample with Spiral Framework container:\n\n```php\nuse RoadRunner\\VersionChecker\\Version\\InstalledInterface;\nuse RoadRunner\\VersionChecker\\Version\\Installed;\n\n$container-\u003ebindSingleton(InstalledInterface::class, new Installed(executablePath: 'some/path'));\n$checker = $container-\u003eget(VersionChecker::class);\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n```bash\ncomposer psalm\n```\n\n```bash\ncomposer cs\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froadrunner-php%2Fversion-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froadrunner-php%2Fversion-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froadrunner-php%2Fversion-checker/lists"}