Skip to content

Commit 62e792d

Browse files
committed
Revert name changes to phpCgiPath
1 parent 4a69a66 commit 62e792d

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

legacyServer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func ServeLegacy(w http.ResponseWriter, r *http.Request) {
104104
for _, ext := range serverSettings.ExtScriptTypes {
105105
if filepath.Ext(filePath) == "."+ext {
106106
fmt.Printf("[Legacy] Executing script file: %s\n", filepath.ToSlash(filePath))
107-
zipfs.Cgi(w, r, serverSettings.LegacyPHPCGIPath, filePath)
107+
zipfs.Cgi(w, r, serverSettings.PhpCgiPath, filePath)
108108
return
109109
}
110110
}

legacyServer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var testServerSettings = ServerSettings{
3939
ExtIndexTypes: []string{
4040
"htm", "html", "php",
4141
},
42-
LegacyPHPCGIPath: `J:\Data\Flashpoint\Legacy\php-cgi.exe`,
42+
PhpCgiPath: `J:\Data\Flashpoint\Legacy\php-cgi.exe`,
4343
}
4444

4545
func setup(settings *ServerSettings) {

main.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ type ServerSettings struct {
2828
RootPath string `json:"rootPath"`
2929
GameDataPath string `json:"gameDataPath"`
3030
LegacyPHPPath string `json:"legacyPHPPath"`
31-
LegacyPHPCGIPath string `json:"legacyPHPCGIPath"`
3231
LegacyCGIBINPath string `json:"legacyCGIBINPath"`
3332
LegacyHTDOCSPath string `json:"legacyHTDOCSPath"`
33+
PhpCgiPath string `json:"phpCgiPath"`
3434
UseInfinityServer bool `json:"useInfinityServer"`
3535
InfinityServerURL string `json:"infinityServerURL"`
3636
HandleLegacyRequests bool `json:"handleLegacyRequests"`
@@ -82,9 +82,9 @@ func initServer() {
8282
rootPath := flag.String("rootPath", serverSettings.RootPath, "The path that other relative paths use as a base")
8383
gameDataPath := flag.String("gameRootPath", serverSettings.GameDataPath, "This is the path where to find the zips")
8484
legacyPHPPath := flag.String("legacyPHPPath", serverSettings.LegacyPHPPath, "This is the path for PHP")
85-
legacyPHPCGIPath := flag.String("phpCgiPath", serverSettings.LegacyPHPCGIPath, "Path to PHP CGI executable")
8685
legacyCGIBINPath := flag.String("legacyCGIBINPath", serverSettings.LegacyCGIBINPath, "This is the path for CGI-BIN")
8786
legacyHTDOCSPath := flag.String("legacyHTDOCSPath", serverSettings.LegacyHTDOCSPath, "This is the path for HTDOCS")
87+
phpCgiPath := flag.String("phpCgiPath", serverSettings.PhpCgiPath, "Path to PHP CGI executable")
8888
useInfinityServer := flag.Bool("useInfinityServer", serverSettings.UseInfinityServer, "Whether to use the infinity server or not")
8989
infinityServerURL := flag.String("infinityServerURL", serverSettings.InfinityServerURL, "The URL of the infinity server")
9090
handleLegacyRequests := flag.Bool("handleLegacyRequests", serverSettings.HandleLegacyRequests, "Whether to handle legacy requests internally (true) or externally (false)")
@@ -115,11 +115,6 @@ func initServer() {
115115
fmt.Println("Failed to get absolute PHP path")
116116
panic(err)
117117
}
118-
serverSettings.LegacyPHPCGIPath, err = filepath.Abs(path.Join(serverSettings.RootPath, strings.Trim(*legacyPHPCGIPath, string(os.PathSeparator))))
119-
if err != nil {
120-
fmt.Println("Failed to get absolute PHP CGI path")
121-
panic(err)
122-
}
123118
serverSettings.LegacyCGIBINPath, err = filepath.Abs(path.Join(serverSettings.RootPath, strings.Trim(*legacyCGIBINPath, string(os.PathSeparator))))
124119
if err != nil {
125120
fmt.Println("Failed to get absolute cgi-bin path")
@@ -130,6 +125,11 @@ func initServer() {
130125
fmt.Println("Failed to get absolute htdocs path")
131126
panic(err)
132127
}
128+
serverSettings.PhpCgiPath, err = filepath.Abs(path.Join(serverSettings.RootPath, strings.Trim(*phpCgiPath, string(os.PathSeparator))))
129+
if err != nil {
130+
fmt.Println("Failed to get absolute PHP-CGI path")
131+
panic(err)
132+
}
133133
serverSettings.UseInfinityServer = *useInfinityServer
134134
serverSettings.InfinityServerURL = *infinityServerURL
135135
serverSettings.HandleLegacyRequests = *handleLegacyRequests
@@ -146,9 +146,9 @@ func initServer() {
146146
fmt.Println("Root Path:", serverSettings.RootPath)
147147
fmt.Println("Game Data Path:", serverSettings.GameDataPath)
148148
fmt.Println("Legacy PHP Path:", serverSettings.LegacyPHPPath)
149-
fmt.Println("Legacy PHP-CGI Path:", serverSettings.LegacyPHPCGIPath)
150149
fmt.Println("Legacy CGI-BIN Path:", serverSettings.LegacyCGIBINPath)
151150
fmt.Println("Legacy HTDOCS Path:", serverSettings.LegacyHTDOCSPath)
151+
fmt.Println("PHP-CGI Path:", serverSettings.PhpCgiPath)
152152

153153
// Setup the proxy
154154
proxy = goproxy.NewProxyHttpServer()
@@ -375,7 +375,7 @@ XgVWIMrKj4T7p86bcxq4jdWDYUYpRd/2Og==
375375
serverSettings.VerboseLogging,
376376
serverSettings.ExtIndexTypes,
377377
serverSettings.GameDataPath,
378-
serverSettings.LegacyPHPCGIPath,
378+
serverSettings.PhpCgiPath,
379379
serverSettings.ExtMimeTypes,
380380
serverSettings.OverridePaths,
381381
serverSettings.LegacyHTDOCSPath,

proxySettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"rootPath": "../",
33
"gameDataPath": "Data/Games/",
44
"legacyPHPPath": "Legacy/",
5-
"legacyPHPCGIPath": "Legacy/php-cgi.exe",
65
"legacyCGIBINPath": "Legacy/cgi-bin/",
76
"legacyHTDOCSPath": "Legacy/htdocs/",
7+
"phpCgiPath": "Legacy/php-cgi.exe",
88
"useInfinityServer": false,
99
"infinityServerURL": "https://infinity.unstable.life/Flashpoint/Legacy/htdocs/",
1010
"handleLegacyRequests": false,

0 commit comments

Comments
 (0)