checkPhpExtensionVersion() public method

Checks if the given PHP extension is available and its version matches the given one.
public checkPhpExtensionVersion ( string $extensionName, string $version, string $compare = '>=' ) : boolean
$extensionName string PHP extension name.
$version string required PHP extension version.
$compare string comparison operator, by default '>='
return boolean if PHP extension version matches.
示例#1
0
 public function testCheckPhpExtensionVersion()
 {
     if (defined('HHVM_VERSION')) {
         $this->markTestSkipped('Can not test this on HHVM.');
     }
     $requirementsChecker = new YiiRequirementChecker();
     $this->assertFalse($requirementsChecker->checkPhpExtensionVersion('some_unexisting_php_extension', '0.1'), 'No fail while checking unexisting extension!');
     $this->assertTrue($requirementsChecker->checkPhpExtensionVersion('pdo', '1.0'), 'Unable to check PDO version!');
 }
 public function testCheckPhpExtensionVersion()
 {
     $requirementsChecker = new YiiRequirementChecker();
     $this->assertFalse($requirementsChecker->checkPhpExtensionVersion('some_unexisting_php_extension', '0.1'), 'No fail while checking unexisting extension!');
     $this->assertTrue($requirementsChecker->checkPhpExtensionVersion('pdo', '1.0'), 'Unable to check PDO version!');
 }