Add support for phpize and php-config

This commit is contained in:
Shivam Mathur
2020-01-17 12:58:28 +05:30
parent 65ccfb36dc
commit 320474a245
5 changed files with 118 additions and 8 deletions

View File

@ -269,6 +269,41 @@ export async function addArchive(
return (await getArchiveCommand(os_version)) + url + ' ' + tool;
}
/**
* Function to get the script to setup php-config and phpize
*
* @param tool
* @param os_version
*/
export async function addDevTools(
tool: string,
os_version: string
): Promise<string> {
switch (os_version) {
case 'linux':
return (
'add_devtools' +
'\n' +
(await utils.addLog('$tick', tool, 'Added', 'linux'))
);
case 'darwin':
return await utils.addLog('$tick', tool, 'Added', 'darwin');
case 'win32':
return await utils.addLog(
'$cross',
tool,
tool + ' is not a windows tool',
'win32'
);
default:
return await utils.log(
'Platform ' + os_version + ' is not supported',
os_version,
'error'
);
}
}
/**
* Helper function to get script to setup a tool using composer
*
@ -368,6 +403,10 @@ export async function addTools(
case 'pecl':
script += await getPECLCommand(os_version);
break;
case 'php-config':
case 'phpize':
script += await addDevTools(tool, os_version);
break;
default:
script += await utils.addLog(
'$cross',