Code Duplication    Length = 42-45 lines in 2 locations

PHPDaemon/Servers/FastCGI/Pool.php 1 location

@@ 39-80 (lines=42) @@
36
     * Overriden from ConnectionPool::getConfigDefaults
37
     * @return array|bool
38
     */
39
    protected function getConfigDefaults()
40
    {
41
        return [
42
            /* [string|array] Listen addresses */
43
            'listen' => 'tcp://127.0.0.1,unix:///tmp/phpdaemon.fcgi.sock',
44
45
            /* [integer] Listen port */
46
            'port' => 9000,
47
48
            /* [boolean] Read request body from the file given in REQUEST_BODY_FILE parameter */
49
            'auto-read-body-file' => 1,
50
51
            /* [string] Allowed clients ip list */
52
            'allowed-clients' => '127.0.0.1',
53
54
            /* [boolean] Enable X-Sendfile? */
55
            'send-file' => 0,
56
57
            /* [string] Directory for X-Sendfile */
58
            'send-file-dir' => '/dev/shm',
59
60
            /* [string] Prefix for files used for X-Sendfile */
61
            'send-file-prefix' => 'fcgi-',
62
63
            /* [boolean] Use X-Sendfile only if server['USE_SENDFILE'] provided. */
64
            'send-file-onlybycommand' => 0,
65
66
            /* [boolean] Expose PHPDaemon version by X-Powered-By Header */
67
            'expose' => 1,
68
69
            /* [Time] Keepalive time */
70
            'keepalive' => new Time('0s'),
71
72
            /* [Size] Chunk size */
73
            'chunksize' => new Size('8k'),
74
75
            /* [string] Default charset */
76
            'defaultcharset' => 'utf-8',
77
78
            /* [Size] Maximum uploading file size. */
79
            'upload-max-size' => new Size(ini_get('upload_max_filesize')),
80
        ];
81
    }
82
}
83

PHPDaemon/Servers/HTTP/Pool.php 1 location

@@ 54-98 (lines=45) @@
51
     * Overriden from AppInstance::getConfigDefaults
52
     * @return array|bool
53
     */
54
    protected function getConfigDefaults()
55
    {
56
        return [
57
            /* [string|array] Listen addresses */
58
            'listen' => 'tcp://0.0.0.0',
59
60
            /* [integer] Listen port */
61
            'port' => 80,
62
63
            /* [boolean] Enable X-Sendfile? */
64
            'send-file' => 0,
65
66
            /* [string] Directory for X-Sendfile */
67
            'send-file-dir' => '/dev/shm',
68
69
            /* [string] Prefix for files used for X-Sendfile */
70
            'send-file-prefix' => 'http-',
71
72
            /* [boolean] Use X-Sendfile only if server['USE_SENDFILE'] provided. */
73
            'send-file-onlybycommand' => 0,
74
75
            /* [boolean] Expose PHPDaemon version by X-Powered-By Header */
76
            'expose' => 1,
77
78
            /* [Time] Keepalive time */
79
            'keepalive' => new Time('0s'),
80
81
            /* [Size] Chunk size */
82
            'chunksize' => new Size('8k'),
83
84
            /* [string] Default charset */
85
            'defaultcharset' => 'utf-8',
86
87
            /* [string] Related WebSocketServer instance name */
88
            'wss-name' => '',
89
90
            /* [string] Related FlashPolicyServer instance name */
91
            'fps-name' => '',
92
93
            /* [Size] Maximum uploading file size. */
94
            'upload-max-size' => new Size(ini_get('upload_max_filesize')),
95
96
            /* [string] Reponder application (if you do not want to use AppResolver) */
97
            'responder' => null,
98
        ];
99
    }
100
}
101