setup-php 2.12.0 → 2.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +977 -936
  3. package/package.json +66 -56
  4. package/src/config.ts +82 -82
  5. package/src/configs/brew_extensions +30 -0
  6. package/src/configs/os_releases.csv +17 -0
  7. package/src/configs/php-versions.json +6 -5
  8. package/src/configs/{php.json → pm/php.json} +29 -29
  9. package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
  10. package/src/configs/tools.json +256 -234
  11. package/src/configs/tools_schema.json +114 -103
  12. package/src/coverage.ts +169 -142
  13. package/src/extensions.ts +363 -349
  14. package/src/install.ts +79 -82
  15. package/src/scripts/common.sh +366 -314
  16. package/src/scripts/darwin.sh +257 -248
  17. package/src/scripts/ext/blackfire.ps1 +32 -32
  18. package/src/scripts/ext/blackfire.sh +22 -21
  19. package/src/scripts/ext/couchbase.sh +43 -43
  20. package/src/scripts/ext/cubrid.sh +60 -60
  21. package/src/scripts/ext/extension_map.php +109 -0
  22. package/src/scripts/ext/firebird.ps1 +19 -19
  23. package/src/scripts/ext/firebird.sh +39 -35
  24. package/src/scripts/ext/gearman.sh +22 -22
  25. package/src/scripts/ext/geos.sh +17 -17
  26. package/src/scripts/ext/http.ps1 +54 -54
  27. package/src/scripts/ext/http.sh +120 -120
  28. package/src/scripts/ext/intl.sh +23 -23
  29. package/src/scripts/ext/ioncube.ps1 +33 -32
  30. package/src/scripts/ext/ioncube.sh +21 -19
  31. package/src/scripts/ext/oci.ps1 +60 -60
  32. package/src/scripts/ext/oci.sh +65 -63
  33. package/src/scripts/ext/patches/firebird.sh +11 -11
  34. package/src/scripts/ext/patches/geos.sh +7 -7
  35. package/src/scripts/ext/patches/http.sh +11 -11
  36. package/src/scripts/ext/patches/pdo_oci.sh +6 -6
  37. package/src/scripts/ext/patches/phpize.sh +26 -26
  38. package/src/scripts/ext/patches/protobuf.sh +4 -4
  39. package/src/scripts/ext/phalcon.ps1 +54 -55
  40. package/src/scripts/ext/phalcon.sh +59 -59
  41. package/src/scripts/ext/source.sh +144 -144
  42. package/src/scripts/linux.sh +239 -280
  43. package/src/scripts/tools/add_tools.ps1 +28 -25
  44. package/src/scripts/tools/add_tools.sh +27 -19
  45. package/src/scripts/tools/blackfire.ps1 +19 -21
  46. package/src/scripts/tools/blackfire.sh +40 -35
  47. package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
  48. package/src/scripts/tools/grpc_php_plugin.sh +58 -61
  49. package/src/scripts/tools/ppa.sh +189 -0
  50. package/src/scripts/tools/protoc.ps1 +38 -38
  51. package/src/scripts/tools/protoc.sh +28 -28
  52. package/src/scripts/win32.ps1 +566 -471
  53. package/src/tools.ts +538 -509
  54. package/src/utils.ts +503 -497
  55. package/.eslintrc.json +0 -16
  56. package/.github/CODE_OF_CONDUCT.md +0 -76
  57. package/.github/CONTRIBUTING.md +0 -70
  58. package/.github/FUNDING.yml +0 -7
  59. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
  60. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
  61. package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
  62. package/.github/SECURITY.md +0 -29
  63. package/.github/workflows/docs.yml +0 -77
  64. package/.github/workflows/node-workflow.yml +0 -51
  65. package/.github/workflows/workflow.yml +0 -78
  66. package/.idea/workspace.xml +0 -113
  67. package/.prettierrc.json +0 -12
  68. package/__tests__/config.test.ts +0 -52
  69. package/__tests__/coverage.test.ts +0 -110
  70. package/__tests__/extensions.test.ts +0 -261
  71. package/__tests__/install.test.ts +0 -175
  72. package/__tests__/tools.test.ts +0 -490
  73. package/__tests__/utils.test.ts +0 -303
  74. package/action.yml +0 -29
  75. package/dist/index.js +0 -3001
  76. package/examples/bedrock.yml +0 -32
  77. package/examples/blackfire-player.yml +0 -31
  78. package/examples/blackfire.yml +0 -31
  79. package/examples/cakephp-mysql.yml +0 -114
  80. package/examples/cakephp-postgres.yml +0 -112
  81. package/examples/cakephp.yml +0 -92
  82. package/examples/codeigniter.yml +0 -34
  83. package/examples/laravel-mysql.yml +0 -74
  84. package/examples/laravel-postgres.yml +0 -74
  85. package/examples/laravel.yml +0 -42
  86. package/examples/lumen-mysql.yml +0 -74
  87. package/examples/lumen-postgres.yml +0 -74
  88. package/examples/lumen.yml +0 -38
  89. package/examples/phalcon-mysql.yml +0 -74
  90. package/examples/phalcon-postgres.yml +0 -73
  91. package/examples/sage.yml +0 -57
  92. package/examples/slim-framework.yml +0 -34
  93. package/examples/symfony-mysql.yml +0 -57
  94. package/examples/symfony-postgres.yml +0 -55
  95. package/examples/symfony.yml +0 -39
  96. package/examples/yii2-mysql.yml +0 -73
  97. package/examples/yii2-postgres.yml +0 -71
  98. package/examples/zend-framework.yml +0 -36
  99. package/jest.config.js +0 -12
  100. package/lib/config.js +0 -72
  101. package/lib/config.js.map +0 -1
  102. package/lib/coverage.js +0 -88
  103. package/lib/coverage.js.map +0 -1
  104. package/lib/extensions.js +0 -201
  105. package/lib/extensions.js.map +0 -1
  106. package/lib/install.js +0 -82
  107. package/lib/install.js.map +0 -1
  108. package/lib/sapi.js +0 -64
  109. package/lib/tools.js +0 -387
  110. package/lib/tools.js.map +0 -1
  111. package/lib/utils.js +0 -292
  112. package/lib/utils.js.map +0 -1
  113. package/tsconfig.json +0 -18
@@ -1,43 +1,43 @@
1
- # Function to install libraries required by couchbase
2
- add_couchbase_libs() {
3
- if [ "$(uname -s)" = "Linux" ]; then
4
- trunk="https://github.com/couchbase/libcouchbase/releases"
5
- if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
6
- release="2.10.9"
7
- else
8
- release="$(curl -sL $trunk/latest | grep -Eo "libcouchbase-[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -d'-' -f 2)"
9
- fi
10
- deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu${DISTRIB_RELEASE/./}_${DISTRIB_CODENAME}_amd64.tar"
11
- get -q -n /tmp/libcouchbase.tar "$deb_url"
12
- sudo tar -xf /tmp/libcouchbase.tar -C /tmp
13
- install_packages libev4 libevent-dev
14
- sudo dpkg -i /tmp/libcouchbase-*/*.deb
15
- else
16
- if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
17
- brew install libcouchbase@2
18
- brew link --overwrite --force libcouchbase@2
19
- else
20
- brew install libcouchbase
21
- fi
22
- fi
23
- }
24
-
25
- # Function to add couchbase.
26
- add_couchbase() {
27
- add_couchbase_libs >/dev/null 2>&1
28
- enable_extension "couchbase" "extension"
29
- if check_extension "couchbase"; then
30
- add_log "${tick:?}" "couchbase" "Enabled"
31
- else
32
- if [[ "${version:?}" =~ ${old_versions:?} ]]; then
33
- pecl_install couchbase-2.2.3 >/dev/null 2>&1
34
- elif [[ "${version:?}" =~ 5.6|7.[0-1] ]]; then
35
- pecl_install couchbase-2.6.2 >/dev/null 2>&1
36
- elif [[ "${version:?}" =~ 7.2 ]]; then
37
- pecl_install couchbase-3.0.4 >/dev/null 2>&1
38
- else
39
- pecl_install couchbase >/dev/null 2>&1
40
- fi
41
- add_extension_log "couchbase" "Installed and enabled"
42
- fi
43
- }
1
+ # Function to install libraries required by couchbase
2
+ add_couchbase_libs() {
3
+ if [ "$(uname -s)" = "Linux" ]; then
4
+ trunk="https://github.com/couchbase/libcouchbase/releases"
5
+ if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
6
+ release="2.10.9"
7
+ else
8
+ release="$(curl -sL $trunk/latest | grep -Eo "libcouchbase-[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -d'-' -f 2)"
9
+ fi
10
+ deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu${VERSION_ID/./}_${VERSION_CODENAME}_amd64.tar"
11
+ get -q -n /tmp/libcouchbase.tar "$deb_url"
12
+ sudo tar -xf /tmp/libcouchbase.tar -C /tmp
13
+ install_packages libev4 libevent-dev
14
+ sudo dpkg -i /tmp/libcouchbase-*/*.deb
15
+ else
16
+ if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
17
+ brew install libcouchbase@2
18
+ brew link --overwrite --force libcouchbase@2
19
+ else
20
+ brew install libcouchbase
21
+ fi
22
+ fi
23
+ }
24
+
25
+ # Function to add couchbase.
26
+ add_couchbase() {
27
+ add_couchbase_libs >/dev/null 2>&1
28
+ enable_extension "couchbase" "extension"
29
+ if check_extension "couchbase"; then
30
+ add_log "${tick:?}" "couchbase" "Enabled"
31
+ else
32
+ if [[ "${version:?}" =~ ${old_versions:?} ]]; then
33
+ pecl_install couchbase-2.2.3 >/dev/null 2>&1
34
+ elif [[ "${version:?}" =~ 5.6|7.[0-1] ]]; then
35
+ pecl_install couchbase-2.6.2 >/dev/null 2>&1
36
+ elif [[ "${version:?}" =~ 7.2 ]]; then
37
+ pecl_install couchbase-3.0.4 >/dev/null 2>&1
38
+ else
39
+ pecl_install couchbase >/dev/null 2>&1
40
+ fi
41
+ add_extension_log "couchbase" "Installed and enabled"
42
+ fi
43
+ }
@@ -1,60 +1,60 @@
1
- # Function to log license details.
2
- add_license_log() {
3
- printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$ext" "Click to read the $ext related license information"
4
- printf "Cubrid CCI package is required for %s extension.\n" "$ext"
5
- printf "The extension %s and Cubrid CCI are provided under the license linked below.\n" "$ext"
6
- printf "Refer to: \033[35;1m%s \033[0m\n" "https://github.com/CUBRID/cubrid-cci/blob/develop/COPYING"
7
- echo "::endgroup::"
8
- }
9
-
10
- # Function to setup gcc-7 and g++-7
11
- setup_compiler() {
12
- if ! command -v gcc-7 >/dev/null || ! command -v g++-7 >/dev/null; then
13
- add_ppa ubuntu-toolchain-r/test
14
- add_packages gcc-7 g++-7 -y
15
- fi
16
- printf "gcc g++" | xargs -d ' ' -I {} sudo update-alternatives --install /usr/bin/{} {} /usr/bin/{}-7 7
17
- }
18
-
19
- # Function to set cubrid repo for the extension.
20
- set_cubrid_repo() {
21
- case "${ext:?}" in
22
- "cubrid") cubrid_repo="cubrid-php";;
23
- "pdo_cubrid") cubrid_repo="cubrid-pdo";;
24
- esac
25
- }
26
-
27
- # Function to set cubrid branch for a PHP version.
28
- set_cubrid_branch() {
29
- case "${version:?}" in
30
- 5.[3-6]) cubrid_branch="RB-9.3.0";;
31
- *) cubrid_branch="develop";;
32
- esac
33
- }
34
-
35
- add_cubrid_helper() {
36
- ext=$1
37
- enable_extension "$ext" extension
38
- if ! check_extension "$ext"; then
39
- status='Installed and enabled'
40
- set_cubrid_repo
41
- set_cubrid_branch
42
- patch_phpize
43
- read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration"
44
- read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)"
45
- add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension
46
- restore_phpize
47
- fi
48
- }
49
-
50
- # Function to add cubrid and pdo_cubrid.
51
- add_cubrid() {
52
- ext=$1
53
- status='Enabled'
54
- add_cubrid_helper "$ext" >/dev/null 2>&1
55
- add_extension_log "$ext" "$status"
56
- check_extension "$ext" && add_license_log
57
- }
58
-
59
- # shellcheck source=.
60
- . "${scripts:?}"/ext/patches/phpize.sh
1
+ # Function to log license details.
2
+ add_license_log() {
3
+ printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$ext" "Click to read the $ext related license information"
4
+ printf "Cubrid CCI package is required for %s extension.\n" "$ext"
5
+ printf "The extension %s and Cubrid CCI are provided under the license linked below.\n" "$ext"
6
+ printf "Refer to: \033[35;1m%s \033[0m\n" "https://github.com/CUBRID/cubrid-cci/blob/develop/COPYING"
7
+ echo "::endgroup::"
8
+ }
9
+
10
+ # Function to setup gcc-7 and g++-7
11
+ setup_compiler() {
12
+ if ! command -v gcc-7 >/dev/null || ! command -v g++-7 >/dev/null; then
13
+ add_ppa ubuntu-toolchain-r/test
14
+ add_packages gcc-7 g++-7 -y
15
+ fi
16
+ printf "gcc g++" | xargs -d ' ' -I {} sudo update-alternatives --install /usr/bin/{} {} /usr/bin/{}-7 7
17
+ }
18
+
19
+ # Function to set cubrid repo for the extension.
20
+ set_cubrid_repo() {
21
+ case "${ext:?}" in
22
+ "cubrid") cubrid_repo="cubrid-php";;
23
+ "pdo_cubrid") cubrid_repo="cubrid-pdo";;
24
+ esac
25
+ }
26
+
27
+ # Function to set cubrid branch for a PHP version.
28
+ set_cubrid_branch() {
29
+ case "${version:?}" in
30
+ 5.[3-6]) cubrid_branch="RB-9.3.0";;
31
+ *) cubrid_branch="develop";;
32
+ esac
33
+ }
34
+
35
+ add_cubrid_helper() {
36
+ ext=$1
37
+ enable_extension "$ext" extension
38
+ if ! check_extension "$ext"; then
39
+ status='Installed and enabled'
40
+ set_cubrid_repo
41
+ set_cubrid_branch
42
+ patch_phpize
43
+ read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration"
44
+ read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)"
45
+ add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension
46
+ restore_phpize
47
+ fi
48
+ }
49
+
50
+ # Function to add cubrid and pdo_cubrid.
51
+ add_cubrid() {
52
+ ext=$1
53
+ status='Enabled'
54
+ add_cubrid_helper "$ext" >/dev/null 2>&1
55
+ add_extension_log "$ext" "$status"
56
+ check_extension "$ext" && add_license_log
57
+ }
58
+
59
+ # shellcheck source=.
60
+ . "${scripts:?}"/ext/patches/phpize.sh
@@ -0,0 +1,109 @@
1
+ <?php
2
+
3
+ /**
4
+ * Class for a map of extensions and their dependent extensions.
5
+ *
6
+ * Class ExtensionMap
7
+ */
8
+ class ExtensionMap {
9
+ /** @var string Directory in which shared extensions are stored. */
10
+ private $extension_dir;
11
+
12
+ /** @var string File extension for PHP extension file. */
13
+ private $file_extension;
14
+
15
+ /** @var string Prefix in PHP extension file. */
16
+ private $file_prefix;
17
+
18
+ /** @var string String to store the map */
19
+ private $map;
20
+
21
+ /**
22
+ * ExtensionMap constructor.
23
+ */
24
+ function __construct() {
25
+ $this->extension_dir = ini_get('extension_dir');
26
+ $this->file_extension = (PHP_OS == 'WINNT' ? '.dll' : '.so');
27
+ $this->file_prefix = (PHP_OS == 'WINNT' ? 'php_' : '');
28
+ $this->map = '';
29
+ }
30
+
31
+ /**
32
+ * Function to check if a shared extension file exists.
33
+ *
34
+ * @param string $extension
35
+ * @return bool
36
+ */
37
+ public function checkSharedExtension($extension) {
38
+ $extension_file = $this->extension_dir. DIRECTORY_SEPARATOR . $this->file_prefix . $extension . $this->file_extension;
39
+ return file_exists($extension_file);
40
+ }
41
+
42
+ /**
43
+ * Function to get all shared extensions.
44
+ *
45
+ * @return string[]
46
+ */
47
+ public function getSharedExtensions() {
48
+ $files = scandir($this->extension_dir);
49
+ $extensions = array_diff($files, array('.','..'));
50
+ $filter_pattern = "/$this->file_extension|$this->file_prefix/";
51
+ return array_map(function ($extension) use($filter_pattern) {
52
+ return preg_replace($filter_pattern, '', $extension);
53
+ }, $extensions);
54
+ }
55
+
56
+ /**
57
+ * Function to patch dependencies if there are any bugs in Reflection data.
58
+ *
59
+ * @param string $extension
60
+ * @param array $dependencies
61
+ * @return array
62
+ */
63
+ public function patchDependencies($extension, $dependencies) {
64
+ // memcached 2.2.0 has no dependencies in reflection data.
65
+ if($extension == 'memcached') {
66
+ $dependencies = array_unique(array_merge($dependencies, array('igbinary', 'json', 'msgpack')));
67
+ }
68
+ return $dependencies;
69
+ }
70
+
71
+ /**
72
+ * Function to add extension to the map.
73
+ *
74
+ * @param string $extension
75
+ * @throws ReflectionException
76
+ */
77
+ public function addExtensionToMap($extension) {
78
+ // PHP 5.3 does not allow using $this.
79
+ $self = $this;
80
+
81
+ $ref = new ReflectionExtension($extension);
82
+ $dependencies = array_keys(array_map('strtolower', $ref->getDependencies()));
83
+ $dependencies = $this->patchDependencies($extension, $dependencies);
84
+ $dependencies = array_filter($dependencies, function ($dependency) use ($self) {
85
+ return $self->checkSharedExtension($dependency);
86
+ });
87
+ $self->map .= $extension . ': ' . implode(' ', $dependencies) . PHP_EOL;
88
+ }
89
+
90
+ /**
91
+ * Function to print the map of shared extensions and their dependent extensions.
92
+ *
93
+ * @return string
94
+ */
95
+ public function __toString() {
96
+ $extensions = array_map('strtolower', $this->getSharedExtensions());
97
+ foreach ($extensions as $extension) {
98
+ try {
99
+ $this->addExtensionToMap($extension);
100
+ } catch (ReflectionException $e) {
101
+
102
+ }
103
+ }
104
+ return $this->map;
105
+ }
106
+ }
107
+
108
+ $extension_map = new ExtensionMap();
109
+ echo $extension_map;
@@ -1,20 +1,20 @@
1
- Function Add-Choco() {
2
- try {
3
- if($null -eq (Get-Command -Name choco.exe -ErrorAction SilentlyContinue)) {
4
- # Source: https://docs.chocolatey.org/en-us/choco/setup
5
- Set-ExecutionPolicy Bypass -Scope Process -Force
6
- [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
7
- Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
8
- }
9
- } catch { }
10
- }
11
-
12
- Function Add-Firebird() {
13
- Add-Choco > $null 2>&1
14
- choco install firebird -params '/ClientAndDevTools' -y --force > $null 2>&1
15
- if((Get-ChildItem $env:ProgramFiles\**\**\fbclient.dll | Measure-Object).Count -eq 1) {
16
- Add-Extension pdo_firebird
17
- } else {
18
- Add-Log $cross pdo_firebird "Could not install pdo_firebird on PHP $( $installed.FullVersion )"
19
- }
1
+ Function Add-Choco() {
2
+ try {
3
+ if($null -eq (Get-Command -Name choco.exe -ErrorAction SilentlyContinue)) {
4
+ # Source: https://docs.chocolatey.org/en-us/choco/setup
5
+ Set-ExecutionPolicy Bypass -Scope Process -Force
6
+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
7
+ Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
8
+ }
9
+ } catch { }
10
+ }
11
+
12
+ Function Add-Firebird() {
13
+ Add-Choco > $null 2>&1
14
+ choco install firebird -params '/ClientAndDevTools' -y --force > $null 2>&1
15
+ if((Get-ChildItem $env:ProgramFiles\**\**\fbclient.dll | Measure-Object).Count -eq 1) {
16
+ Add-Extension pdo_firebird
17
+ } else {
18
+ Add-Log $cross pdo_firebird "Could not install pdo_firebird on PHP $( $installed.FullVersion )"
19
+ }
20
20
  }
@@ -1,35 +1,39 @@
1
- add_firebird_client_darwin() {
2
- firebird_tag='R3_0_7'
3
- pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/tag/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
4
- get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
5
- sudo installer -pkg /tmp/firebird.pkg -target /
6
- sudo mkdir -p /opt/firebird/include /opt/firebird/lib
7
- sudo find /Library/Frameworks/Firebird.framework -name '*.h' -exec cp "{}" /opt/firebird/include \;
8
- sudo find /Library/Frameworks/Firebird.framework -name '*.dylib' -exec cp "{}" /opt/firebird/lib \;
9
- }
10
-
11
- add_firebird_helper() {
12
- firebird_dir=$1
13
- tag="$(php_src_tag)"
14
- export PDO_FIREBIRD_CONFIGURE_OPTS="--with-pdo-firebird=$firebird_dir"
15
- export PDO_FIREBIRD_LINUX_LIBS="firebird-dev"
16
- export PDO_FIREBIRD_PATH="ext/pdo_firebird"
17
- add_extension_from_source pdo_firebird https://github.com php php-src "$tag" extension get
18
- }
19
-
20
- add_firebird() {
21
- enable_extension pdo_firebird
22
- if ! check_extension pdo_firebird; then
23
- if [ "$(uname -s)" = "Linux" ]; then
24
- if [[ "${version:?}" =~ 5.3|${nightly_versions:?} ]]; then
25
- add_firebird_helper /usr >/dev/null 2>&1
26
- else
27
- add_pdo_extension firebird >/dev/null 2>&1
28
- fi
29
- else
30
- add_firebird_client_darwin >/dev/null 2>&1
31
- add_firebird_helper /opt/firebird >/dev/null 2>&1
32
- fi
33
- add_extension_log pdo_firebird "Installed and enabled"
34
- fi
35
- }
1
+ add_firebird_client_darwin() {
2
+ firebird_tag='R3_0_7'
3
+ pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/tag/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
4
+ get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
5
+ sudo installer -pkg /tmp/firebird.pkg -target /
6
+ sudo mkdir -p /opt/firebird/include /opt/firebird/lib
7
+ sudo find /Library/Frameworks/Firebird.framework -name '*.h' -exec cp "{}" /opt/firebird/include \;
8
+ sudo find /Library/Frameworks/Firebird.framework -name '*.dylib' -exec cp "{}" /opt/firebird/lib \;
9
+ }
10
+
11
+ add_firebird_helper() {
12
+ firebird_dir=$1
13
+ tag="$(php_src_tag)"
14
+ export PDO_FIREBIRD_CONFIGURE_OPTS="--with-pdo-firebird=$firebird_dir"
15
+ export PDO_FIREBIRD_LINUX_LIBS="firebird-dev"
16
+ export PDO_FIREBIRD_PATH="ext/pdo_firebird"
17
+ add_extension_from_source pdo_firebird https://github.com php php-src "$tag" extension get
18
+ }
19
+
20
+ add_firebird() {
21
+ if [ "$(uname -s )" = "Darwin" ]; then
22
+ add_firebird_client_darwin >/dev/null 2>&1
23
+ fi
24
+ enable_extension pdo_firebird extension
25
+ status="Enabled"
26
+ if ! check_extension pdo_firebird; then
27
+ status="Installed and enabled"
28
+ if [ "$(uname -s)" = "Linux" ]; then
29
+ if [[ "${version:?}" =~ 5.3|${nightly_versions:?} ]]; then
30
+ add_firebird_helper /usr >/dev/null 2>&1
31
+ else
32
+ add_pdo_extension firebird >/dev/null 2>&1
33
+ fi
34
+ else
35
+ add_firebird_helper /opt/firebird >/dev/null 2>&1
36
+ fi
37
+ fi
38
+ add_extension_log pdo_firebird "$status"
39
+ }
@@ -1,22 +1,22 @@
1
- # Helper function to add gearman extension.
2
- add_gearman_helper() {
3
- add_ppa ondrej/pkg-gearman
4
- install_packages libgearman-dev
5
- enable_extension gearman extension
6
- if ! check_extension gearman; then
7
- status="Installed and enabled"
8
- if [[ "${version:?}" =~ 5.[3-5] ]]; then
9
- pecl_install gearman-1.1.2
10
- else
11
- install_packages php"${version:?}"-gearman || pecl_install gearman
12
- fi
13
- enable_extension gearman extension
14
- fi
15
- }
16
-
17
- # Function to add gearman extension.
18
- add_gearman() {
19
- status="Enabled"
20
- add_gearman_helper >/dev/null 2>&1
21
- add_extension_log "gearman" "$status"
22
- }
1
+ # Helper function to add gearman extension.
2
+ add_gearman_helper() {
3
+ add_ppa ondrej/pkg-gearman
4
+ install_packages libgearman-dev
5
+ enable_extension gearman extension
6
+ if ! check_extension gearman; then
7
+ status="Installed and enabled"
8
+ if [[ "${version:?}" =~ 5.[3-5] ]]; then
9
+ pecl_install gearman-1.1.2
10
+ else
11
+ install_packages php"${version:?}"-gearman || pecl_install gearman
12
+ fi
13
+ enable_extension gearman extension
14
+ fi
15
+ }
16
+
17
+ # Function to add gearman extension.
18
+ add_gearman() {
19
+ status="Enabled"
20
+ add_gearman_helper >/dev/null 2>&1
21
+ add_extension_log "gearman" "$status"
22
+ }
@@ -1,17 +1,17 @@
1
- # Helper function to compile and install geos
2
- add_geos_helper() {
3
- export GEOS_LINUX_LIBS='libgeos-dev'
4
- export GEOS_DARWIN_LIBS='geos'
5
- add_extension_from_source geos https://github.com libgeos php-geos 1.0.0 extension get
6
- }
7
-
8
- # Function to add geos
9
- add_geos() {
10
- enable_extension "geos" "extension"
11
- if check_extension "geos"; then
12
- add_log "${tick:?}" "geos" "Enabled"
13
- else
14
- add_geos_helper >/dev/null 2>&1
15
- add_extension_log "geos" "Installed and enabled"
16
- fi
17
- }
1
+ # Helper function to compile and install geos
2
+ add_geos_helper() {
3
+ export GEOS_LINUX_LIBS='libgeos-dev'
4
+ export GEOS_DARWIN_LIBS='geos'
5
+ add_extension_from_source geos https://github.com libgeos php-geos 1.0.0 extension get
6
+ }
7
+
8
+ # Function to add geos
9
+ add_geos() {
10
+ enable_extension "geos" "extension"
11
+ if check_extension "geos"; then
12
+ add_log "${tick:?}" "geos" "Enabled"
13
+ else
14
+ add_geos_helper >/dev/null 2>&1
15
+ add_extension_log "geos" "Installed and enabled"
16
+ fi
17
+ }
@@ -1,55 +1,55 @@
1
- Function Get-ICUUrl() {
2
- Param (
3
- [Parameter(Position = 0, Mandatory = $true)]
4
- [ValidateNotNull()]
5
- $icu_version,
6
- [Parameter(Position = 1, Mandatory = $true)]
7
- [ValidateNotNull()]
8
- $arch,
9
- [Parameter(Position = 2, Mandatory = $true)]
10
- [ValidateNotNull()]
11
- $vs_version
12
- )
13
- $trunk = "https://windows.php.net"
14
- $urls=@("${trunk}/downloads/php-sdk/deps/${vs_version}/${arch}", "${trunk}/downloads/php-sdk/deps/archives/${vs_version}/${arch}")
15
- foreach ($url in $urls) {
16
- $web_content = Invoke-WebRequest -Uri $url
17
- foreach ($link in $web_content.Links) {
18
- if ($link -match "/.*ICU-${icu_version}.*/") {
19
- return $trunk + $link.HREF
20
- }
21
- }
22
- }
23
- }
24
-
25
- Function Repair-ICU() {
26
- $icu = deplister $ext_dir\php_http.dll | Select-String "icu[a-z]+(\d+).dll,([A-Z]+)" | Foreach-Object { $_.Matches }
27
- if($icu -and $icu.Groups[2].Value -ne 'OK') {
28
- $vs = "vs" + $installed.VCVersion
29
- if ($installed.VCVersion -lt 16) {
30
- $vs = "vc" + $installed.VCVersion
31
- }
32
- $zip_url = Get-ICUUrl $icu.Groups[1].Value $installed.Architecture $vs
33
- if ($zip_url -ne '') {
34
- New-Item -Path "$php_dir" -Name "icu" -ItemType "directory" | Out-Null
35
- Invoke-WebRequest -Uri $zip_url -OutFile "$php_dir\icu\icu.zip"
36
- Expand-Archive -Path $php_dir\icu\icu.zip -DestinationPath $php_dir\icu -Force
37
- Get-ChildItem $php_dir\icu\bin -Filter *.dll | Copy-Item -Destination $php_dir -Force
38
- }
39
- }
40
- }
41
-
42
- Function Add-Http() {
43
- Add-Extension raphf >$null 2>&1
44
- if($version -lt '8.0') {
45
- Add-Extension propro >$null 2>&1
46
- }
47
- Add-Extension pecl_http >$null 2>&1
48
- Repair-ICU
49
- try {
50
- php --ri "http" 2> $null | Out-Null
51
- Add-Log $tick "http" "Installed and enabled"
52
- } catch {
53
- Add-Log $cross "http" "Could not install http on PHP $( $installed.FullVersion )"
54
- }
1
+ Function Get-ICUUrl() {
2
+ Param (
3
+ [Parameter(Position = 0, Mandatory = $true)]
4
+ [ValidateNotNull()]
5
+ $icu_version,
6
+ [Parameter(Position = 1, Mandatory = $true)]
7
+ [ValidateNotNull()]
8
+ $arch,
9
+ [Parameter(Position = 2, Mandatory = $true)]
10
+ [ValidateNotNull()]
11
+ $vs_version
12
+ )
13
+ $trunk = "https://windows.php.net"
14
+ $urls=@("${trunk}/downloads/php-sdk/deps/${vs_version}/${arch}", "${trunk}/downloads/php-sdk/deps/archives/${vs_version}/${arch}")
15
+ foreach ($url in $urls) {
16
+ $web_content = Invoke-WebRequest -Uri $url
17
+ foreach ($link in $web_content.Links) {
18
+ if ($link -match "/.*ICU-${icu_version}.*/") {
19
+ return $trunk + $link.HREF
20
+ }
21
+ }
22
+ }
23
+ }
24
+
25
+ Function Repair-ICU() {
26
+ $icu = deplister $ext_dir\php_http.dll | Select-String "icu[a-z]+(\d+).dll,([A-Z]+)" | Foreach-Object { $_.Matches }
27
+ if($icu -and $icu.Groups[2].Value -ne 'OK') {
28
+ $vs = "vs" + $installed.VCVersion
29
+ if ($installed.VCVersion -lt 16) {
30
+ $vs = "vc" + $installed.VCVersion
31
+ }
32
+ $zip_url = Get-ICUUrl $icu.Groups[1].Value $installed.Architecture $vs
33
+ if ($zip_url -ne '') {
34
+ New-Item -Path "$php_dir" -Name "icu" -ItemType "directory" -Force > $null 2>&1
35
+ Invoke-WebRequest -Uri $zip_url -OutFile "$php_dir\icu\icu.zip"
36
+ Expand-Archive -Path $php_dir\icu\icu.zip -DestinationPath $php_dir\icu -Force
37
+ Get-ChildItem $php_dir\icu\bin -Filter *.dll | Copy-Item -Destination $php_dir -Force
38
+ }
39
+ }
40
+ }
41
+
42
+ Function Add-Http() {
43
+ Add-Extension raphf >$null 2>&1
44
+ if($version -lt '8.0') {
45
+ Add-Extension propro >$null 2>&1
46
+ }
47
+ Add-Extension pecl_http >$null 2>&1
48
+ Repair-ICU
49
+ try {
50
+ php --ri "http" 2> $null | Out-Null
51
+ Add-Log $tick "http" "Installed and enabled"
52
+ } catch {
53
+ Add-Log $cross "http" "Could not install http on PHP $( $installed.FullVersion )"
54
+ }
55
55
  }