Skip to content

Commit

Permalink
Remove cacert.pem installation on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Jan 18, 2025
1 parent 75d4d8c commit c22b26e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GOLANGCI_LINT_VERSION=v1.63
internal/legacy/archives/platform.phar:
curl -L https://github.com/platformsh/legacy-cli/releases/download/v$(LEGACY_CLI_VERSION)/platform.phar -o internal/legacy/archives/platform.phar

internal/legacy/archives/php_windows_amd64: internal/legacy/archives/php_windows.zip internal/legacy/archives/cacert.pem
internal/legacy/archives/php_windows_amd64: internal/legacy/archives/php_windows.zip

internal/legacy/archives/php_darwin_$(GOARCH):
bash build-php-brew.sh $(GOOS) $(PHP_VERSION) $(OPENSSL_VERSION)
Expand Down Expand Up @@ -60,11 +60,6 @@ internal/legacy/archives/php_windows.zip:
sha256sum -c php_windows.zip.sha256 ;\
)

.PHONY: internal/legacy/archives/cacert.pem
internal/legacy/archives/cacert.pem:
mkdir -p internal/legacy/archives
curl https://curl.se/ca/cacert.pem > internal/legacy/archives/cacert.pem

php: $(PHP_BINARY_PATH)

.PHONY: goreleaser
Expand Down
13 changes: 1 addition & 12 deletions internal/legacy/php_manager_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import (
//go:embed archives/php_windows.zip
var phpCLI []byte

//go:embed archives/cacert.pem
var caCert []byte

func (m *phpManagerPerOS) copy() error {
destDir := filepath.Join(m.cacheDir, "php")

Expand All @@ -37,15 +34,8 @@ func (m *phpManagerPerOS) copy() error {
return copyZipFile(f, destDir)
})
}
if err := g.Wait(); err != nil {
return err
}

if err := file.WriteIfNeeded(filepath.Join(destDir, "extras", "cacert.pem"), caCert, 0o644); err != nil {
return err
}

return nil
return g.Wait()
}

func (m *phpManagerPerOS) binPath() string {
Expand All @@ -56,7 +46,6 @@ func (m *phpManagerPerOS) iniSettings() []string {
return []string{
"extension=" + filepath.Join(m.cacheDir, "php", "ext", "php_curl.dll"),
"extension=" + filepath.Join(m.cacheDir, "php", "ext", "php_openssl.dll"),
"openssl.cafile=" + filepath.Join(m.cacheDir, "php", "extras", "cacert.pem"),
}
}

Expand Down

0 comments on commit c22b26e

Please sign in to comment.