fpapache.pp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {
  2. $Id: header,v 1.1 2000/07/13 06:33:45 michael Exp $
  3. This file is part of the Free Component Library (FCL)
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$mode objfpc}
  12. {$H+}
  13. unit fpapache;
  14. interface
  15. uses
  16. sysutils, custapp, custapache;
  17. Type
  18. // Backwards compatibility defines.
  19. TApacheHandler = custapache.TApacheHandler;
  20. TApacheRequest = custapache.TApacheRequest;
  21. TApacheResponse = custapache.TApacheResponse;
  22. THandlerPriority = custapache.THandlerPriority;
  23. TBeforeRequestEvent = custapache.TBeforeRequestEvent;
  24. TCustomApacheApplication = custapache.TCustomApacheApplication;
  25. TApacheApplication = Class(TCustomApacheApplication)
  26. Public
  27. Property HandlerPriority;
  28. Property BeforeModules;
  29. Property AfterModules;
  30. Property AllowDefaultModule;
  31. Property OnGetModule;
  32. Property BaseLocation;
  33. Property ModuleName;
  34. Property MaxRequests;
  35. Property IdleWebModuleCount;
  36. Property WorkingWebModuleCount;
  37. end;
  38. Function Application : TCustomApacheApplication;
  39. Implementation
  40. Function Application : TCustomApacheApplication;
  41. begin
  42. Result:=CustApache.Application;
  43. end;
  44. Procedure InitApache;
  45. begin
  46. custapache.Application:=TApacheApplication.Create(Nil);
  47. if not assigned(CustomApplication) then
  48. CustomApplication := Application;
  49. end;
  50. Procedure DoneApache;
  51. begin
  52. Try
  53. if CustomApplication=CustApache.Application then
  54. CustomApplication := nil;
  55. FreeAndNil(CustApache.Application);
  56. except
  57. if ShowCleanUpErrors then
  58. Raise;
  59. end;
  60. end;
  61. Initialization
  62. InitApache;
  63. Finalization
  64. DoneApache;
  65. end.