本文整理匯總了PHP中Zephir\Utils::isWindows方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utils::isWindows方法的具體用法?PHP Utils::isWindows怎麽用?PHP Utils::isWindows使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zephir\Utils
的用法示例。
在下文中一共展示了Utils::isWindows方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: install
/**
* Compiles and installs the extension
*
* @param CommandInterface $command
* @param boolean $development
*
* @throws Exception
*/
public function install(CommandInterface $command, $development = false)
{
/**
* Get global namespace
*/
$namespace = str_replace('\\', '_', $this->checkDirectory());
@unlink("compile.log");
@unlink("compile-errors.log");
@unlink("ext/modules/" . $namespace . ".so");
$this->compile($command, $development);
if (Utils::isWindows()) {
$this->logger->output("Installation is not implemented for windows yet! Aborting!");
exit;
}
$this->logger->output('Installing...');
$gccFlags = $this->getGccFlags($development);
$currentDir = getcwd();
exec('(cd ext && export CC="gcc" && export CFLAGS="' . $gccFlags . '" && sudo make install 2>>' . $currentDir . '/compile-errors.log 1>>' . $currentDir . '/compile.log)', $output, $exit);
if (!file_exists("ext/modules/" . $namespace . ".so")) {
throw new CompilerException("Internal extension compilation failed. Check compile-errors.log for more information");
}
$this->logger->output('Extension installed!');
if (!extension_loaded($namespace)) {
$this->logger->output('Add extension=' . $namespace . '.so to your php.ini');
}
$this->logger->output('Don\'t forget to restart your web server');
}
示例2: test
/**
* Run tests
*
* @param CommandInterface $command
*/
public function test(CommandInterface $command)
{
/**
* Get global namespace
*/
$namespace = $this->checkDirectory();
$this->logger->output('Running tests...');
if (!Utils::isWindows()) {
system('export CC="gcc" && export CFLAGS="-O0 -g" && export NO_INTERACTION=1 && cd ext && make test', $exit);
}
}