Subversion Repositories fastphp

Rev

Rev 9 | Rev 16 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 13
Line 9... Line 9...
9
  FASTPHP_GOTO_URI_PREFIX = 'fastphp://editor/gotoline/';
9
  FASTPHP_GOTO_URI_PREFIX = 'fastphp://editor/gotoline/';
10
 
10
 
11
function FastPHPConfig: TMemIniFile;
11
function FastPHPConfig: TMemIniFile;
12
function GetPHPExe: string;
12
function GetPHPExe: string;
13
function RunPHPScript(APHPFileName: string): string;
13
function RunPHPScript(APHPFileName: string): string;
14
function ParseCHM(chmFile: string): boolean;
14
function ParseCHM(const chmFile: TFileName): boolean;
15
function IsValidPHPExe(const exeFile: string): boolean;
15
function IsValidPHPExe(const exeFile: TFileName): boolean;
16
 
16
 
17
implementation
17
implementation
18
 
18
 
19
uses
19
uses
20
  Functions;
20
  Functions;
Line 72... Line 72...
72
  phpExe := GetPHPExe;
72
  phpExe := GetPHPExe;
73
  if phpExe = '' then Abort;
73
  if phpExe = '' then Abort;
74
  result := GetDosOutput('"'+phpExe+'" "'+APHPFileName+'"', ExtractFileDir(ParamStr(0)));
74
  result := GetDosOutput('"'+phpExe+'" "'+APHPFileName+'"', ExtractFileDir(ParamStr(0)));
75
end;
75
end;
76
 
76
 
77
function ParseCHM(chmFile: string): boolean;
77
function ParseCHM(const chmFile: TFileName): boolean;
78
var
78
var
79
  test, candidate, candidate2: string;
79
  test, candidate, candidate2: string;
80
  p, p2, q: integer;
80
  p, p2, q: integer;
81
  i: integer;
81
  i: integer;
82
  good: Boolean;
82
  good: Boolean;
Line 184... Line 184...
184
  finally
184
  finally
185
    ini.Free;
185
    ini.Free;
186
  end;
186
  end;
187
end;
187
end;
188
 
188
 
189
function IsValidPHPExe(const exeFile: string): boolean;
189
function IsValidPHPExe(const exeFile: TFileName): boolean;
190
var
190
var
191
  cont: string;
191
  cont: string;
192
begin
192
begin
193
  cont := LoadFileToStr(exeFile);
193
  cont := LoadFileToStr(exeFile);
194
  result := (Pos('php://stdout', cont) >= 0) or
194
  result := (Pos('php://stdout', cont) >= 0) or