mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Fix blackfire-player to v1.9.3 for PHP 5.5 to PHP 7.0
This commit is contained in:
parent
294f03454a
commit
c8111b053c
@ -187,6 +187,21 @@ describe('Tools tests', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('checking getBlackfirePlayerUrl', async () => {
|
||||||
|
expect(await tools.getBlackfirePlayerUrl('latest', '7.4')).toBe(
|
||||||
|
'https://get.blackfire.io/blackfire-player.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getBlackfirePlayerUrl('latest', '5.5')).toBe(
|
||||||
|
'https://get.blackfire.io/blackfire-player-v1.9.3.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getBlackfirePlayerUrl('latest', '7.0')).toBe(
|
||||||
|
'https://get.blackfire.io/blackfire-player-v1.9.3.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getBlackfirePlayerUrl('1.2.3', '7.0')).toBe(
|
||||||
|
'https://get.blackfire.io/blackfire-player-v1.2.3.phar'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('checking getDeployerUri', async () => {
|
it('checking getDeployerUri', async () => {
|
||||||
expect(await tools.getDeployerUrl('latest')).toBe(
|
expect(await tools.getDeployerUrl('latest')).toBe(
|
||||||
'https://deployer.org/deployer.phar'
|
'https://deployer.org/deployer.phar'
|
||||||
|
21
dist/index.js
vendored
21
dist/index.js
vendored
@ -1764,7 +1764,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.addTools = exports.addPackage = exports.addDevTools = exports.addArchive = exports.getCleanedToolsList = exports.getComposerUrl = exports.addComposer = exports.getWpCliUrl = exports.getSymfonyUri = exports.getDeployerUrl = exports.getPharUrl = exports.addPhive = exports.getCodeceptionUri = exports.getCodeceptionUriBuilder = exports.getUri = exports.parseTool = exports.getToolVersion = void 0;
|
exports.addTools = exports.addPackage = exports.addDevTools = exports.addArchive = exports.getCleanedToolsList = exports.getComposerUrl = exports.addComposer = exports.getWpCliUrl = exports.getSymfonyUri = exports.getDeployerUrl = exports.getBlackfirePlayerUrl = exports.getPharUrl = exports.addPhive = exports.getCodeceptionUri = exports.getCodeceptionUriBuilder = exports.getUri = exports.parseTool = exports.getToolVersion = void 0;
|
||||||
const utils = __importStar(__webpack_require__(163));
|
const utils = __importStar(__webpack_require__(163));
|
||||||
/**
|
/**
|
||||||
* Function to get tool version
|
* Function to get tool version
|
||||||
@ -1942,6 +1942,23 @@ async function getPharUrl(domain, tool, prefix, version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.getPharUrl = getPharUrl;
|
exports.getPharUrl = getPharUrl;
|
||||||
|
/**
|
||||||
|
* Function to get blackfire player url for a PHP version.
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
* @param php_version
|
||||||
|
*/
|
||||||
|
async function getBlackfirePlayerUrl(version, php_version) {
|
||||||
|
switch (true) {
|
||||||
|
case /5\.[5-6]|7\.0/.test(php_version) && version == 'latest':
|
||||||
|
version = '1.9.3';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return await getPharUrl('https://get.blackfire.io', 'blackfire-player', 'v', version);
|
||||||
|
}
|
||||||
|
exports.getBlackfirePlayerUrl = getBlackfirePlayerUrl;
|
||||||
/**
|
/**
|
||||||
* Function to get the Deployer url
|
* Function to get the Deployer url
|
||||||
*
|
*
|
||||||
@ -2136,7 +2153,7 @@ async function addTools(tools_csv, php_version, os_version) {
|
|||||||
script += await addPackage(tool, release, tool + '/', os_version);
|
script += await addPackage(tool, release, tool + '/', os_version);
|
||||||
break;
|
break;
|
||||||
case 'blackfire-player':
|
case 'blackfire-player':
|
||||||
url = await getPharUrl('https://get.blackfire.io', tool, 'v', version);
|
url = await getBlackfirePlayerUrl(version, php_version);
|
||||||
script += await addArchive(tool, url, os_version, '"-V"');
|
script += await addArchive(tool, url, os_version, '"-V"');
|
||||||
break;
|
break;
|
||||||
case 'codeception':
|
case 'codeception':
|
||||||
|
27
src/tools.ts
27
src/tools.ts
@ -203,6 +203,31 @@ export async function getPharUrl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to get blackfire player url for a PHP version.
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
* @param php_version
|
||||||
|
*/
|
||||||
|
export async function getBlackfirePlayerUrl(
|
||||||
|
version: string,
|
||||||
|
php_version: string
|
||||||
|
): Promise<string> {
|
||||||
|
switch (true) {
|
||||||
|
case /5\.[5-6]|7\.0/.test(php_version) && version == 'latest':
|
||||||
|
version = '1.9.3';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return await getPharUrl(
|
||||||
|
'https://get.blackfire.io',
|
||||||
|
'blackfire-player',
|
||||||
|
'v',
|
||||||
|
version
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to get the Deployer url
|
* Function to get the Deployer url
|
||||||
*
|
*
|
||||||
@ -454,7 +479,7 @@ export async function addTools(
|
|||||||
script += await addPackage(tool, release, tool + '/', os_version);
|
script += await addPackage(tool, release, tool + '/', os_version);
|
||||||
break;
|
break;
|
||||||
case 'blackfire-player':
|
case 'blackfire-player':
|
||||||
url = await getPharUrl('https://get.blackfire.io', tool, 'v', version);
|
url = await getBlackfirePlayerUrl(version, php_version);
|
||||||
script += await addArchive(tool, url, os_version, '"-V"');
|
script += await addArchive(tool, url, os_version, '"-V"');
|
||||||
break;
|
break;
|
||||||
case 'codeception':
|
case 'codeception':
|
||||||
|
Loading…
Reference in New Issue
Block a user