| 
									
										
										
										
											2020-08-08 19:02:17 +05:30
										 |  |  | # Function to log license details. | 
					
						
							|  |  |  | add_license_log() { | 
					
						
							| 
									
										
										
										
											2022-01-30 10:00:11 +05:30
										 |  |  |   printf "$GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$ext" "Click to read the $ext related license information" | 
					
						
							| 
									
										
										
										
											2020-08-08 19:02:17 +05:30
										 |  |  |   printf "Cubrid CCI package is required for %s extension.\n" "$ext" | 
					
						
							|  |  |  |   printf "The extension %s and Cubrid CCI are provided under the license linked below.\n" "$ext" | 
					
						
							|  |  |  |   printf "Refer to: \033[35;1m%s \033[0m\n" "https://github.com/CUBRID/cubrid-cci/blob/develop/COPYING" | 
					
						
							| 
									
										
										
										
											2022-01-30 10:00:11 +05:30
										 |  |  |   echo "$END_GROUP" | 
					
						
							| 
									
										
										
										
											2020-08-08 19:02:17 +05:30
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Function to set cubrid repo for the extension. | 
					
						
							|  |  |  | set_cubrid_repo() { | 
					
						
							|  |  |  |   case "${ext:?}" in | 
					
						
							|  |  |  |     "cubrid") cubrid_repo="cubrid-php";; | 
					
						
							|  |  |  |     "pdo_cubrid") cubrid_repo="cubrid-pdo";; | 
					
						
							|  |  |  |   esac | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Function to set cubrid branch for a PHP version. | 
					
						
							|  |  |  | set_cubrid_branch() { | 
					
						
							|  |  |  |   case "${version:?}" in | 
					
						
							|  |  |  |     5.[3-6]) cubrid_branch="RB-9.3.0";; | 
					
						
							|  |  |  |     *) cubrid_branch="develop";; | 
					
						
							|  |  |  |   esac | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | add_cubrid_helper() { | 
					
						
							| 
									
										
										
										
											2021-02-19 07:18:39 +05:30
										 |  |  |   ext=$1 | 
					
						
							|  |  |  |   enable_extension "$ext" extension | 
					
						
							|  |  |  |   if ! check_extension "$ext"; then | 
					
						
							| 
									
										
										
										
											2020-08-08 19:02:17 +05:30
										 |  |  |     status='Installed and enabled' | 
					
						
							|  |  |  |     set_cubrid_repo | 
					
						
							|  |  |  |     set_cubrid_branch | 
					
						
							| 
									
										
										
										
											2021-04-03 05:13:18 +05:30
										 |  |  |     patch_phpize | 
					
						
							|  |  |  |     read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration" | 
					
						
							|  |  |  |     read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)" | 
					
						
							| 
									
										
										
										
											2021-04-19 17:03:57 +05:30
										 |  |  |     add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension | 
					
						
							| 
									
										
										
										
											2021-04-03 05:13:18 +05:30
										 |  |  |     restore_phpize | 
					
						
							| 
									
										
										
										
											2020-08-08 19:02:17 +05:30
										 |  |  |   fi | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Function to add cubrid and pdo_cubrid. | 
					
						
							|  |  |  | add_cubrid() { | 
					
						
							|  |  |  |   ext=$1 | 
					
						
							|  |  |  |   status='Enabled' | 
					
						
							| 
									
										
										
										
											2021-02-19 07:18:39 +05:30
										 |  |  |   add_cubrid_helper "$ext" >/dev/null 2>&1 | 
					
						
							| 
									
										
										
										
											2020-08-08 19:02:17 +05:30
										 |  |  |   add_extension_log "$ext" "$status" | 
					
						
							|  |  |  |   check_extension "$ext" && add_license_log | 
					
						
							| 
									
										
										
										
											2021-04-03 05:13:18 +05:30
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # shellcheck source=. | 
					
						
							| 
									
										
										
										
											2022-01-02 17:21:14 +05:30
										 |  |  | . "${scripts:?}"/extensions/patches/phpize.sh |