mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-08-15 01:54:41 +07:00
Add support for phive
This commit is contained in:
@ -67,6 +67,11 @@ add_tool() {
|
||||
add_log "$cross" "$tool" "Could not setup $tool"
|
||||
fi
|
||||
fi
|
||||
if [ "$tool" = "phive" ]; then
|
||||
add_extension curl >/dev/null 2>&1
|
||||
add_extension mbstring >/dev/null 2>&1
|
||||
add_extension xml >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
add_composer_tool() {
|
||||
|
@ -83,6 +83,11 @@ add_tool() {
|
||||
if [ "$tool" = "composer" ]; then
|
||||
composer -q global config process-timeout 0
|
||||
fi
|
||||
if [ "$tool" = "phive" ]; then
|
||||
add_extension curl >/dev/null 2>&1
|
||||
add_extension mbstring >/dev/null 2>&1
|
||||
add_extension xml >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
add_composer_tool() {
|
||||
|
@ -115,6 +115,11 @@ Function Add-Tool() {
|
||||
Add-Log $cross $tool "Could not add $tool"
|
||||
}
|
||||
}
|
||||
if($tool -eq "phive") {
|
||||
Add-Extension curl >$null 2>&1
|
||||
Add-Extension mbstring >$null 2>&1
|
||||
Add-Extension xml >$null 2>&1
|
||||
}
|
||||
}
|
||||
|
||||
Function Add-Composer-Tool() {
|
||||
|
33
src/tools.ts
33
src/tools.ts
@ -180,6 +180,36 @@ export async function getCodeceptionUri(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get script to setup phive
|
||||
*
|
||||
* @param tool
|
||||
* @param version
|
||||
* @param url
|
||||
* @param os_version
|
||||
*/
|
||||
export async function addPhive(
|
||||
version: string,
|
||||
os_version: string
|
||||
): Promise<string> {
|
||||
switch (version) {
|
||||
case 'latest':
|
||||
return (
|
||||
(await getArchiveCommand(os_version)) +
|
||||
'https://phar.io/releases/phive.phar phive'
|
||||
);
|
||||
default:
|
||||
return (
|
||||
(await getArchiveCommand(os_version)) +
|
||||
'https://github.com/phar-io/phive/releases/download/' +
|
||||
version +
|
||||
'/phive-' +
|
||||
version +
|
||||
'.phar phive'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the PHPUnit url
|
||||
*
|
||||
@ -354,6 +384,9 @@ export async function addTools(
|
||||
url = github + 'squizlabs/PHP_CodeSniffer/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
case 'phive':
|
||||
script += await addPhive(version, os_version);
|
||||
break;
|
||||
case 'phpstan':
|
||||
url = github + 'phpstan/phpstan/' + uri;
|
||||
script += await addArchive(tool, version, url, os_version);
|
||||
|
Reference in New Issue
Block a user