mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-10-31 07:16:22 +07:00 
			
		
		
		
	Fix comments in darwin.sh
This commit is contained in:
		| @ -7,13 +7,13 @@ self_hosted_helper() { | |||||||
|   fi |   fi | ||||||
| } | } | ||||||
|  |  | ||||||
| # Function to delete extension | # Function to delete extension. | ||||||
| delete_extension() { | delete_extension() { | ||||||
|   extension=$1 |   extension=$1 | ||||||
|   sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1 |   sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1 | ||||||
| } | } | ||||||
|  |  | ||||||
| # Function to disable extension | # Function to disable extension. | ||||||
| disable_extension() { | disable_extension() { | ||||||
|   extension=$1 |   extension=$1 | ||||||
|   sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}" |   sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}" | ||||||
| @ -32,7 +32,7 @@ remove_extension() { | |||||||
|   fi |   fi | ||||||
| } | } | ||||||
|  |  | ||||||
| # Function to fetch a brew tap | # Function to fetch a brew tap. | ||||||
| fetch_brew_tap() { | fetch_brew_tap() { | ||||||
|   tap=$1 |   tap=$1 | ||||||
|   tap_user=$(dirname "$tap") |   tap_user=$(dirname "$tap") | ||||||
| @ -78,7 +78,7 @@ add_brew_extension() { | |||||||
|   fi |   fi | ||||||
| } | } | ||||||
|  |  | ||||||
| # Function to setup extensions | # Function to setup extensions. | ||||||
| add_extension() { | add_extension() { | ||||||
|   extension=$1 |   extension=$1 | ||||||
|   prefix=$2 |   prefix=$2 | ||||||
| @ -106,7 +106,7 @@ add_pecl() { | |||||||
|   add_log "${tick:?}" "PECL" "Found PECL $pecl_version" |   add_log "${tick:?}" "PECL" "Found PECL $pecl_version" | ||||||
| } | } | ||||||
|  |  | ||||||
| # Function to link all libraries of a formula | # Function to link all libraries of a formula. | ||||||
| link_libraries() { | link_libraries() { | ||||||
|   formula=$1 |   formula=$1 | ||||||
|   formula_prefix="$(brew --prefix "$formula")" |   formula_prefix="$(brew --prefix "$formula")" | ||||||
| @ -117,13 +117,14 @@ link_libraries() { | |||||||
|   done |   done | ||||||
| } | } | ||||||
|  |  | ||||||
| # Patch brew to overwrite packages | # Patch brew to overwrite packages. | ||||||
| patch_brew() { | patch_brew() { | ||||||
|   sudo sed -i '' "s/ keg.link(verbose: verbose?)/ keg.link(verbose: verbose?, overwrite: true)/" "$brew_repo"/Library/Homebrew/formula_installer.rb |   sudo sed -i '' "s/ keg.link(verbose: verbose?)/ keg.link(verbose: verbose?, overwrite: true)/" "$brew_repo"/Library/Homebrew/formula_installer.rb | ||||||
|   # shellcheck disable=SC2064 |   # shellcheck disable=SC2064 | ||||||
|   trap "git -C $brew_repo stash >/dev/null 2>&1" exit |   trap "git -C $brew_repo stash >/dev/null 2>&1" exit | ||||||
| } | } | ||||||
|  |  | ||||||
|  | # Helper function to update the dependencies. | ||||||
| update_dependencies_helper() { | update_dependencies_helper() { | ||||||
|   dependency=$1 |   dependency=$1 | ||||||
|   get -q -n "$tap_dir/homebrew/homebrew-core/Formula/$dependency.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$dependency.rb" |   get -q -n "$tap_dir/homebrew/homebrew-core/Formula/$dependency.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$dependency.rb" | ||||||
| @ -143,7 +144,7 @@ update_dependencies() { | |||||||
|   fi |   fi | ||||||
| } | } | ||||||
|  |  | ||||||
| # Function to fix dependencies on install php version | # Function to fix dependencies on install PHP version. | ||||||
| fix_dependencies() { | fix_dependencies() { | ||||||
|   broken_deps_paths=$(php -v 2>&1 | grep -Eo '/opt/[a-zA-Z0-9@\.]+') |   broken_deps_paths=$(php -v 2>&1 | grep -Eo '/opt/[a-zA-Z0-9@\.]+') | ||||||
|   if [ "x$broken_deps_paths" != "x" ]; then |   if [ "x$broken_deps_paths" != "x" ]; then | ||||||
| @ -178,7 +179,7 @@ add_php() { | |||||||
|   brew link --force --overwrite "$php_formula" |   brew link --force --overwrite "$php_formula" | ||||||
| } | } | ||||||
|  |  | ||||||
| # Function to Setup PHP | # Function to Setup PHP. | ||||||
| setup_php() { | setup_php() { | ||||||
|   step_log "Setup PHP" |   step_log "Setup PHP" | ||||||
|   existing_version=$(get_brewed_php) |   existing_version=$(get_brewed_php) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Shivam Mathur
					Shivam Mathur