Use shivammathur/extensions for phalcon and psr

This commit is contained in:
Shivam Mathur 2021-04-14 14:07:15 +05:30
parent de8537f42a
commit 3c6827c2c3
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
4 changed files with 12 additions and 24 deletions

View File

@ -160,7 +160,7 @@ describe('Extension tests', () => {
it('checking addExtensionOnDarwin', async () => {
let darwin: string = await extensions.addExtension(
'amqp, apcu, Xdebug, pcov, grpc, igbinary, imagick, imap, msgpack, protobuf, redis, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
'amqp, apcu, Xdebug, pcov, grpc, igbinary, imagick, imap, msgpack, phalcon3, phalcon4, protobuf, psr, redis, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
'7.2',
'darwin'
);
@ -173,7 +173,10 @@ describe('Extension tests', () => {
expect(darwin).toContain('add_brew_extension imagick extension');
expect(darwin).toContain('add_brew_extension imap extension');
expect(darwin).toContain('add_brew_extension msgpack extension');
expect(darwin).toContain('add_brew_extension phalcon3 extension');
expect(darwin).toContain('add_brew_extension phalcon4 extension');
expect(darwin).toContain('add_brew_extension protobuf extension');
expect(darwin).toContain('add_brew_extension psr extension');
expect(darwin).toContain('add_brew_extension redis extension');
expect(darwin).toContain('add_brew_extension swoole extension');
expect(darwin).toContain('add_extension sqlite3');
@ -181,12 +184,6 @@ describe('Extension tests', () => {
expect(darwin).toContain('add_unstable_extension ast beta extension');
expect(darwin).toContain('add_pecl_extension grpc 1.2.3 extension');
darwin = await extensions.addExtension('phalcon3', '7.0', 'darwin');
expect(darwin).toContain('add_phalcon phalcon3');
darwin = await extensions.addExtension('phalcon4', '7.3', 'darwin');
expect(darwin).toContain('add_phalcon phalcon4');
darwin = await extensions.addExtension('couchbase', '5.6', 'darwin');
expect(darwin).toContain('add_couchbase');

4
dist/index.js vendored
View File

@ -1822,7 +1822,6 @@ async function addExtensionDarwin(extension_csv, version) {
case /^(5\.[3-6]|7\.[0-4]|8\.0)blackfire(-\d+\.\d+\.\d+)?$/.test(version_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 /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
add_script += await utils.customPackage(ext_name, 'ext', extension, 'darwin');
return;
// match pre-release versions. For example - xdebug-beta
@ -1840,9 +1839,10 @@ async function addExtensionDarwin(extension_csv, version) {
// match 5.6 and newer - amqp, apcu, grpc, igbinary, imagick, imap, msgpack, protobuf, raphf, redis, swoole, xdebug, xdebug2, zmq
// match 7.1 and newer - pcov
// match 5.6 to 7.4 - propro
case /(?<!5\.[3-5])(amqp|apcu|grpc|igbinary|imagick|imap|msgpack|protobuf|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(version_extension):
case /(?<!5\.[3-5])(amqp|apcu|grpc|igbinary|imagick|imap|msgpack|protobuf|psr|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(version_extension):
case /(5\.6|7\.[0-4])propro/.test(version_extension):
case /(?<!5\.[3-6]|7\.0)pcov/.test(version_extension):
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
add_script += await utils.joins('\nadd_brew_extension', ext_name, ext_prefix);
return;
// match sqlite

View File

@ -39,7 +39,6 @@ export async function addExtensionDarwin(
extension
):
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
add_script += await utils.customPackage(
ext_name,
'ext',
@ -72,11 +71,12 @@ export async function addExtensionDarwin(
// match 5.6 and newer - amqp, apcu, grpc, igbinary, imagick, imap, msgpack, protobuf, raphf, redis, swoole, xdebug, xdebug2, zmq
// match 7.1 and newer - pcov
// match 5.6 to 7.4 - propro
case /(?<!5\.[3-5])(amqp|apcu|grpc|igbinary|imagick|imap|msgpack|protobuf|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(
case /(?<!5\.[3-5])(amqp|apcu|grpc|igbinary|imagick|imap|msgpack|protobuf|psr|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(
version_extension
):
case /(5\.6|7\.[0-4])propro/.test(version_extension):
case /(?<!5\.[3-6]|7\.0)pcov/.test(version_extension):
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
add_script += await utils.joins(
'\nadd_brew_extension',
ext_name,

View File

@ -1,19 +1,11 @@
# Helper function to add phalcon.
add_phalcon_helper() {
status='Installed and enabled'
if [ "$os_name" = "Linux" ]; then
update_lists
if [ "$extension" = "phalcon4" ]; then
${apt_install:?} "php${version:?}-psr" "php${version:?}-$extension"
else
${apt_install:?} "php${version:?}-$extension"
fi
update_lists
if [ "$extension" = "phalcon4" ]; then
${apt_install:?} "php${version:?}-psr" "php${version:?}-$extension"
else
sed -i '' '/extension.*psr/d' "${ini_file:?}"
add_brew_tap shivammathur/homebrew-phalcon
brew install phalcon@"${version:?}"_"$extension_major_version"
sudo cp "${brew_prefix:?}"/opt/psr@"${version:?}"/psr.so "${ext_dir:?}"
sudo cp "${brew_prefix:?}"/opt/phalcon@"${version:?}"_"$extension_major_version"/phalcon.so "${ext_dir:?}"
${apt_install:?} "php${version:?}-$extension"
fi
}
@ -56,7 +48,6 @@ add_phalcon4() {
add_phalcon() {
extension=$1
status='Enabled'
os_name=$(uname -s)
phalcon_ini_file="${pecl_file:-${ini_file[@]}}"
extension_major_version=${extension: -1}
if [ "$extension_major_version" = "4" ]; then