Use pre-compiled PCOV binary for PHP7.4 on windows

This commit is contained in:
Shivam Mathur
2019-10-04 13:30:16 +05:30
parent 06929bdf4c
commit ba5306eea9
7 changed files with 33 additions and 34 deletions

BIN
src/ext/php_pcov.dll Normal file

Binary file not shown.

View File

@ -26,16 +26,18 @@ if($installed -ne $version) {
}
echo "Housekeeping in PHP.ini, enabling openssl"
$ext_dir = "C:\tools\php\ext"
Add-Content C:\tools\php\php.ini "date.timezone = 'UTC'"
Set-PhpIniKey extension_dir C:\tools\php\ext
Set-PhpIniKey extension_dir $ext_dir
if($version -lt '7.4') {
Enable-PhpExtension openssl
} else {
Add-Content C:\tools\php\php.ini "extension=php_openssl.dll"
Copy-Item "php_pcov.dll" -Destination $ext_dir"\php_pcov.dll"
}
echo "Installing Composer"
Install-Composer -Scope System -Path C:\tools\php
$ext_dir = Get-PhpIniKey extension_dir
php -v
composer -V

View File

@ -70,33 +70,22 @@ export async function readScript(
path.join(__dirname, '../src/scripts/7.4.sh'),
'utf8'
);
case '7.3':
default:
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
}
break;
case 'linux':
switch (version) {
case '7.4':
await readFiles74(['scripts/xdebug.sh', 'scripts/pcov.sh']);
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
case '7.3':
default:
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
break;
}
break;
case 'win32':
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
switch (version) {
case '7.4':
await readFiles74(['ext/php_pcov.dll']);
break;
}
break;
default:
return await log(
'Platform ' + os_version + ' is not supported',
@ -104,6 +93,11 @@ export async function readScript(
'error'
);
}
return fs.readFileSync(
path.join(__dirname, '../src/scripts/' + filename),
'utf8'
);
}
/**
@ -189,7 +183,7 @@ export async function log(
}
export async function getExtensionPrefix(extension: string): Promise<string> {
let zend: Array<string> = ['xdebug', 'opcache'];
let zend: Array<string> = ['xdebug', 'opcache', 'ioncube', 'eaccelerator'];
switch (zend.indexOf(extension)) {
case 0:
case 1: