本文整理匯總了PHP中SebastianBergmann\Environment\Runtime::isHHVM方法的典型用法代碼示例。如果您正苦於以下問題:PHP Runtime::isHHVM方法的具體用法?PHP Runtime::isHHVM怎麽用?PHP Runtime::isHHVM使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SebastianBergmann\Environment\Runtime
的用法示例。
在下文中一共展示了Runtime::isHHVM方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor.
*
* @param PHP_CodeCoverage_Driver $driver
* @param PHP_CodeCoverage_Filter $filter
* @throws PHP_CodeCoverage_Exception
*/
public function __construct(PHP_CodeCoverage_Driver $driver = null, PHP_CodeCoverage_Filter $filter = null)
{
if ($driver === null) {
$runtime = new Runtime();
if ($runtime->isHHVM()) {
$driver = new PHP_CodeCoverage_Driver_HHVM();
} elseif ($runtime->hasXdebug()) {
$driver = new PHP_CodeCoverage_Driver_Xdebug();
} else {
throw new PHP_CodeCoverage_Exception('No code coverage driver available');
}
}
if ($filter === null) {
$filter = new PHP_CodeCoverage_Filter();
}
$this->driver = $driver;
$this->filter = $filter;
}
示例2: testCanBeDetected
/**
* @covers \SebastianBergmann\Environment\Runtime::isHHVM
*/
public function testCanBeDetected()
{
$this->assertInternalType('boolean', $this->env->isHHVM());
}
示例3: selectDriver
/**
* @return PHP_CodeCoverage_Driver
* @throws PHP_CodeCoverage_RuntimeException
*/
private function selectDriver()
{
$runtime = new Runtime();
if (!$runtime->canCollectCodeCoverage()) {
throw new PHP_CodeCoverage_RuntimeException('No code coverage driver available');
}
if ($runtime->isHHVM()) {
return new PHP_CodeCoverage_Driver_HHVM();
} elseif ($runtime->isPHPDBG()) {
return new PHP_CodeCoverage_Driver_PHPDBG();
} else {
return new PHP_CodeCoverage_Driver_Xdebug();
}
}