Rev 41 | Rev 70 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 41 | Rev 42 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | Buffer: array[0..255] of AnsiChar; |
49 | Buffer: array[0..255] of AnsiChar; |
50 | BytesRead, BytesWritten: Cardinal; |
50 | BytesRead, BytesWritten: Cardinal; |
51 | WorkDir: string; |
51 | WorkDir: string; |
52 | Handle: Boolean; |
52 | Handle: Boolean; |
53 | testString: AnsiString; |
53 | testString: AnsiString; |
54 | CommandLine: string; |
- | |
55 | Output, OutputLastCache: string; |
54 | Output, OutputLastCache: string; |
56 | const |
55 | const |
57 | SIGNAL_END_OF_TRANSMISSION = #1#2#3#4#5#6#7#8; |
56 | SIGNAL_END_OF_TRANSMISSION = #1#2#3#4#5#6#7#8; |
58 | SIGNAL_TERMINATE = #8#7#6#5#4#3#2#1; |
57 | SIGNAL_TERMINATE = #8#7#6#5#4#3#2#1; |
59 | begin |
58 | begin |
Line 63... | Line 62... | ||
63 | WorkDir := Self.WorkDir; |
62 | WorkDir := Self.WorkDir; |
64 | 63 | ||
65 | if not FileExists(Self.PhpExe) then exit; |
64 | if not FileExists(Self.PhpExe) then exit; |
66 | if not FileExists(Self.PhpFile) then exit; |
65 | if not FileExists(Self.PhpFile) then exit; |
67 | 66 | ||
68 | CommandLine := '"'+Self.PhpExe+'" "'+Self.PhpFile+'"'; |
- | |
69 | - | ||
70 | Output := ''; |
67 | Output := ''; |
71 | OutputLastCache := ''; |
68 | OutputLastCache := ''; |
72 | with SA do begin |
69 | with SA do begin |
73 | nLength := SizeOf(SA); |
70 | nLength := SizeOf(SA); |
74 | bInheritHandle := True; |
71 | bInheritHandle := True; |
Line 86... | Line 83... | ||
86 | hStdInput := StdInPipeRead; |
83 | hStdInput := StdInPipeRead; |
87 | hStdOutput := StdOutPipeWrite; |
84 | hStdOutput := StdOutPipeWrite; |
88 | hStdError := StdOutPipeWrite; |
85 | hStdError := StdOutPipeWrite; |
89 | end; |
86 | end; |
90 | 87 | ||
91 | Handle := CreateProcess(nil, PChar('cmd.exe /C "' + CommandLine + '"'), |
88 | Handle := CreateProcess(nil, PChar('"'+Self.PhpExe+'" -f "'+Self.PhpFile+'"'), |
92 | nil, nil, True, 0, nil, PChar(WorkDir), SI, PI); |
89 | nil, nil, True, 0, nil, PChar(WorkDir), SI, PI); |
93 | CloseHandle(StdOutPipeWrite); |
90 | CloseHandle(StdOutPipeWrite); |
94 | 91 | ||
95 | sleep(100); |
92 | sleep(100); |
96 | 93 |