Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Dec 3, 2023
1 parent 3b575a8 commit cf3619b
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"time"
)

const embedDir = "embed"

// The path of the embedded PHP application (empty if none)
var EmbeddedAppPath string

Expand All @@ -33,24 +31,14 @@ func init() {
return
}

e, err := os.Executable()
if err != nil {
panic(err)
}

e, err = filepath.EvalSymlinks(e)
if err != nil {
panic(err)
}

// TODO: use XXH3 instead of MD5
h := md5.Sum(embeddedApp)
appPath := filepath.Join(os.TempDir(), "frankenphp_"+hex.EncodeToString(h[:]))

if err := os.RemoveAll(appPath); err != nil {
panic(err)
}
if err := untar(appPath); err != nil {
os.RemoveAll(appPath)
panic(err)
}

Expand Down

0 comments on commit cf3619b

Please sign in to comment.