MCPcopy Create free account
hub / github.com/buggregator/server / Parse

Method Parse

modules/vardumper/php_process.go:83–108  ·  view source on GitHub ↗

Parse sends a base64 payload to the PHP process and reads the JSON result.

(base64Payload string)

Source from the content-addressed store, hash-verified

81
82// Parse sends a base64 payload to the PHP process and reads the JSON result.
83func (p *PHPProcess) Parse(base64Payload string) (*ParseResult, error) {
84 p.mu.Lock()
85 defer p.mu.Unlock()
86
87 // Send payload line.
88 if _, err := fmt.Fprintf(p.stdin, "%s\n", base64Payload); err != nil {
89 return nil, fmt.Errorf("write to PHP: %w", err)
90 }
91
92 // Read response line.
93 line, err := p.stdout.ReadString('\n')
94 if err != nil {
95 return nil, fmt.Errorf("read from PHP: %w", err)
96 }
97
98 var result ParseResult
99 if err := json.Unmarshal([]byte(line), &result); err != nil {
100 return nil, fmt.Errorf("unmarshal PHP response: %w", err)
101 }
102
103 if result.Error != "" {
104 return nil, fmt.Errorf("PHP parser error: %s", result.Error)
105 }
106
107 return &result, nil
108}
109
110// Stop terminates the PHP process.
111func (p *PHPProcess) Stop() {

Callers 10

parseRFC3339Function · 0.80
parseTimestampFunction · 0.80
resolveURLFunction · 0.80
UnmarshalJSONMethod · 0.80
classifySpanFunction · 0.80
parseRequestURIFunction · 0.80
parseTimestampFunction · 0.80
TestSMTPAPI_CursorFunction · 0.80
processPayloadMethod · 0.80
LoadConfigFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestSMTPAPI_CursorFunction · 0.64