Subversion Repositories fastphp

Compare Revisions

Regard whitespace Rev 6 → Rev 7

/trunk/Unit1.pas
169,8 → 169,6
Application.ProcessMessages;
 
try
if not FileExists(phpExe) then
begin
phpExe := FastPHPConfig.ReadString('Paths', 'PHPInterpreter', '');
if not FileExists(phpExe) then
begin
187,7 → 185,6
FastPHPConfig.WriteString('Paths', 'PHPInterpreter', phpExe);
FastPHPConfig.UpdateFile;
end;
end;
 
SynEdit1.Lines.SaveToFile(GetScrapFile);
 
217,9 → 214,11
const
MAG_BEGIN = 'fastphp://gotoline/';
var
s: string;
s, myURL, phpExe, scrapDir: string;
lineno: integer;
p: integer;
begin
{$REGION 'Line number references (PHP errors and warnings)'}
if Copy(URL, 1, length(MAG_BEGIN)) = MAG_BEGIN then
begin
try
231,7 → 230,31
Cancel := true;
end;
end;
{$ENDREGION}
 
{$REGION 'Intelligent browser'}
if URL <> 'about:blank' then
begin
p := Pos('?', URL);
myUrl := URL;
 
myURL := StringReplace(myURL, 'about:', '', []); // TODO: ??? wenn ich von about:blank komme, dann ist ein link about:xyz.php !
 
// TODO: unabhängig vom scrap verzeichnis machen!
scrapDir := FastPHPConfig.ReadString('Paths', 'ScrapFile', '');
myURL := ExtractFileDir({Application.ExeName}scrapDir) + '\' + myURL;
 
if p >= 1 then myURL := copy(myURL, 1, p-1);
if FileExists(myURL) then
begin
phpExe := FastPHPConfig.ReadString('Paths', 'PHPInterpreter', ''); // TODO: check if available (auslagern)
 
BrowseContent(WebBrowser1, GetDosOutput('"'+phpExe+'" "'+myURL+'"', ExtractFileDir(Application.ExeName)));
Cancel := true;
end;
end;
{$ENDREGION}
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin