forked from zamronypj/fano
/
SimpleUnixFastCGIAppImpl.pas
89 lines (76 loc) · 2.88 KB
/
SimpleUnixFastCGIAppImpl.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{*!
* Fano Web Framework (https://fanoframework.github.io)
*
* @link https://github.com/fanoframework/fano
* @copyright Copyright (c) 2018 Zamrony P. Juhara
* @license https://github.com/fanoframework/fano/blob/master/LICENSE (MIT)
*}
unit SimpleUnixFastCGIAppImpl;
interface
{$MODE OBJFPC}
uses
BaseSimpleFastCGIAppImpl,
DependencyContainerIntf,
DispatcherIntf,
ErrorHandlerIntf;
type
(*!-----------------------------------------------
* Base abstract class that implements IWebApplication
* and provide basic default for easier setup for
* FastCGI web application as daemon using Unix Domain socket
*------------------------------------------------------
* This is base class you need for FastCGI web application
* that is run as daemon with Apache and mod_proxy_fcgi module
* or nginx
*------------------------------------------------------
* @author Zamrony P. Juhara <zamronypj@yahoo.com>
*-----------------------------------------------*)
TSimpleUnixFastCGIWebApplication = class(TBaseSimpleFastCGIWebApplication)
public
(*!-----------------------------------------------
* constructor
*------------------------------------------------
* @param socketFilename socket file where to listen
* @param container dependency container
* @param errHandler error handler
* @param dispatcher, dspatcher instance instance
*----------------------------------------------
* This is provided to simplify thing by providing
* default service provider
*-----------------------------------------------*)
constructor create(
const socketFilename : string;
const container : IDependencyContainer = nil;
const errHandler : IErrorHandler = nil;
const dispatcherInst : IDispatcher = nil
);
end;
implementation
uses
UnixSocketSvrImpl;
(*!-----------------------------------------------
* constructor
*------------------------------------------------
* @param socketFilename socket file where to listen
* @param container dependency container
* @param errHandler error handler
* @param dispatcher, dspatcher instance instance
*----------------------------------------------
* This is provided to simplify thing by providing
* default service provider
*-----------------------------------------------*)
constructor TSimpleUnixFastCGIWebApplication.create(
const socketFilename : string;
const container : IDependencyContainer = nil;
const errHandler : IErrorHandler = nil;
const dispatcherInst : IDispatcher = nil
);
begin
inherited create(
TUnixSocketSvr.create(socketFilename),
container,
errHandler,
dispatcherInst
);
end;
end.