mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Improve support for sqlsrv and pdo_sqlsrv
This commit is contained in:
parent
9d74a11420
commit
408b70728f
@ -56,6 +56,7 @@ describe('Extension tests', () => {
|
|||||||
${'pdo_cubrid'} | ${'7.4'} | ${'add_pdo_extension cubrid'}
|
${'pdo_cubrid'} | ${'7.4'} | ${'add_pdo_extension cubrid'}
|
||||||
${'pdo_mysql'} | ${'7.4'} | ${'add_pdo_extension mysql'}
|
${'pdo_mysql'} | ${'7.4'} | ${'add_pdo_extension mysql'}
|
||||||
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
||||||
|
${'pdo_sqlsrv'} | ${'7.4'} | ${'add_sqlsrv pdo_sqlsrv'}
|
||||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||||
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
|
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
|
||||||
${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'}
|
${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'}
|
||||||
@ -92,6 +93,7 @@ describe('Extension tests', () => {
|
|||||||
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
||||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||||
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
||||||
|
${'sqlsrv'} | ${'7.3'} | ${'add_sqlsrv sqlsrv'}
|
||||||
`(
|
`(
|
||||||
'checking addExtensionOnDarwin for extension $extension on version $version',
|
'checking addExtensionOnDarwin for extension $extension on version $version',
|
||||||
async ({extension, version, output}) => {
|
async ({extension, version, output}) => {
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -234,6 +234,7 @@ async function addExtensionDarwin(extension_csv, version) {
|
|||||||
case /^couchbase$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(extension):
|
case /^couchbase$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(extension):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
|
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
|
||||||
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
add_script += await utils.customPackage(ext_name, 'extensions', extension, 'darwin');
|
add_script += await utils.customPackage(ext_name, 'extensions', extension, 'darwin');
|
||||||
return;
|
return;
|
||||||
case /.+-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(extension):
|
case /.+-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(extension):
|
||||||
@ -348,6 +349,7 @@ async function addExtensionLinux(extension_csv, version) {
|
|||||||
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||||
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
add_script += await utils.customPackage(ext_name, 'extensions', extension, 'linux');
|
add_script += await utils.customPackage(ext_name, 'extensions', extension, 'linux');
|
||||||
return;
|
return;
|
||||||
case /.+-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(extension):
|
case /.+-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(extension):
|
||||||
|
@ -44,6 +44,7 @@ export async function addExtensionDarwin(
|
|||||||
):
|
):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
|
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
|
||||||
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
'extensions',
|
'extensions',
|
||||||
@ -267,6 +268,7 @@ export async function addExtensionLinux(
|
|||||||
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||||
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
'extensions',
|
'extensions',
|
||||||
|
15
src/scripts/extensions/sqlsrv.sh
Normal file
15
src/scripts/extensions/sqlsrv.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Function to get sqlsrv and pdo_sqlsrv version.
|
||||||
|
get_sqlsrv_version() {
|
||||||
|
if [[ "${version:?}" =~ 7.[0-2] ]]; then
|
||||||
|
echo '5.9.0'
|
||||||
|
else
|
||||||
|
echo '5.10.0beta2'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to install sqlsrv and pdo_sqlsrv.
|
||||||
|
add_sqlsrv() {
|
||||||
|
ext=$1
|
||||||
|
ext_version=$(get_sqlsrv_version)
|
||||||
|
add_pecl_extension "$ext" "$ext_version" extension
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user