MCPcopy Index your code
hub / github.com/php/frankenphp / cmdPHPCLI

Function cmdPHPCLI

caddy/php-cli.go:28–50  ·  view source on GitHub ↗
(fs caddycmd.Flags)

Source from the content-addressed store, hash-verified

26}
27
28func cmdPHPCLI(fs caddycmd.Flags) (int, error) {
29 args := os.Args[2:]
30 if len(args) < 1 {
31 return 1, errors.New("the path to the PHP script is required")
32 }
33
34 if frankenphp.EmbeddedAppPath != "" {
35 if _, err := os.Stat(args[0]); err != nil {
36 args[0] = filepath.Join(frankenphp.EmbeddedAppPath, args[0])
37 }
38 }
39
40 var status int
41 if len(args) >= 2 && args[0] == "-r" {
42 status = frankenphp.ExecutePHPCode(args[1])
43 } else {
44 status = frankenphp.ExecuteScriptCLI(args[0], args)
45 }
46
47 os.Exit(status)
48
49 return status, nil
50}

Callers

nothing calls this directly

Calls 2

ExecutePHPCodeFunction · 0.92
ExecuteScriptCLIFunction · 0.92

Tested by

no test coverage detected