setup-php 2.13.0 → 2.17.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 (134) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +990 -922
  3. package/lib/config.d.ts +3 -0
  4. package/lib/config.js +71 -71
  5. package/lib/config.js.map +1 -1
  6. package/lib/coverage.d.ts +5 -0
  7. package/lib/coverage.js +97 -87
  8. package/lib/coverage.js.map +1 -1
  9. package/lib/extensions.d.ts +4 -0
  10. package/lib/extensions.js +214 -200
  11. package/lib/extensions.js.map +1 -1
  12. package/lib/fetch.d.ts +1 -0
  13. package/lib/fetch.js +63 -0
  14. package/lib/fetch.js.map +1 -0
  15. package/lib/install.d.ts +2 -0
  16. package/lib/install.js +75 -81
  17. package/lib/install.js.map +1 -1
  18. package/lib/tools.d.ts +23 -0
  19. package/lib/tools.js +367 -386
  20. package/lib/tools.js.map +1 -1
  21. package/lib/utils.d.ts +21 -0
  22. package/lib/utils.js +261 -291
  23. package/lib/utils.js.map +1 -1
  24. package/package.json +67 -56
  25. package/src/config.ts +82 -82
  26. package/src/configs/brew_extensions +31 -0
  27. package/src/configs/composer.env +2 -0
  28. package/src/configs/ini/jit.ini +3 -0
  29. package/src/configs/ini/php.ini +2 -0
  30. package/src/configs/ini/xdebug.ini +1 -0
  31. package/src/configs/os_releases.csv +19 -17
  32. package/src/configs/php-versions.json +6 -5
  33. package/src/configs/php_packages +12 -0
  34. package/src/configs/{php.json → pm/php.json} +29 -29
  35. package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
  36. package/src/configs/tools.json +278 -235
  37. package/src/configs/tools_schema.json +125 -114
  38. package/src/coverage.ts +144 -142
  39. package/src/extensions.ts +367 -349
  40. package/src/fetch.ts +54 -0
  41. package/src/install.ts +66 -82
  42. package/src/scripts/darwin.sh +285 -249
  43. package/src/scripts/extensions/add_extensions.ps1 +194 -0
  44. package/src/scripts/extensions/add_extensions.sh +184 -0
  45. package/src/scripts/{ext → extensions}/blackfire.ps1 +32 -32
  46. package/src/scripts/{ext → extensions}/blackfire.sh +22 -21
  47. package/src/scripts/{ext → extensions}/couchbase.sh +43 -43
  48. package/src/scripts/{ext → extensions}/cubrid.sh +60 -60
  49. package/src/scripts/extensions/extension_map.php +132 -0
  50. package/src/scripts/{ext → extensions}/firebird.ps1 +19 -19
  51. package/src/scripts/{ext → extensions}/firebird.sh +39 -35
  52. package/src/scripts/{ext → extensions}/gearman.sh +22 -22
  53. package/src/scripts/{ext → extensions}/geos.sh +17 -17
  54. package/src/scripts/{ext → extensions}/http.ps1 +54 -54
  55. package/src/scripts/{ext → extensions}/http.sh +109 -120
  56. package/src/scripts/{ext → extensions}/intl.sh +23 -23
  57. package/src/scripts/{ext → extensions}/ioncube.ps1 +33 -32
  58. package/src/scripts/{ext → extensions}/ioncube.sh +21 -19
  59. package/src/scripts/{ext → extensions}/oci.ps1 +85 -60
  60. package/src/scripts/{ext → extensions}/oci.sh +65 -63
  61. package/src/scripts/{ext → extensions}/patches/firebird.sh +11 -11
  62. package/src/scripts/{ext → extensions}/patches/geos.sh +7 -7
  63. package/src/scripts/{ext → extensions}/patches/http.sh +11 -11
  64. package/src/scripts/{ext → extensions}/patches/pdo_oci.sh +6 -6
  65. package/src/scripts/{ext → extensions}/patches/phpize.sh +26 -26
  66. package/src/scripts/{ext → extensions}/patches/protobuf.sh +4 -4
  67. package/src/scripts/{ext → extensions}/phalcon.ps1 +54 -54
  68. package/src/scripts/{ext → extensions}/phalcon.sh +58 -58
  69. package/src/scripts/{ext → extensions}/source.sh +145 -144
  70. package/src/scripts/extensions/sqlsrv.sh +15 -0
  71. package/src/scripts/linux.sh +269 -256
  72. package/src/scripts/tools/add_tools.ps1 +239 -26
  73. package/src/scripts/tools/add_tools.sh +175 -20
  74. package/src/scripts/tools/blackfire.ps1 +19 -19
  75. package/src/scripts/tools/blackfire.sh +40 -39
  76. package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
  77. package/src/scripts/tools/grpc_php_plugin.sh +58 -58
  78. package/src/scripts/tools/ppa.sh +192 -151
  79. package/src/scripts/tools/protoc.ps1 +38 -38
  80. package/src/scripts/tools/protoc.sh +28 -28
  81. package/src/scripts/tools/symfony.ps1 +14 -0
  82. package/src/scripts/tools/symfony.sh +13 -0
  83. package/src/scripts/unix.sh +186 -0
  84. package/src/scripts/win32.ps1 +352 -494
  85. package/src/tools.ts +512 -538
  86. package/src/utils.ts +415 -500
  87. package/.eslintrc.json +0 -16
  88. package/.github/CODE_OF_CONDUCT.md +0 -76
  89. package/.github/CONTRIBUTING.md +0 -70
  90. package/.github/FUNDING.yml +0 -7
  91. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
  92. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
  93. package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
  94. package/.github/SECURITY.md +0 -29
  95. package/.github/workflows/docs.yml +0 -77
  96. package/.github/workflows/node-workflow.yml +0 -51
  97. package/.github/workflows/workflow.yml +0 -78
  98. package/.idea/workspace.xml +0 -113
  99. package/.prettierrc.json +0 -12
  100. package/__tests__/config.test.ts +0 -52
  101. package/__tests__/coverage.test.ts +0 -110
  102. package/__tests__/extensions.test.ts +0 -263
  103. package/__tests__/install.test.ts +0 -175
  104. package/__tests__/tools.test.ts +0 -524
  105. package/__tests__/utils.test.ts +0 -307
  106. package/action.yml +0 -29
  107. package/dist/index.js +0 -3051
  108. package/examples/bedrock.yml +0 -32
  109. package/examples/blackfire-player.yml +0 -31
  110. package/examples/blackfire.yml +0 -31
  111. package/examples/cakephp-mysql.yml +0 -114
  112. package/examples/cakephp-postgres.yml +0 -112
  113. package/examples/cakephp.yml +0 -92
  114. package/examples/codeigniter.yml +0 -34
  115. package/examples/laravel-mysql.yml +0 -74
  116. package/examples/laravel-postgres.yml +0 -74
  117. package/examples/laravel.yml +0 -42
  118. package/examples/lumen-mysql.yml +0 -74
  119. package/examples/lumen-postgres.yml +0 -74
  120. package/examples/lumen.yml +0 -38
  121. package/examples/phalcon-mysql.yml +0 -74
  122. package/examples/phalcon-postgres.yml +0 -73
  123. package/examples/sage.yml +0 -57
  124. package/examples/slim-framework.yml +0 -34
  125. package/examples/symfony-mysql.yml +0 -57
  126. package/examples/symfony-postgres.yml +0 -55
  127. package/examples/symfony.yml +0 -39
  128. package/examples/yii2-mysql.yml +0 -73
  129. package/examples/yii2-postgres.yml +0 -71
  130. package/examples/zend-framework.yml +0 -36
  131. package/jest.config.js +0 -12
  132. package/lib/sapi.js +0 -64
  133. package/src/scripts/common.sh +0 -314
  134. package/tsconfig.json +0 -18
@@ -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 "$END_GROUP"
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:?}"/extensions/patches/phpize.sh
@@ -0,0 +1,132 @@
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 array Array 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 = array();
29
+ }
30
+
31
+ /**
32
+ * Function to read the extension map.
33
+ */
34
+ private function parseMap($path) {
35
+ if(file_exists($path)) {
36
+ $handle = fopen($path, "r");
37
+ if ($handle) {
38
+ while (($line = fgets($handle)) !== false) {
39
+ $line_parts = explode(':', $line);
40
+ $this->map[$line_parts[0]] = explode(' ', trim($line_parts[1]));
41
+ }
42
+ fclose($handle);
43
+ }
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Function to check if a shared extension file exists.
49
+ *
50
+ * @param string $extension
51
+ * @return bool
52
+ */
53
+ private function checkSharedExtension($extension) {
54
+ $extension_file = $this->extension_dir. DIRECTORY_SEPARATOR . $this->file_prefix . $extension . $this->file_extension;
55
+ return file_exists($extension_file);
56
+ }
57
+
58
+ /**
59
+ * Function to get all shared extensions.
60
+ *
61
+ * @return string[]
62
+ */
63
+ private function getSharedExtensions() {
64
+ $files = scandir($this->extension_dir);
65
+ $extensions = array_diff($files, array('.','..'));
66
+ $filter_pattern = "/$this->file_extension|$this->file_prefix/";
67
+ return array_map(function ($extension) use($filter_pattern) {
68
+ return preg_replace($filter_pattern, '', $extension);
69
+ }, $extensions);
70
+ }
71
+
72
+ /**
73
+ * Function to patch dependencies if there are any bugs in Reflection data.
74
+ *
75
+ * @param string $extension
76
+ * @param array $dependencies
77
+ * @return array
78
+ */
79
+ private function patchDependencies($extension, $dependencies) {
80
+ // memcached 2.2.0 has no dependencies in reflection data.
81
+ if($extension == 'memcached') {
82
+ $dependencies = array_unique(array_merge($dependencies, array('igbinary', 'json', 'msgpack')));
83
+ }
84
+ return $dependencies;
85
+ }
86
+
87
+ /**
88
+ * Function to add extension to the map.
89
+ *
90
+ * @param string $extension
91
+ * @throws ReflectionException
92
+ */
93
+ private function addExtensionToMap($extension) {
94
+ if($this->map && array_key_exists($extension, $this->map) && !empty($this->map[$extension])) {
95
+ return;
96
+ }
97
+ // PHP 5.3 does not allow using $this.
98
+ $self = $this;
99
+
100
+ $ref = new ReflectionExtension($extension);
101
+ $dependencies = array_keys(array_map('strtolower', $ref->getDependencies()));
102
+ $dependencies = $this->patchDependencies($extension, $dependencies);
103
+ $dependencies = array_filter($dependencies, function ($dependency) use ($self) {
104
+ return $self->checkSharedExtension($dependency);
105
+ });
106
+ $self->map[$extension] = $dependencies;
107
+ }
108
+
109
+ /**
110
+ * Function to write the map of shared extensions and their dependent extensions.
111
+ */
112
+ public function write() {
113
+ $path = $_SERVER['argv'][1];
114
+ $this->parseMap($path);
115
+ $extensions = array_map('strtolower', $this->getSharedExtensions());
116
+ foreach ($extensions as $extension) {
117
+ try {
118
+ $this->addExtensionToMap($extension);
119
+ } catch (ReflectionException $e) {
120
+
121
+ }
122
+ }
123
+ $map_string = '';
124
+ foreach($this->map as $extension => $dependencies) {
125
+ $map_string .= $extension . ': ' . implode(' ', $dependencies) . PHP_EOL;
126
+ }
127
+ file_put_contents($path, $map_string);
128
+ }
129
+ }
130
+
131
+ $extension_map = new ExtensionMap();
132
+ $extension_map->write();
@@ -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
  }