mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-10-30 23:07:56 +07:00 
			
		
		
		
	Add support to configure icu version
This commit is contained in:
		
							
								
								
									
										23
									
								
								src/scripts/ext/intl.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/scripts/ext/intl.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,23 @@ | ||||
| # Function to install ICU | ||||
| install_icu() { | ||||
|   icu=$1 | ||||
|   if [ "$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")" != "$icu" ]; then | ||||
|     sudo curl -o /tmp/icu.tar.zst -sL "https://dl.bintray.com/shivammathur/icu4c/icu4c-$icu.tar.zst" | ||||
|     sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local | ||||
|     sudo cp -r /usr/local/icu/lib/* /usr/lib/x86_64-linux-gnu/ | ||||
|   fi | ||||
| } | ||||
|  | ||||
| # Function to add ext-intl with the given version of ICU | ||||
| add_intl() { | ||||
|   icu=$(echo "$1" | cut -d'-' -f 2) | ||||
|   supported_version=$(curl "${curl_opts[@]:?}" https://api.bintray.com/packages/shivammathur/icu4c/icu4c | grep -Po "$icu" | head -n 1) | ||||
|   if [ "$icu" != "$supported_version" ]; then | ||||
|     add_log "${cross:?}" "intl" "ICU $icu is not supported" | ||||
|   else | ||||
|     install_icu "$icu" >/dev/null 2>&1 | ||||
|     sudo curl "${curl_opts[@]:?}" -o "${ext_dir:?}/intl.so" "https://dl.bintray.com/shivammathur/icu4c/php${version:?}-intl-$icu.so" | ||||
|     enable_extension intl extension | ||||
|     add_extension_log intl "Installed and enabled with ICU $icu" | ||||
|   fi | ||||
| } | ||||
| @ -230,7 +230,7 @@ add_extension_from_source() { | ||||
|   ( | ||||
|     add_devtools | ||||
|     delete_extension "$extension" | ||||
|     curl -o /tmp/"$extension".tar.gz "${curl_opts[@]}" https://github.com/"$repo"/archive/"$release".tar.gz | ||||
|     curl -o /tmp/"$extension".tar.gz  "${curl_opts[@]}" https://github.com/"$repo"/archive/"$release".tar.gz | ||||
|     tar xf /tmp/"$extension".tar.gz -C /tmp | ||||
|     cd /tmp/"$extension-$release" || exit 1 | ||||
|     phpize  && ./configure "$args" && make && sudo make install | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shivam Mathur
					Shivam Mathur