use PhpRequirements\PhpRequirements; $requirements = new PhpRequirements(); $requirements->addRequirement('php', '>7.2.0'); $requirements->evaluate(); if (!$requirements->isFulfilled()) { echo 'Your server does not meet the minimum requirements.'; die(); } echo 'Your server meets the minimum requirements.';
use PhpRequirements\PhpRequirements; $requirements = new PhpRequirements(); $requirements->addRequirement('ext-pdo', true); $requirements->addRequirement('ext-curl', true); $requirements->evaluate(); if (!$requirements->isFulfilled()) { echo 'Your server is missing some required extensions.'; die(); } echo 'Your server has all the required extensions.';In this example, we use the `addRequirement` method to add two requirements for the `pdo` and `curl` extensions. We set the value to `true` to indicate that these extensions are required. We then evaluate the requirements and check if they are fulfilled using the `isFulfilled` method. PHP Requirements is a standalone library that doesn't require any package dependencies.